コード例 #1
0
ファイル: DeclSecurityVM.cs プロジェクト: jorik041/dnSpy
 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;
 }
コード例 #2
0
ファイル: DeclSecurityVM.cs プロジェクト: jorik041/dnSpy
 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);
 }
コード例 #3
0
ファイル: DeclSecurityVM.cs プロジェクト: jorik041/dnSpy
 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();
 }
コード例 #4
0
ファイル: DeclSecurityVM.cs プロジェクト: BahNahNah/dnSpy
 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();
 }
コード例 #5
0
ファイル: DeclSecurityVM.cs プロジェクト: BahNahNah/dnSpy
 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;
 }
コード例 #6
0
ファイル: DeclSecurityVM.cs プロジェクト: BahNahNah/dnSpy
 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;
 }