private void AddSecurityRulesAttribute()
 {
     if (!MultiTargetingUtil.IsTargetFramework20 && !MultiTargetingUtil.IsTargetFramework35)
     {
         CodeAttributeDeclaration declaration;
         TrustSection             trust = RuntimeConfig.GetAppConfig().Trust;
         Type type     = typeof(SecurityRulesAttribute);
         Type enumType = typeof(SecurityRuleSet);
         if (trust.LegacyCasModel)
         {
             SecurityRuleSet set  = SecurityRuleSet.Level1;
             string          name = Enum.GetName(enumType, set);
             CodeFieldReferenceExpression expression = new CodeFieldReferenceExpression(new CodeTypeReferenceExpression(enumType), name);
             declaration = new CodeAttributeDeclaration(new CodeTypeReference(type), new CodeAttributeArgument[] { new CodeAttributeArgument(expression) });
             this.AddAssemblyAttribute(declaration);
         }
         else
         {
             SecurityRuleSet set2      = SecurityRuleSet.Level2;
             string          fieldName = Enum.GetName(enumType, set2);
             CodeFieldReferenceExpression expression2 = new CodeFieldReferenceExpression(new CodeTypeReferenceExpression(enumType), fieldName);
             declaration = new CodeAttributeDeclaration(new CodeTypeReference(type), new CodeAttributeArgument[] { new CodeAttributeArgument(expression2) });
             this.AddAssemblyAttribute(declaration);
         }
     }
 }
Beispiel #2
0
 public SecurityRulesAttribute(SecurityRuleSet ruleSet)
 {
     _ruleSet = ruleSet;
 }
Beispiel #3
0
 public SecurityRulesAttribute(SecurityRuleSet ruleSet)
 {
 }
Beispiel #4
0
 /// <summary>Initializes a new instance of the <see cref="T:System.Security.SecurityRulesAttribute" /> class using the specified rule set value. </summary>
 /// <param name="ruleSet">One of the enumeration values that specifies the transparency rules set. </param>
 // Token: 0x06001C26 RID: 7206 RVA: 0x00060E0D File Offset: 0x0005F00D
 public SecurityRulesAttribute(SecurityRuleSet ruleSet)
 {
     this.m_ruleSet = ruleSet;
 }
 /// <summary>Initializes a new instance of the <see cref="T:System.Security.SecurityRulesAttribute" /> class using the specified rule set value. </summary><param name="ruleSet">One of the enumeration values that specifies the transparency rules set. </param>
 public SecurityRulesAttribute(SecurityRuleSet ruleSet)
 {
     throw new NotImplementedException();
 }