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; }
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; }
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; }
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); }