예제 #1
0
 private void Add(CANamedArgument arg)
 {
     if (arg == null)
     {
         return;
     }
     Add(arg.Type);
     Add(arg.Argument);
 }
예제 #2
0
        /// <summary>
        /// Creates a <see cref="SecurityAttribute"/> from an XML string.
        /// </summary>
        /// <param name="module">Owner module</param>
        /// <param name="xml">XML</param>
        /// <returns>A new <see cref="SecurityAttribute"/> instance</returns>
        public static SecurityAttribute CreateFromXml(ModuleDef module, string xml)
        {
            var attrType = module.CorLibTypes.GetTypeRef("System.Security.Permissions", "PermissionSetAttribute");
            var utf8Xml  = new UTF8String(xml);
            var namedArg = new CANamedArgument(false, module.CorLibTypes.String, "XML", new CAArgument(module.CorLibTypes.String, utf8Xml));
            var list     = ThreadSafeListCreator.Create <CANamedArgument>(namedArg);

            return(new SecurityAttribute(attrType, list));
        }
예제 #3
0
 private void Load(CANamedArgument obj)
 {
     if (obj == null)
     {
         return;
     }
     Add(obj.Type);
     Add(obj.Name);
     Load(obj.Argument);
 }
예제 #4
0
 private void Add(CANamedArgument obj)
 {
     AddToStack(obj);
 }