/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void onAddBlock(DesignerItem sender) { if (this.EditedObject != null && sender.Tag != null) { JavaScriptSerializer serial = new JavaScriptSerializer(); TransformationTreeItem transformationTreeItem = null; if (sender.Tag is TransformationTreeItem) { transformationTreeItem = (TransformationTreeItem)sender.Tag; } else if (sender.Tag is string) { transformationTreeItem = serial.Deserialize <TransformationTreeItem>((string)sender.Tag); } else { return; } this.EditedObject.AddItem(transformationTreeItem); this.IsModify = true; if (ChangeEventHandler != null) { ChangeEventHandler.change(); } } }
private void Bootstrapper_ProgressChanged(object sender, ChangeEventArgs <int> e) { if (progressBar.InvokeRequired) { var inThread = new ChangeEventHandler <int>(Bootstrapper_ProgressChanged); progressBar.Invoke(inThread, sender, e); } else { int value = e.Value; var context = e.Context; switch (context) { case "Progress": { progressBar.Value = Math.Min(value, progressBar.Maximum); break; } case "MaxProgress": { if (progressBar.Value > value) { progressBar.Value = (value - 1); } progressBar.Maximum = value; break; } } } }
private void DisplayLoopCondition(Kernel.Domain.LoopCondition loopCondition, bool readOnly = false) { trow = false; this.CommentTextBlock.Text = loopCondition.comment; this.OperatorComboBox.SelectedItem = loopCondition.operatorType; this.OpenBracketComboBox.SelectedItem = loopCondition.openBracket; this.CloseBracketComboBox.SelectedItem = loopCondition.closeBracket; this.Index = loopCondition.position + 1; if (readOnly) { SetMainPanelReadOnly(readOnly); } CellProperty cell = loopCondition.cellProperty; if (cell == null) { cell = new CellProperty(); } this.LoopCalutedValue.ChangeEventHandler += onChange; this.LoopCalutedValue.periodPanel.DisplayPeriod(cell.period, false, readOnly); this.LoopCalutedValue.filterScopePanel.DisplayScope(cell.cellScope, false, readOnly); this.LoopCalutedValue.CellMeasurePanel.Display(cell.cellMeasure, readOnly); if (!string.IsNullOrEmpty(loopCondition.conditions)) { this.LoopCalutedValue.DisplayInstructions(loopCondition.instructions, readOnly); } trow = true; }
protected void initHandlers() { this.AddButton.Click += OnAddButtonClick; this.DeleteButton.Click += OnDeleteButtonClick; this.IfInstructionPanel.ChangeEventHandler += onChange; this.ThenInstructionPanel.ChangeEventHandler += onChange; this.ElseInstructionPanel.ChangeEventHandler += onChange; }
public Note(uint id, ChangeEventHandler changeEventHandler) : this() { _isInit = false; DataChanged += changeEventHandler; this.id = id; _isInit = true; }
public Note(NoteData noteData, ChangeEventHandler changeEventHandler) : this() { _isInit = false; DataChanged += changeEventHandler; this.NoteData = noteData; _isInit = true; }
/// <summary> /// Add a callback for when a region name is changed. /// </summary> /// <param name="onChange"></param> /// <returns></returns> public CacheBuster OnChange(ChangeEventHandler onChange) { if (onChange == null) { throw new ArgumentNullException(nameof(onChange)); } this.onChanges.Add(onChange); return(this); }
public FileSystemEventHandler( CreateEventHandler createEventHandler, ChangeEventHandler changeEventHandler, DeleteEventHandler deleteEventHandler, RenameEventHandler renameEventHandler) { _createEventHandler = createEventHandler; _changeEventHandler = changeEventHandler; _deleteEventHandler = deleteEventHandler; _renameEventHandler = renameEventHandler; }
private void Bootstrapper_ProgressBarStyleChanged(object sender, ChangeEventArgs <ProgressBarStyle> e) { if (progressBar.InvokeRequired) { var inThread = new ChangeEventHandler <ProgressBarStyle>(Bootstrapper_ProgressBarStyleChanged); progressBar.Invoke(inThread, sender, e); } else { var style = e.Value; progressBar.Style = style; } }
private void InitializeHandlers() { this.LoopConditionsPanel.Changed += OnChange; this.ActiveCheckbox.Checked += OnActiveChecked; this.ActiveCheckbox.Unchecked += OnActiveChecked; this.OnePossibleChoiceCheckbox.Checked += OnePossibleChoiceChecked; this.OnePossibleChoiceCheckbox.Unchecked += OnePossibleChoiceChecked; this.EditMessageTextBox.TextChanged += OnEditMessageChanged; this.HelpMessageTextBox.TextChanged += OnHelpMessageChanged; }
protected void initHandlers() { this.AddButton.Click += OnAddButtonClick; this.DeleteButton.Click += OnDeleteButtonClick; this.OpenBracketComboBox.SelectionChanged += onChange; this.CloseBracketComboBox.SelectionChanged += onChange; this.OperatorComboBox.SelectionChanged += onChange; this.CommentTextBlock.TextChanged += OnCommentChange; this.CommentPopup.Opened += OnCommentPopupOpened; this.CommentButton.Checked += OnComment; this.NoCommentButton.Checked += OnComment; this.ShowDetailsButton.Click += OnShowDetails; this.HideDetailsButton.Click += OnHideDetails; this.Arg1Label.GotFocus += OnGotFocus; this.AddButton.GotFocus += OnGotFocus; this.DeleteButton.GotFocus += OnGotFocus; this.OpenBracketComboBox.GotFocus += OnGotFocus; this.OperatorComboBox.GotFocus += OnGotFocus; this.CommentTextBlock.GotFocus += OnGotFocus; this.ShowDetailsButton.GotFocus += OnGotFocus; this.Arg1Label.MouseDown += OnMouseDown; this.AddButton.MouseDown += OnMouseDown; this.DeleteButton.MouseDown += OnMouseDown; this.OpenBracketComboBox.MouseDown += OnMouseDown; this.OperatorComboBox.MouseDown += OnMouseDown; this.CommentTextBlock.MouseDown += OnMouseDown; this.ShowDetailsButton.MouseDown += OnMouseDown; this.LoopCalutedValue.Activated += OnActivate; this.LoopCalutedValue.ChangeEventHandler += onChange; this.LoopCalutedValue.filterScopePanel.Changed += onChange; this.LoopCalutedValue.filterScopePanel.ItemChanged += OnFilterScopeChanged; this.LoopCalutedValue.periodPanel.Changed += onChange; this.LoopCalutedValue.periodPanel.ItemChanged += OnPeriodChanged; this.LoopCalutedValue.periodPanel.ItemDeleted += OnPeriodDeleted; this.LoopCalutedValue.filterScopePanel.ItemDeleted += OnFilterScopeDeleted; this.LoopCalutedValue.CellMeasurePanel.Added += OnCellMeasureChanged; this.LoopCalutedValue.CellMeasurePanel.Updated += OnCellMeasureChanged; }
public void Raise() { var exceptions = new List <Exception>(); foreach (Delegate handler in ChangeEventHandler.GetInvocationList()) { try { handler.DynamicInvoke(this, new MyArgs(42)); } catch (Exception ex) { exceptions.Add(ex); } } if (exceptions.Any()) { throw new AggregateException(exceptions); } }
public void OnPropertyChanged(object newValue, object oldValue, [CallerMemberName] string propertyName = "") { ChangeEventHandler ev = PropertyChangedEvent; ev?.Invoke(newValue, oldValue, propertyName); }
// Add an event handler for the changed event. public void AddOnChanged(ChangeEventHandler handler) { Changed += handler; }
// Remove an event handler for the changed event. public void RemoveOnChanged(ChangeEventHandler handler) { Changed -= handler; }
public void Detach(Observer observer) { Change -= new ChangeEventHandler(observer.update); }
// Remove an event handler for the changed event. public void RemoveOnChanged(ChangeEventHandler handler) { Changed -= handler; }
// Add an event handler for the changed event. public void AddOnChanged(ChangeEventHandler handler) { Changed += handler; }
public void Detach(AirTrafficControl airTrafficControl) { Change -= new ChangeEventHandler<AirlineSchedule, ChangeEventArgs> (airTrafficControl.Update); }
public OrderedChangeEventHandler(ChangeEventHandler handler, int order) { Handler = handler; Order = order; }
/// <inheritdoc /> public void UnregisterChangeCallback(ChangeEventHandler handler) { m_Callbacks.RemoveAll(callback => callback.Handler == handler); m_CallbacksChanged = true; }
/// <inheritdoc /> public void RegisterChangeCallback(ChangeEventHandler handler, int order = 0) { m_Callbacks.Add(new OrderedChangeEventHandler(handler, order)); m_CallbacksChanged = true; }