public MainMenuVector(XCommand cmd) : this() { this.cmd = cmd; this.MainMenu_Color.Click += new EventHandler(cmd.aColor.Action); this.MainMenu_PenWidth.Click += new EventHandler(cmd.aWidth.Action); this.MainMenu_ShapeType.Click += new EventHandler(cmd.aType.Action); }
public PersonCardView(Person person, XCommand xCommand) { _person = person; _xCommand = xCommand; Label fn = new Label(); fn.Parent = this; fn.Text = person.Fn; fn.Location = new Point(20, 20); fn.Size = new Size(100, 20); Label ln = new Label(); ln.Parent = this; ln.Text = person.Ln; ln.Location = new Point(130, 20); ln.Size = new Size(100, 20); Button buttonEdit = new Button(); buttonEdit.Parent = this; buttonEdit.Text = "Edit"; buttonEdit.Location = new Point(250, 5); buttonEdit.Click += ButtonEdit_Click; Button buttonDelete = new Button(); buttonDelete.Parent = this; buttonDelete.Text = "Remove"; buttonDelete.Location = new Point(250, 25); buttonDelete.Click += ButtonDelete_Click; }
public Form1() { if (!String.IsNullOrEmpty(Properties.Settings.Default.Language)) { System.Threading.Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.GetCultureInfo(Properties.Settings.Default.Language); System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.GetCultureInfo(Properties.Settings.Default.Language); } InitializeComponent(); PluginsManager = new PluginsManager(); xcom = new XCommand(); pMenu1.xcom = xcom; (xcom.ActionAddTab as ActionAddTab).OnCreateTab += pMenu1.ActionAddTab_onCreateTab; pStatusBar1.xcom = xcom; pToolBar1.xcom = xcom; pLeftToolBox1.xcom = xcom; pRightToolBox1.xcom = xcom; pLeftToolBox1.PropertyEditor = pRightToolBox1; pTabControl1.xcom = xcom; xcom.PTabControl = pTabControl1; Load += Form1_Load; }
public SignUpPageViewModel(IAccountService accountService, Func <int, ConfirmationCodeEntryViewModel> createConfirmationCodeEntryViewModel, IDataFlow dataFlow, IViewService viewService, Func <IPhoneService> phoneService, IDeviceInfo deviceInfo, IConnectivity connectivity, IAppInfo appInfo) { this.accountService = accountService; this.createConfirmationCodeEntryViewModel = createConfirmationCodeEntryViewModel; this.dataFlow = dataFlow; this.viewService = viewService; this.phoneService = phoneService; this.deviceInfo = deviceInfo; this.connectivity = connectivity; this.appInfo = appInfo; SignUpCommand = new XCommand(async() => await SignUp(), CanSignUp); BusinessName = new Property <string>("Buiness Name").RequiredString("Business Name is required"); FirstName = new Property <string>("First Name").RequiredString("First Name is required"); LastName = new Property <string>("Last Name").RequiredString("Last Name is required"); Country = new Property <CountryDetails>("Country").Required("Choose a country"); MobileNumber = new Property <string>("Mobile Number").RequiredString("Mobile Number is required").RequiredFormat(@"^(\d|\s|-)*$", "Please just enter digits"); EmailAddress = new Property <string>("Email Address").RequiredString("Email address is required"); SignUpCommand.SetDependency(this, FirstName, LastName, MobileNumber, EmailAddress); AllCountries = CountriesData.List.OrderBy(c => c.CountryName).ToArray(); var countryCode = GetCountryCode(); var country = AllCountries.SingleOrDefault(c => c.DialingCode == countryCode) ?? AllCountries.SingleOrDefault(c => c.CountryCode == "AU"); Country.InitializeValue(country); }
public void SetXCommand(XCommand com) { this.saveToolStripMenuItem.Click += com.ActIO.Action; this.colorToolStripMenuItem.Click += com.ActColor.Action; this.widthToolStripMenuItem.Click += com.ActWidth.Action; this.typeToolStripMenuItem.Click += com.ActType.Action; }
public void SetXCommand(XCommand com) { this.buttonIO.Click += com.ActIO.Action; this.B_ColorSelector.Click += com.ActColor.Action; this.buttonWidth.Click += com.ActWidth.Action; this.buttonShape.Click += com.ActType.Action; }
public ToolBarVector(XCommand cmd) : this() { this.cmd = cmd; this.ToolBar_Color.Click += new EventHandler(cmd.aColor.Action); this.ToolBar_PenWidth.Click += new EventHandler(cmd.aWidth.Action); this.ToolBar_ShapeType.Click += new EventHandler(cmd.aType.Action); }
public MainWindow() { cmd = new XCommand(); InitializeComponent(); cmd.canvasVector = tabControlVector.canvasVector; tabControlVector.canvasVector.cmd = cmd; tabControlVector.canvasVector.SetCanvasMouseMoveEventHandler(statusBarVector); tabControlVector.cmd = cmd; toolBoxVector.cmd = cmd; toolBarVector.cmd = cmd; mainMenuVector.cmd = cmd; toolBoxVector.statusBar = statusBarVector; toolBarVector.statusBar = statusBarVector; mainMenuVector.statusBar = statusBarVector; toolBoxVector.tabControlVector = tabControlVector; toolBarVector.tabControlVector = tabControlVector; mainMenuVector.tabControlVector = tabControlVector; toolBoxVector.ToolBoxSetUp(); toolBarVector.ToolBarItemSetUp(); mainMenuVector.MenuItemSetUp(); tabControlVector.mainMenu = mainMenuVector; tabControlVector.MenuItemWindowSetUp(); }
public void executeCmd(XRange range, SysEvent e, int id) { if (range != null) { XCommand cmd = range.getCommandByEvent(e, id); executeCmd(cmd); } }
public PinSignInViewModel(IViewService viewService, ISecureStorage secureStorage, IAppData appData, Func <MainViewModel> createMainViewModel) { this.viewService = viewService; this.secureStorage = secureStorage; this.appData = appData; this.createMainViewModel = createMainViewModel; SignInCommand = new XCommand(SignIn); SignInCommand.SetDependency(this); }
public ReceivePaymentViewModel(IPaymentRequestService paymentRequestService) { this.paymentRequestService = paymentRequestService; ReturnCommand = new XCommand(() => { Amount = ""; NewPaymentMode = true; }); }
public IODialog(XCommand cmd, TabControl tabControl = null) { InitializeComponent(); this.cmd = cmd; this.tabControl = tabControl; this.buttonSave.Click += new EventHandler(cmd.aSave.Action); this.buttonLoad.Click += new EventHandler(cmd.aLoad.Action); }
private void SendCommand(XCommand x, ClownfishStatus y) { string sendCommand = string.Format("{0}|{1}", (int)x, (int)y); COPYDATASTRUCT cds = new COPYDATASTRUCT(); cds.dwData = new IntPtr(42); cds.cbData = sendCommand.Length; cds.lpData = sendCommand; UnsafeMethods.SendMessage(new IntPtr(_clownfishWnd), WM_COPYDATA, IntPtr.Zero, ref cds); }
public FeedbackViewModel(ISecureStorage secureStorage, IUserServices userServices) { this.secureStorage = secureStorage; this.userServices = userServices; Feedback = new Property <string>("Message").Required(""); FeedbackType = new Property <string>("Type"); SubmitCommand = new XCommand(Submit, CanSubmit); SubmitCommand.SetDependency(this, Feedback); FeedbackTypes = new List <string>(new[] { "Thanks", "Complain", "Suggestion", "Other" }); }
public void Initialize(Asset asset, UserAsset userAsset) { this.asset = asset; this.userAsset = userAsset; this.rate = appData.Rates.SingleOrDefault(r => r.AssetId == asset.AssetId && r.TargetCurrency == "iBucket"); TransferCommand = new XCommand(Transfer, CanTransfer); Amount = new Property <decimal>().Required("Please enter an amount."); Amount.PropertyChanged += Amount_Changed; }
public SetPinViewModel(IAccountService accountService, IViewService viewService, IDeviceInfo deviceInfo, ISecureStorage secureStorage, Func <MainViewModel> createMainViewModel) { this.accountService = accountService; this.viewService = viewService; this.deviceInfo = deviceInfo; this.secureStorage = secureStorage; this.createMainViewModel = createMainViewModel; Pin1 = new Property <string>("PIN").RequiredString("Please enter a PIN value").RequiredFormat(@"^\d\d\d\d$", "please enter four digits"); Pin2 = new Property <string>("PIN repeat").Check(pin2 => pin2 == Pin1.Value, "The values does not match"); SetPinCommand = new XCommand(async() => await SetPin(), CanSetPin); SetPinCommand.SetDependency(this, Pin1, Pin2); }
private bool CheckPrivilege(XCommand cmd) { String privilege = observers[0].GetUserPrivilege(); foreach (char a in cmd.cfg.CRUDP) { if (privilege.IndexOf(a) < 0) { return(false); } } return(true); }
public ColorSelectViewModel(IColorService colorService, IConfigService configService) { _colorService = colorService; _configService = configService; SaveCommand = new XCommand(_onSave); StartSaveCommand = new XCommand(_onStartSave); SaveSettingsCommand = new XCommand(_saveSettings); CancelSettingsCommand = new XCommand(_cancelSettings); _attractTimer(); this.Register <ResetMessage>(_onReset); this.Register <SettingsMessage>(_onSettings); this.Register <DebugMessage>(_onDebugMessage); }
public void Initialize(Asset asset, UserAsset userAsset) { this.asset = asset; this.userAsset = userAsset; Amount = new Property <decimal>("amount") .Required("Please enter an amount.") .Check(amount => (userAsset.Balance >= amount), "Insufficient funds"); SendAddress = new Property <string>("address").RequiredString("Please specify address."); SendCommand = new XCommand(async() => await Send(), CanSend); CameraCommand = new XCommand(OpenCamera); ScanResultCommand = new XCommand(ProcessScanResult); SendCommand.SetDependency(this, Amount, SendAddress); }
public BucketHomeViewModel(ICardsService cardsService, ISecureStorage secureStorage, IConnectivity connectivity, IAppData appData, ICardData cardData, IBucketData bucketData) { this.cardsService = cardsService; this.connectivity = connectivity; this.appData = appData; this.cardData = cardData; this.bucketData = bucketData; this.secureStorage = secureStorage; Amount = new Property <string>("Amount").RequiredString("Please specify amount").RequiredFormat(@"^\d*(\.\d+)?$", "Please specify a valid number"); SendCommand = new XCommand(async() => await Send(), CanSend); SendCommand.SetDependency(Amount); CardBalance = appData.Cards.Any() ? $"$ {appData.Cards.First().Balance}" : "You do not have any cards. Order a card first."; BucketBalance = appData.BucketAmount; }
/* * public void setDefaultCommand(XCommand cmd)//设置默认命令,即当查找事件存在命令,则不设置,不存在则设置 * { * throw new NotImplementedException(); * } */ public void setCommand(XCommand cmd)//设置命令 { Dictionary <int, XCommand> cmds = getCommandByEvent(cmd.e); if (cmds == null) { cmds = new Dictionary <int, XCommand>(); cmds.Add(cmd.CommandSeq, cmd); commands.Add(cmd.e, cmds); } else { cmds.Add(cmd.CommandSeq, cmd); } }
public PFrame() { IXCommand xCommand = new XCommand(); xCommand.InitializePluginManager(); // var primaryBackColor = SkinController.GetColor("primaryColor"); TabControl tabControl = new TabControl(); tabControl.Dock = DockStyle.Fill; Controls.Add(tabControl); xCommand.TabControl = tabControl; PElements pElements = new PElements(xCommand); pElements.Dock = DockStyle.Left; // pElements.BackColor = primaryBackColor; pElements.Width = 150; Controls.Add(pElements); PToolBox pToolBox = new PToolBox(xCommand); pToolBox.Dock = DockStyle.Right; // pToolBox.BackColor = primaryBackColor; pToolBox.Width = 155; Controls.Add(pToolBox); PToolBar pToolBar = new PToolBar(xCommand); // pToolBar.BackColor = primaryBackColor; pToolBar.Dock = DockStyle.Top; Controls.Add(pToolBar); PMainMenu pMainMenu = new PMainMenu(xCommand); pMainMenu.Dock = DockStyle.Top; // pMainMenu.BackColor = primaryBackColor; pMainMenu.Height = 50; Controls.Add(pMainMenu); PStatusBar pStatusBar = new PStatusBar(xCommand); pStatusBar.Dock = DockStyle.Bottom; // pStatusBar.BackColor = primaryBackColor; Controls.Add(pStatusBar); InitializeComponent(); }
public String executeCmd(XCommand cmd) { this.executeState = "Executing..."; String ans = "OK"; AlertUtil.StartWait(); Notify(); if (cmd != null) { CommandTask task = new CommandTask(cmd, user); ans = task.doTask(); } this.executeState = "OK"; Notify(); AlertUtil.StopWait(); return(ans); }
private void Initialize() { EmailAddress = new Property <string>("Email Address"); PhoneNumber = new Property <string>("Phone Number"); PaymentSuccessfulViaEmail = new Property <bool>(); PaymentSuccessfulViaSMS = new Property <bool>(); PaymentFailedViaEmail = new Property <bool>(); PaymentFailedViaSMS = new Property <bool>(); IncomingTransferViaEmail = new Property <bool>(); IncomingTransferViaSMS = new Property <bool>(); OutgoingTransferViaEmail = new Property <bool>(); OutgoingTransferViaSMS = new Property <bool>(); ManagePINCommand = new XCommand(ManagePin); VerificationCommand = new XCommand(VerificationCode); BackupCommand = new XCommand(Backup); SaveCommand = new XCommand(async() => await Save(), CanSave); }
public void Initialize(INavigationService navigationService, UserAddress[] userAddresses, UserAddress shippingAddress) { this.navigationService = navigationService; EditCommand = new XCommand(async() => await Edit(), CanEdit); ConfirmCommand = new XCommand(async() => await Confirm(), CanConfirm); this.userAddresses = userAddresses; this.shippingAddress = shippingAddress; var addressText = ""; addressText += $"{shippingAddress.FirstName} {shippingAddress.LastName}" + "\r\n"; addressText += $"{shippingAddress.AddressLine1}" + "\r\n"; if (!string.IsNullOrEmpty(shippingAddress.AddressLine2)) { addressText += shippingAddress.AddressLine2 + "\r\n"; } addressText += $"{shippingAddress.City}, {shippingAddress.State} {shippingAddress.Country}" + "\r\n"; addressText += $"{shippingAddress.PostCode}"; Address = addressText; }
public ColorSelectViewModel(IColorService colorService, IConfigService configService, IMQTTService mqttService) { _colorService = colorService; _configService = configService; _mqttService = mqttService; SaveCommand = new XCommand(_onSave); StartSaveCommand = new XCommand(_onStartSave); SaveSettingsCommand = new XCommand(_saveSettings); CancelSettingsCommand = new XCommand(_cancelSettings); AutoplayOffCommand = new XCommand(_onAutoplayOff); AutoplayOnCommand = new XCommand(_onAutoplayOn); // _attractTimer(); this.Register <ResetMessage>(_onReset); this.Register <SettingsMessage>(_onSettings); this.Register <DebugMessage>(_onDebugMessage); this.Register <SpecialColorSelectedMessage>(_onSpecialColorSelected); }
private void Initialize(INavigationService navigationService, UserAddress[] currentAddresses, UserAddress addressToEdit, Func <IView, Task> onConfirmAction, bool newAddress) { Title = "Shipping Address"; FirstName = new Property <string>("First Name").RequiredString("Please enter first name"); LastName = new Property <string>("Last Name").RequiredString("Please enter last name"); AddressLine1 = new Property <string>("Address Line 1").RequiredString("Please enter address"); AddressLine2 = new Property <string>("Address Line 2"); City = new Property <string>("City").RequiredString("Please enter city"); Country = new Property <string>("Country").RequiredString("Please enter country"); PostCode = new Property <string>("Post Code"); State = new Property <string>("State"); ConfirmCommand = new XCommand(async() => await Confirm(), CanConfirm); ConfirmCommand.SetDependency(this, FirstName, LastName, AddressLine1, AddressLine2, City, State, Country, PostCode); this.navigationService = navigationService; this.onConfirmAction = onConfirmAction; this.currentAddresses = currentAddresses; LoadAddressIntoView(addressToEdit); existingAddress = !newAddress; }
public void ContextMenuSetUp(XCommand cmd) { ContextMenu_Color.Click += new EventHandler(cmd.aColor.Action); ContextMenu_PenWidth.Click += new EventHandler(cmd.aWidth.Action); ContextMenu_ShapeType.Click += new EventHandler(cmd.aType.Action); }
public void SetXCommand(XCommand com) { this.buttonSetWidth.Click += com.ActWidth.Action; }
public ActionOpen(XCommand xcom) { this.xcom = xcom; }