public void Constructor_Scope_Bad()
        {
            SecurityCriticalScope     scs = (SecurityCriticalScope)UInt32.MinValue;
            SecurityCriticalAttribute sca = new SecurityCriticalAttribute(scs);

            Assert.AreEqual(SecurityCriticalScope.Explicit, sca.Scope);
        }
 /// <summary>Initializes a new instance of the <see cref="T:System.Security.SecurityCriticalAttribute" /> class with the specified scope. </summary>
 /// <param name="scope">One of the <see cref="T:System.Security.SecurityCriticalScope" /> values that specifies the scope of the attribute. </param>
 public SecurityCriticalAttribute(SecurityCriticalScope scope)
 {
     if (scope != SecurityCriticalScope.Everything)
     {
         this._scope = SecurityCriticalScope.Explicit;
     }
     else
     {
         this._scope = SecurityCriticalScope.Everything;
     }
 }
Example #3
0
        public SecurityCriticalAttribute(SecurityCriticalScope scope)
            : base()
        {
            switch (scope)
            {
            case SecurityCriticalScope.Everything:
                _scope = SecurityCriticalScope.Everything;
                break;

            default:
                // that includes all bad enums values
                _scope = SecurityCriticalScope.Explicit;
                break;
            }
        }
Example #4
0
 public SecurityCriticalAttribute(SecurityCriticalScope scope) => this._val = scope;
Example #5
0
 public SecurityCriticalAttribute()
     : base()
 {
     _scope = SecurityCriticalScope.Explicit;
 }
 public SecurityCriticalAttribute(SecurityCriticalScope scope)
 {
 }
 public SecurityCriticalAttribute(SecurityCriticalScope scope)
 {
 }
Example #8
0
 /// <summary>Initializes a new instance of the <see cref="T:System.Security.SecurityCriticalAttribute" /> class with the specified scope. </summary><param name="scope">One of the enumeration values that specifies the scope of the attribute. </param>
 public SecurityCriticalAttribute(SecurityCriticalScope scope)
 {
     throw new NotImplementedException();
 }
 /// <summary>Initializes a new instance of the <see cref="T:System.Security.SecurityCriticalAttribute" /> class with default scope. </summary>
 public SecurityCriticalAttribute()
 {
     this._scope = SecurityCriticalScope.Explicit;
 }
 public SecurityCriticalAttribute(SecurityCriticalScope scope)
 {
     this._val = scope;
 }
Example #11
0
 public SecurityCriticalAttribute(SecurityCriticalScope scope)
 {
     this.scope = scope;
 }