//----------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. // // // Attribute stubs to allow compiling on CoreClr. // //----------------------------------------------------------------------- namespace Microsoft.Isam.Esent.Interop { using System; using System.Diagnostics.CodeAnalysis; /// /// A fake enumeration to allow compilation on platforms that lack this enumeration. /// public enum SecurityAction { /// /// A fake enumeration to allow compilation on platforms that lack this enumeration. /// LinkDemand } /// /// A fake attribute to allow compilation on platforms that lack this attribute. /// //// The real one inherits from System.Security.Permissions.CodeAccessSecurityAttribute. [SerializableAttribute] [ComVisibleAttribute(true)] [AttributeUsageAttribute( AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method, AllowMultiple = true, Inherited = false)] internal sealed class SecurityPermissionAttribute : Attribute { /// /// Initializes a new instance of the class. /// /// /// The action. /// public SecurityPermissionAttribute( SecurityAction action) { } /// /// Prints out the object's contents. /// /// A string represenetation or the object. public override string ToString() { return base.ToString(); } } /// /// A fake attribute to allow compilation on platforms that lack this attribute. /// [ComVisibleAttribute(true)] [AttributeUsageAttribute(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface, Inherited = false)] [SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "Reviewed. Suppression is OK here because it's a collection of trivial classes.")] [SuppressMessage( "Microsoft.StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "These stub classes are compiled only on some platforms that do not contain the entire framework, e.g. new Windows user interface.")] internal sealed class BestFitMappingAttribute : Attribute { /// /// Initializes a new instance of the class. /// /// /// The best fit mapping. /// public BestFitMappingAttribute( bool bestFitMapping) { } /// /// Gets or sets a value indicating whether ThrowOnUnmappableChar. /// public bool ThrowOnUnmappableChar { get; set; } /// /// Prints out the object's contents. /// /// A string represenetation or the object. public override string ToString() { return base.ToString(); } } /// /// A fake attribute to allow compilation on platforms that lack this attribute. /// [ComVisibleAttribute(true)] [AttributeUsageAttribute(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = true, Inherited = false)] [SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "Reviewed. Suppression is OK here because it's a collection of trivial classes.")] [SuppressMessage( "Microsoft.StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "These stub classes are compiled only on some platforms that do not contain the entire framework, e.g. new Windows user interface.")] internal sealed class SuppressUnmanagedCodeSecurityAttribute : Attribute { /// /// Prints out the object's contents. /// /// A string represenetation or the object. public override string ToString() { return base.ToString(); } } /// /// A fake attribute to allow compilation on platforms that lack this attribute. /// [AttributeUsageAttribute(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Delegate, Inherited = false)] [ComVisibleAttribute(true)] [SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "Reviewed. Suppression is OK here because it's a collection of trivial classes.")] [SuppressMessage( "Microsoft.StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "These stub classes are compiled only on some platforms that do not contain the entire framework, e.g. new Windows user interface.")] internal sealed class ComVisibleAttribute : Attribute { /// /// Initializes a new instance of the class. /// /// /// The com visible. /// public ComVisibleAttribute(bool comVisible) { } /// /// Prints out the object's contents. /// /// A string represenetation or the object. public override string ToString() { return base.ToString(); } } /// /// Indicates that a class can be serialized. This class cannot be inherited. /// /// 1 [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Delegate, Inherited = false), ComVisible(true)] [SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "Reviewed. Suppression is OK here because it's a collection of trivial classes.")] [SuppressMessage( "Microsoft.StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "These stub classes are compiled only on some platforms that do not contain the entire framework, e.g. new Windows user interface.")] internal sealed class SerializableAttribute : Attribute { /// /// Prints out the object's contents. /// /// A string represenetation or the object. public override string ToString() { return base.ToString(); } } /// /// Indicates that a field of a serializable class should not be serialized. This class cannot be inherited. /// /// 1 [ComVisible(true), AttributeUsage(AttributeTargets.Field, Inherited = false)] [SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "Reviewed. Suppression is OK here because it's a collection of trivial classes.")] [SuppressMessage( "Microsoft.StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleClass", Justification = "These stub classes are compiled only on some platforms that do not contain the entire framework, e.g. new Windows user interface.")] internal sealed class NonSerializedAttribute : Attribute { /// /// Prints out the object's contents. /// /// A string represenetation or the object. public override string ToString() { return base.ToString(); } } } namespace System.Runtime.ConstrainedExecution { } namespace System.Security.Cryptography { } namespace System.Security.Permissions { } namespace Microsoft.Win32.SafeHandles { } namespace System.Runtime.ConstrainedExecution { using System; using Microsoft.Isam.Esent.Interop; /// /// The consistency model. A stub. /// internal enum Consistency { /// /// Might corrupt the process. /// MayCorruptProcess, /// /// Might corrupt the application domain. /// MayCorruptAppDomain, /// /// Might corrupt the instance. /// MayCorruptInstance, /// /// Will not corrupt the state. /// WillNotCorruptState, } /// /// The Crticial Execution Region description. A stub. /// internal enum Cer { /// /// No options. /// None, /// /// This might fail. /// MayFail, /// /// A successful CER. /// Success, } /// /// The description of the reliability contract. A stub. /// internal sealed class ReliabilityContractAttribute : Attribute { /// /// The consistency guarantee. A stub. /// private Consistency consistency; /// /// The critical execution region. A stub. /// private Cer cer; /// /// Initializes a new instance of the ReliabilityContractAttribute class. A stub. /// /// The guarantee of the consistency. /// The critical execution region description. public ReliabilityContractAttribute(Consistency consistencyGuarantee, Cer cer) { this.consistency = consistencyGuarantee; this.cer = cer; } /// /// Gets the consistency guarantee. A stub. /// public Consistency ConsistencyGuarantee { get { return this.consistency; } } /// /// Gets the critical execution region. A stub. /// public Cer Cer { get { return this.cer; } } } }