public CustomFormulaControl(MetroBillCommands commands, int userId, bool isSnapShot, IEnumerable<SimpleFormulaModel> formulas,IEnumerable<string> checkedColumns) { InitializeComponent(); Commands = commands; _userId = userId; _isSnapShot = isSnapShot; _formulas = new List<SimpleFormulaModel>(); foreach (var simpleFormulaModel in formulas) { var nModel = new SimpleFormulaModel { Name = simpleFormulaModel.Name, Elements = simpleFormulaModel.Elements.ToList(), Formula = simpleFormulaModel.Formula, FormulaId = simpleFormulaModel.FormulaId, FormulaType = simpleFormulaModel.FormulaType, IsSnapShot = simpleFormulaModel.IsSnapShot, UsedColumns = simpleFormulaModel.UsedColumns.ToList(), UserId = simpleFormulaModel.UserId }; AddFormula(nModel); } ui_comboBoxEx_useColumn.Items.Clear(); foreach (var checkedColumn in checkedColumns) { ui_comboBoxEx_useColumn.Items.Add(checkedColumn); } }
public ScheduleJobControl(MetroBillCommands commands) { InitializeComponent(); Commands = commands; var schedulas = ProfilesManager.CurrentProfile.GetSheduleTimes(); foreach (var item in schedulas) { AddSchedule(item); } }
/// <summary> /// Called when Commands property has changed. /// </summary> /// <param name="oldValue">Old property value</param> /// <param name="newValue">New property value</param> protected virtual void OnCommandsChanged(MetroBillCommands oldValue, MetroBillCommands newValue) { if (newValue != null) { ui_buttonX_save.Command = newValue.ScheduleJobControlCommands.Save; ui_buttonX_cancel.Command = newValue.ScheduleJobControlCommands.Cancel; } else { ui_buttonX_save.Command = null; ui_buttonX_cancel.Command = null; } }
/// <summary> /// Called when Commands property has changed. /// </summary> /// <param name="oldValue">Old property value</param> /// <param name="newValue">New property value</param> protected virtual void OnCommandsChanged(MetroBillCommands oldValue, MetroBillCommands newValue) { if (newValue != null) { ui_buttonX_logon.Command = newValue.StartControlCommands.Logon; ui_buttonX_exit.Command = newValue.StartControlCommands.Exit; } else { ui_buttonX_logon.Command = null; ui_buttonX_exit.Command = null; } }
public FormMain() { SuspendLayout(); InitializeComponent(); _commands = new MetroBillCommands(); _commands.StartControlCommands.Logon.Executed += StartControl_LogonClick; _commands.StartControlCommands.Exit.Executed += StartControl_ExitClick; _commands.CustomFormulaControlCommands.Save.Executed += CustomFormulaControl_SaveClisk; _commands.CustomFormulaControlCommands.Cancel.Executed += CustomFormulaControl_CancelClisk; _commands.ScheduleJobControlCommands.Save.Executed += ScheduleJobControl_SaveClisk; _commands.ScheduleJobControlCommands.Cancel.Executed += ScheduleJobControl_CancelClisk; _startControl = new StartControl(_commands); //_addUserControl = new AddUserControl {Commands = _commands, Tag = 0}; Controls.Add(_startControl); _startControl.BringToFront(); _startControl.SlideSide = DevComponents.DotNetBar.Controls.eSlideSide.Right; ResumeLayout(false); }
/// <summary> /// Called when Commands property has changed. /// </summary> /// <param name="oldValue">Old property value</param> /// <param name="newValue">New property value</param> protected virtual void OnCommandsChanged(MetroBillCommands oldValue, MetroBillCommands newValue) { if (newValue != null) { //ui_buttonX_save.Command = newValue.CustomFormulaControlCommands.Save; ui_buttonX_cancel.Command = newValue.CustomFormulaControlCommands.Cancel; } else { // ui_buttonX_save.Command = null; ui_buttonX_cancel.Command = null; } }
public StartControl(MetroBillCommands commands) { InitializeComponent(); Commands = commands; }