Ejemplo n.º 1
0
 void InitializeFrom(DeclSecurityOptions options)
 {
     SecurityActionEnumList.SelectedItem = (SecAc)options.Action;
     CustomAttributesVM.InitializeFrom(options.CustomAttributes);
     SecurityAttributesVM.Collection.Clear();
     SecurityAttributesVM.Collection.AddRange(options.SecurityAttributes.Select(a => new SecurityAttributeVM(a, ownerModule, decompilerManager, ownerType, ownerMethod)));
     V1XMLString = options.V1XMLString;
     DeclSecVerEnumList.SelectedItem = options.V1XMLString == null ? DeclSecVer.V2 : DeclSecVer.V1;
 }
Ejemplo n.º 2
0
 DeclSecurityOptions CopyTo(DeclSecurityOptions options)
 {
     options.Action = (SecurityAction)(SecAc)SecurityActionEnumList.SelectedItem;
     options.CustomAttributes.Clear();
     options.CustomAttributes.AddRange(CustomAttributesVM.Collection.Select(a => a.CreateCustomAttributeOptions().Create()));
     options.SecurityAttributes.Clear();
     options.SecurityAttributes.AddRange(SecurityAttributesVM.Collection.Select(a => a.CreateSecurityAttribute()));
     options.V1XMLString = IsV1 ? V1XMLString : null;
     return(options);
 }
Ejemplo n.º 3
0
		public DeclSecurityVM(DeclSecurityOptions options, ModuleDef ownerModule, IDecompilerService decompilerService, TypeDef ownerType, MethodDef ownerMethod) {
			this.ownerModule = ownerModule;
			this.decompilerService = decompilerService;
			this.ownerType = ownerType;
			this.ownerMethod = ownerMethod;
			origOptions = options;
			CustomAttributesVM = new CustomAttributesVM(ownerModule, decompilerService);
			CustomAttributesVM.PropertyChanged += CustomAttributesVM_PropertyChanged;
			DeclSecVerEnumList = new EnumListVM(declSecVerList, (a, b) => OnDeclSecVerChanged());
			SecurityActionEnumList = new EnumListVM(secActList, (a, b) => OnSecurityActionChanged());
			SecurityAttributesVM = new SecurityAttributesVM(ownerModule, decompilerService, ownerType, ownerMethod);
			SecurityAttributesVM.Collection.CollectionChanged += SecurityAttributesVM_CollectionChanged;
			Reinitialize();
		}
Ejemplo n.º 4
0
 public DeclSecurityVM(DeclSecurityOptions options, ModuleDef ownerModule, IDecompilerManager decompilerManager, TypeDef ownerType, MethodDef ownerMethod)
 {
     this.ownerModule                    = ownerModule;
     this.decompilerManager              = decompilerManager;
     this.ownerType                      = ownerType;
     this.ownerMethod                    = ownerMethod;
     this.origOptions                    = options;
     this.CustomAttributesVM             = new CustomAttributesVM(ownerModule, decompilerManager);
     CustomAttributesVM.PropertyChanged += CustomAttributesVM_PropertyChanged;
     this.DeclSecVerEnumList             = new EnumListVM(declSecVerList, (a, b) => OnDeclSecVerChanged());
     this.SecurityActionEnumList         = new EnumListVM(secActList, (a, b) => OnSecurityActionChanged());
     this.SecurityAttributesVM           = new SecurityAttributesVM(ownerModule, decompilerManager, ownerType, ownerMethod);
     this.SecurityAttributesVM.Collection.CollectionChanged += SecurityAttributesVM_CollectionChanged;
     Reinitialize();
 }
Ejemplo n.º 5
0
 public DeclSecurityVM(DeclSecurityOptions options, ModuleDef ownerModule, Language language, TypeDef ownerType, MethodDef ownerMethod)
 {
     this.ownerModule                    = ownerModule;
     this.language                       = language;
     this.ownerType                      = ownerType;
     this.ownerMethod                    = ownerMethod;
     this.origOptions                    = options;
     this.customAttributesVM             = new CustomAttributesVM(ownerModule, language);
     CustomAttributesVM.PropertyChanged += CustomAttributesVM_PropertyChanged;
     this.declSecVerEnumListVM           = new EnumListVM(declSecVerList, (a, b) => OnDeclSecVerChanged());
     this.securityActionEnumListVM       = new EnumListVM(secActList, (a, b) => OnSecurityActionChanged());
     this.securityAttributesVM           = new SecurityAttributesVM(ownerModule, language, ownerType, ownerMethod);
     this.SecurityAttributesVM.Collection.CollectionChanged += SecurityAttributesVM_CollectionChanged;
     Reinitialize();
 }
Ejemplo n.º 6
0
		DeclSecurityOptions CopyTo(DeclSecurityOptions options) {
			options.Action = (SecurityAction)(SecAc)SecurityActionEnumList.SelectedItem;
			options.CustomAttributes.Clear();
			options.CustomAttributes.AddRange(CustomAttributesVM.Collection.Select(a => a.CreateCustomAttributeOptions().Create()));
			options.SecurityAttributes.Clear();
			options.SecurityAttributes.AddRange(SecurityAttributesVM.Collection.Select(a => a.CreateSecurityAttribute()));
			options.V1XMLString = IsV1 ? V1XMLString : null;
			return options;
		}
Ejemplo n.º 7
0
		void InitializeFrom(DeclSecurityOptions options) {
			SecurityActionEnumList.SelectedItem = (SecAc)options.Action;
			CustomAttributesVM.InitializeFrom(options.CustomAttributes);
			SecurityAttributesVM.Collection.Clear();
			SecurityAttributesVM.Collection.AddRange(options.SecurityAttributes.Select(a => new SecurityAttributeVM(a, ownerModule, language, ownerType, ownerMethod)));
			V1XMLString = options.V1XMLString;
			DeclSecVerEnumList.SelectedItem = options.V1XMLString == null ? DeclSecVer.V2 : DeclSecVer.V1;
		}
Ejemplo n.º 8
0
		public DeclSecurityVM(DeclSecurityOptions options, ModuleDef ownerModule, Language language, TypeDef ownerType, MethodDef ownerMethod) {
			this.ownerModule = ownerModule;
			this.language = language;
			this.ownerType = ownerType;
			this.ownerMethod = ownerMethod;
			this.origOptions = options;
			this.customAttributesVM = new CustomAttributesVM(ownerModule, language);
			CustomAttributesVM.PropertyChanged += CustomAttributesVM_PropertyChanged;
			this.declSecVerEnumListVM = new EnumListVM(declSecVerList, (a, b) => OnDeclSecVerChanged());
			this.securityActionEnumListVM = new EnumListVM(secActList, (a, b) => OnSecurityActionChanged());
			this.securityAttributesVM = new SecurityAttributesVM(ownerModule, language, ownerType, ownerMethod);
			this.SecurityAttributesVM.Collection.CollectionChanged += SecurityAttributesVM_CollectionChanged;
			Reinitialize();
		}