private void Add(CANamedArgument arg) { if (arg == null) { return; } Add(arg.Type); Add(arg.Argument); }
/// <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)); }
private void Load(CANamedArgument obj) { if (obj == null) { return; } Add(obj.Type); Add(obj.Name); Load(obj.Argument); }
private void Add(CANamedArgument obj) { AddToStack(obj); }