コード例 #1
0
ファイル: ParamDefVM.cs プロジェクト: formylover/dnSpy-1
 ParamDefOptions CopyTo(ParamDefOptions options)
 {
     options.Name        = Name;
     options.Sequence    = Sequence.Value;
     options.Attributes  = Attributes;
     options.Constant    = HasDefault ? Constant : null;
     options.MarshalType = HasFieldMarshal ? MarshalTypeVM.Type : null;
     options.CustomAttributes.Clear();
     options.CustomAttributes.AddRange(CustomAttributesVM.Collection.Select(a => a.CreateCustomAttributeOptions().Create()));
     return(options);
 }
コード例 #2
0
ファイル: ParamDefVM.cs プロジェクト: formylover/dnSpy-1
        public ParamDefVM(ParamDefOptions options, ModuleDef ownerModule, IDecompilerService decompilerService, TypeDef ownerType, MethodDef ownerMethod)
        {
            this.ownerModule               = ownerModule;
            this.origOptions               = options;
            this.Sequence                  = new UInt16VM(a => { OnPropertyChanged(nameof(FullName)); HasErrorUpdated(); });
            this.CustomAttributesVM        = new CustomAttributesVM(ownerModule, decompilerService);
            this.ConstantVM                = new ConstantVM(ownerModule, options.Constant?.Value, dnSpy_AsmEditor_Resources.Parameter_DefaultValueInfo);
            ConstantVM.PropertyChanged    += constantVM_PropertyChanged;
            this.MarshalTypeVM             = new MarshalTypeVM(ownerModule, decompilerService, ownerType != null ? ownerType : ownerMethod?.DeclaringType, ownerMethod);
            MarshalTypeVM.PropertyChanged += marshalTypeVM_PropertyChanged;

            ConstantVM.IsEnabled    = HasDefault;
            MarshalTypeVM.IsEnabled = HasFieldMarshal;
            Reinitialize();
        }
コード例 #3
0
ファイル: ParamDefVM.cs プロジェクト: softearth/dnSpy
        public ParamDefVM(ParamDefOptions options, ModuleDef ownerModule, Language language, TypeDef ownerType, MethodDef ownerMethod)
        {
            this.ownerModule               = ownerModule;
            this.origOptions               = options;
            this.sequence                  = new UInt16VM(a => { OnPropertyChanged("FullName"); HasErrorUpdated(); });
            this.customAttributesVM        = new CustomAttributesVM(ownerModule, language);
            this.constantVM                = new ConstantVM(ownerModule, options.Constant == null ? null : options.Constant.Value, "Default value for this parameter");
            ConstantVM.PropertyChanged    += constantVM_PropertyChanged;
            this.marshalTypeVM             = new MarshalTypeVM(ownerModule, language, ownerType != null ? ownerType : ownerMethod == null ? null : ownerMethod.DeclaringType, ownerMethod);
            MarshalTypeVM.PropertyChanged += marshalTypeVM_PropertyChanged;

            ConstantVM.IsEnabled    = HasDefault;
            MarshalTypeVM.IsEnabled = HasFieldMarshal;
            Reinitialize();
        }
コード例 #4
0
ファイル: ParamDefVM.cs プロジェクト: 4058665/dnSpy
        public ParamDefVM(ParamDefOptions options, ModuleDef ownerModule, Language language, TypeDef ownerType, MethodDef ownerMethod)
        {
            this.ownerModule = ownerModule;
            this.origOptions = options;
            this.sequence = new UInt16VM(a => { OnPropertyChanged("FullName"); HasErrorUpdated(); });
            this.customAttributesVM = new CustomAttributesVM(ownerModule, language);
            this.constantVM = new ConstantVM(ownerModule, options.Constant == null ? null : options.Constant.Value, "Default value for this parameter");
            ConstantVM.PropertyChanged += constantVM_PropertyChanged;
            this.marshalTypeVM = new MarshalTypeVM(ownerModule, language, ownerType != null ? ownerType : ownerMethod == null ? null : ownerMethod.DeclaringType, ownerMethod);
            MarshalTypeVM.PropertyChanged += marshalTypeVM_PropertyChanged;

            ConstantVM.IsEnabled = HasDefault;
            MarshalTypeVM.IsEnabled = HasFieldMarshal;
            Reinitialize();
        }
コード例 #5
0
ファイル: ParamDefVM.cs プロジェクト: formylover/dnSpy-1
 void InitializeFrom(ParamDefOptions options)
 {
     Name           = options.Name;
     Sequence.Value = options.Sequence;
     Attributes     = options.Attributes;
     if (options.Constant != null)
     {
         HasDefault       = true;
         ConstantVM.Value = options.Constant.Value;
     }
     else
     {
         HasDefault       = false;
         ConstantVM.Value = null;
     }
     MarshalTypeVM.Type = options.MarshalType;
     CustomAttributesVM.InitializeFrom(options.CustomAttributes);
 }
コード例 #6
0
ファイル: ParamDefVM.cs プロジェクト: arkanoid1/dnSpy
		ParamDefOptions CopyTo(ParamDefOptions options) {
			options.Name = Name;
			options.Sequence = Sequence.Value;
			options.Attributes = Attributes;
			options.Constant = HasDefault ? Constant : null;
			options.MarshalType = HasFieldMarshal ? MarshalTypeVM.Type : null;
			options.CustomAttributes.Clear();
			options.CustomAttributes.AddRange(CustomAttributesVM.Collection.Select(a => a.CreateCustomAttributeOptions().Create()));
			return options;
		}
コード例 #7
0
ファイル: ParamDefVM.cs プロジェクト: arkanoid1/dnSpy
		void InitializeFrom(ParamDefOptions options) {
			Name = options.Name;
			Sequence.Value = options.Sequence;
			Attributes = options.Attributes;
			if (options.Constant != null) {
				HasDefault = true;
				ConstantVM.Value = options.Constant.Value;
			}
			else {
				HasDefault = false;
				ConstantVM.Value = null;
			}
			MarshalTypeVM.Type = options.MarshalType;
			CustomAttributesVM.InitializeFrom(options.CustomAttributes);
		}
コード例 #8
0
ファイル: ParamDefVM.cs プロジェクト: manojdjoshi/dnSpy
		public ParamDefVM(ParamDefOptions options, ModuleDef ownerModule, IDecompilerService decompilerService, TypeDef ownerType, MethodDef ownerMethod) {
			this.ownerModule = ownerModule;
			origOptions = options;
			Sequence = new UInt16VM(a => { OnPropertyChanged(nameof(FullName)); HasErrorUpdated(); });
			CustomAttributesVM = new CustomAttributesVM(ownerModule, decompilerService);
			ConstantVM = new ConstantVM(ownerModule, options.Constant?.Value, dnSpy_AsmEditor_Resources.Parameter_DefaultValueInfo);
			ConstantVM.PropertyChanged += constantVM_PropertyChanged;
			MarshalTypeVM = new MarshalTypeVM(ownerModule, decompilerService, ownerType != null ? ownerType : ownerMethod?.DeclaringType, ownerMethod);
			MarshalTypeVM.PropertyChanged += marshalTypeVM_PropertyChanged;

			ConstantVM.IsEnabled = HasDefault;
			MarshalTypeVM.IsEnabled = HasFieldMarshal;
			Reinitialize();
		}