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 CANamedArgument CreateCANamedArgument() { if (!modified) { return(originalNamedArg.Clone()); } var type = GetType((ConstantType)ConstantTypeEnumList.SelectedItem); return(new CANamedArgument(IsField, type, Name, CAArgumentVM.CreateCAArgument(type))); }