예제 #1
0
        public ConstantVM(ModuleDef ownerModule, object value, string constantCheckBoxToolTip)
        {
            ConstantTypeVM                  = new ConstantTypeVM(ownerModule, value, constantTypes, true, false);
            ConstantCheckBoxToolTip         = constantCheckBoxToolTip;
            ConstantTypeVM.PropertyChanged += ConstantTypeVM_PropertyChanged;

            IsEnabled = ConstantTypeVM.IsEnabled;
        }
예제 #2
0
 public CANamedArgumentVM(ModuleDef ownerModule, CANamedArgument namedArg, TypeSigCreatorOptions options)
 {
     this.ownerModule            = ownerModule;
     this.originalNamedArg       = namedArg.Clone();
     this.constantTypeEnumListVM = new EnumListVM(ConstantTypeVM.CreateEnumArray(validTypes), (a, b) => OnConstantTypeChanged());
     this.namedArgTypeEnumListVM = new EnumListVM(EnumVM.Create(typeof(NamedArgType)), (a, b) => OnNamedArgTypeChanged());
     InitializeFrom(namedArg, options);
     this.modified = false;
 }
예제 #3
0
 public CAArgumentVM(ModuleDef ownerModule, CAArgument arg, TypeSigCreatorOptions options, TypeSig storageType)
 {
     this.module                     = options.OwnerModule;
     this.originalArg                = arg.Clone();
     this.constantTypeVM             = new DnlibDialogs.ConstantTypeVM(ownerModule, null, ConstantTypes, true, true, options);
     ConstantTypeVM.PropertyChanged += ConstantTypeVM_PropertyChanged;
     InitializeFrom(arg, storageType);
     this.modified = false;
 }
예제 #4
0
        public object Create(ModuleDef ownerModule, object value, ConstantType[] validConstants, bool allowNullString, bool arraysCanBeNull, TypeSigCreatorOptions options, out object resultNoSpecialNull, out bool canceled)
        {
            var data = new ConstantTypeVM(ownerModule, value, validConstants ?? DefaultConstants, true, true, options);
            var win  = new ConstantTypeDlg();

            win.DataContext = data;
            win.Owner       = ownerWindow ?? MainWindow.Instance;
            if (win.ShowDialog() != true)
            {
                canceled            = true;
                resultNoSpecialNull = null;
                return(null);
            }

            canceled            = false;
            resultNoSpecialNull = data.ValueNoSpecialNull;
            return(data.Value);
        }