private void Hero_Moved(Entity hero, ValueChangeEventArgs <Vec> args) { if (mViewing == Viewing.Ground) { Repaint(); } }
/// <summary> /// Called when an <see cref="Actor"/>'s position has changed so the stage can track it. /// </summary> private void MoveActor(object sender, ValueChangeEventArgs <Vec2> valueChangeEventArgs) { Actor actor = ActorsByTile[valueChangeEventArgs.Old]; ActorsByTile[valueChangeEventArgs.Old] = null; ActorsByTile[valueChangeEventArgs.New] = actor; }
private void label3_ValueChange(object sender, ValueChangeEventArgs e) { if (float.TryParse(this.textBox3.Text, out float val)) { this.textBox3.Text = (val + (float)e.ChangedValue / 100).ToString(); } }
/// <summary> /// Fired before the value of the cell is changed. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void OnValueChanging(CellContext sender, ValueChangeEventArgs e) { if (ValueChanging != null) { ValueChanging(sender, e); } }
private void NumberPicker_ValueChanged(object sender, ValueChangeEventArgs e) { Element.Value = e.NewVal; var numberPicker = sender as NumberPicker; SetTextColor(numberPicker); }
protected virtual void OnValueChange(ValueChangeEventArgs e) { if (ValueChange != null) { ValueChange(this, e); } }
/// <summary> /// Fired before the value of the cell is changed. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void OnValueChanging(CellContext sender, ValueChangeEventArgs e) { foreach (IController controller in m_ControllerList) { controller.OnValueChanging(sender, e); } }
private void label6_ValueChange(object sender, ValueChangeEventArgs e) { if (textBox6.Enabled) { textBox6.Text = (int.Parse(textBox6.Text) + e.ChangedValue).ToString(); } }
void onSpinnerValueChange(object sender, ValueChangeEventArgs e) { if (e.MemberName != "Value") { return; } intValue = Convert.ToInt32(e.NewValue); }
public override void OnValueChanging(CellContext sender, ValueChangeEventArgs e) { base.OnValueChanging(sender, e); if (sender.Cell != null && sender.Cell.Controller != null) { sender.Cell.Controller.OnValueChanging(sender, e); } }
protected void OnMoved(ValueChangeEventArgs <Vec> args) { Moved.Raise(this, args); if (mCollection != null) { mCollection.EntityMoved.Raise(this, args); } }
/// <summary> /// Change the font of the selected text. /// </summary> /// <param name="cellContext"></param> /// <param name="color"></param> public void SetSelectionColor(CellContext cellContext, Color color) { ValueChangeEventArgs valArgs = new ValueChangeEventArgs(null, color); if (cellContext.Grid != null) cellContext.Grid.Controller.OnValueChanging(cellContext, valArgs); if (cellContext.Grid != null) cellContext.Grid.Controller.OnValueChanged(cellContext, EventArgs.Empty); }
/// <summary> /// Change the font of the selected text. /// </summary> /// <param name="cellContext"></param> /// <param name="font"></param> public void SetSelectionFont(CellContext cellContext, Font font) { ValueChangeEventArgs valArgs = new ValueChangeEventArgs(null, font); if (cellContext.Grid != null) cellContext.Grid.Controller.OnValueChanging(cellContext, valArgs); if (cellContext.Grid != null) cellContext.Grid.Controller.OnValueChanged(cellContext, EventArgs.Empty); }
/// <summary> /// Sets the effect of the selected text. /// </summary> public void SetSelectionEffect(CellContext cellContext, DevAge.Windows.Forms.EffectType effect) { ValueChangeEventArgs valArgs = new ValueChangeEventArgs(null, effect); if (cellContext.Grid != null) cellContext.Grid.Controller.OnValueChanging(cellContext, valArgs); if (cellContext.Grid != null) cellContext.Grid.Controller.OnValueChanged(cellContext, EventArgs.Empty); }
void onGameStateChange(object sender, ValueChangeEventArgs e) { if (e.MemberName != "IsChecked" || (bool)e.NewValue != true) { return; } //force update of position mesh SelectionPos = selPos; }
private void Game_EntityMoved(Entity entity, ValueChangeEventArgs <Vec> e) { // in case the hero moved if (entity is Hero) { CenterOn(Terminal, entity.Position); } RefreshDungeonTile(e.Old, Terminal); RefreshDungeonTile(e.New, Terminal); }
private void Events_LocationChanged(object sender, ValueChangeEventArgs <GameLocation> e) { if (e.OldValue != null) { RemoveLightSource(e.OldValue); } if (e.NewValue != null) { CreateLightSource(e.NewValue); } }
/// <summary> /// /// </summary> /// <param name="cellContext"></param> /// <param name="newValue">new value of this model</param> public void SetValue(CellContext cellContext, object newValue) { if (IsNewValueEqual(newValue) == true) return; ValueChangeEventArgs valArgs = new ValueChangeEventArgs(m_Value, newValue); if (cellContext.Grid != null) cellContext.Grid.Controller.OnValueChanging(cellContext, valArgs); m_Value = valArgs.NewValue; if (cellContext.Grid != null) cellContext.Grid.Controller.OnValueChanged(cellContext, EventArgs.Empty); }
/// <summary> /// Change the font of the selected text. /// </summary> /// <param name="cellContext"></param> /// <param name="color"></param> public void SetSelectionColor(CellContext cellContext, Color color) { ValueChangeEventArgs valArgs = new ValueChangeEventArgs(null, color); if (cellContext.Grid != null) { cellContext.Grid.Controller.OnValueChanging(cellContext, valArgs); } if (cellContext.Grid != null) { cellContext.Grid.Controller.OnValueChanged(cellContext, EventArgs.Empty); } }
/// <summary> /// Set horizontal alignment of selected text. /// </summary> /// <param name="cellContext"></param> /// <param name="horAlignment"></param> public void SetSelectionAlignment(CellContext cellContext, HorizontalAlignment horAlignment) { ValueChangeEventArgs valArgs = new ValueChangeEventArgs(null, horAlignment); if (cellContext.Grid != null) { cellContext.Grid.Controller.OnValueChanging(cellContext, valArgs); } if (cellContext.Grid != null) { cellContext.Grid.Controller.OnValueChanged(cellContext, EventArgs.Empty); } }
/// <summary> /// Change char offset of the selected text. /// </summary> /// <param name="cellContext"></param> /// <param name="charoffset"></param> public void SetSelectionCharOffset(CellContext cellContext, int charoffset) { ValueChangeEventArgs valArgs = new ValueChangeEventArgs(null, charoffset); if (cellContext.Grid != null) { cellContext.Grid.Controller.OnValueChanging(cellContext, valArgs); } if (cellContext.Grid != null) { cellContext.Grid.Controller.OnValueChanged(cellContext, EventArgs.Empty); } }
/// <summary> /// Sets the effect of the selected text. /// </summary> public void SetSelectionEffect(CellContext cellContext, DevAge.Windows.Forms.EffectType effect) { ValueChangeEventArgs valArgs = new ValueChangeEventArgs(null, effect); if (cellContext.Grid != null) { cellContext.Grid.Controller.OnValueChanging(cellContext, valArgs); } if (cellContext.Grid != null) { cellContext.Grid.Controller.OnValueChanged(cellContext, EventArgs.Empty); } }
void CrowEdit_ValueChanged(object sender, ValueChangeEventArgs e) { if (e.MemberName == "IsDirty" && isDirty != (bool)e.NewValue) { isDirty = (bool)e.NewValue; if (isDirty) { CMDSave.CanExecute = true; CMDSaveAs.CanExecute = true; } else { CMDSave.CanExecute = false; CMDSaveAs.CanExecute = false; } } }
/// <summary> /// If ValueEventArgs is a font, use it to change SelectionFont /// If String, assign it as rtf /// If Int32, assign it as offset /// If HorizontalAlignment, assign as SelectionAlignment /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public override void OnValueChanging(CellContext sender, ValueChangeEventArgs e) { base.OnValueChanging(sender, e); // only check if event args is of known type if event is not of type rich text if (!(e.NewValue is DevAge.Windows.Forms.RichText)) { Editors.RichTextBox richEditor = (Editors.RichTextBox)sender.Cell.Editor; DevAge.Windows.Forms.DevAgeRichTextBox richTextBox = richEditor.Control; // if editor is not open, assign value and select all text if (sender.Cell.Editor.EditCell == null) { richTextBox.Value = sender.Value as DevAge.Windows.Forms.RichText; richTextBox.SelectAll(); } if (e.NewValue is Font) { richTextBox.SelectionFont = (Font)e.NewValue; } else if (e.NewValue is Color) { richTextBox.SelectionColor = (Color)e.NewValue; } else if (e.NewValue is Int32) { richTextBox.SelectionCharOffset = (int)e.NewValue; } else if (e.NewValue is HorizontalAlignment) { richTextBox.SelectionAlignment = (HorizontalAlignment)e.NewValue; } else if (e.NewValue is DevAge.Windows.Forms.EffectType) { richTextBox.SelectionEffect = (DevAge.Windows.Forms.EffectType)e.NewValue; } // if editor is not open, use changed value for cell if (sender.Cell.Editor.EditCell == null) { sender.Value = richTextBox.Value; } } }
/// <summary> /// /// </summary> /// <param name="cellContext"></param> /// <param name="newValue">new value of this model</param> public void SetValue(CellContext cellContext, object newValue) { if (IsNewValueEqual(newValue) == true) { return; } ValueChangeEventArgs valArgs = new ValueChangeEventArgs(m_Value, newValue); if (cellContext.Grid != null) { cellContext.Grid.Controller.OnValueChanging(cellContext, valArgs); } m_Value = valArgs.NewValue; if (cellContext.Grid != null) { cellContext.Grid.Controller.OnValueChanged(cellContext, EventArgs.Empty); } }
public void ValueChange(object sender, ValueChangeEventArgs e) { if (this.InvokeRequired)//如果调用控件的线程和创建创建控件的线程不是同一个则为True { while (!this.IsHandleCreated) { //解决窗体关闭时出现“访问已释放句柄“的异常 if (this.Disposing || this.IsDisposed) { return; } } this.Invoke(new Action(() => { this.Text = e.Value.Single.ToString(); })); } else { this.Text = e.Value.Single.ToString(); } }
private void label1_ValueChange(object sender, ValueChangeEventArgs e) { textBox1.Text = (int.Parse(textBox1.Text) + e.ChangedValue).ToString(); }
private void Events_LocationChanged(object sender, ValueChangeEventArgs <GameLocation> e) { RevalidateConditions(SourceItem, EffectChangeReason.Reset); }
public void OnMoved(object sender, ValueChangeEventArgs <Vec2> eventArgs) { Vector3 worldPosition = new Vector3(eventArgs.New.x, 0, eventArgs.New.y); gameObject.transform.position = worldPosition; }
/// <summary> /// 滚动时,currentitem值变化 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void WheelPicker_ValueChange(object sender, ValueChangeEventArgs e) { Element.CurrentItem = e.NewVal; }
/// <summary> /// Change char offset of the selected text. /// </summary> /// <param name="cellContext"></param> /// <param name="charoffset"></param> public void SetSelectionCharOffset(CellContext cellContext, int charoffset) { ValueChangeEventArgs valArgs = new ValueChangeEventArgs(null, charoffset); if (cellContext.Grid != null) cellContext.Grid.Controller.OnValueChanging(cellContext, valArgs); if (cellContext.Grid != null) cellContext.Grid.Controller.OnValueChanged(cellContext, EventArgs.Empty); }
public override void OnValueChanging(CellContext sender, ValueChangeEventArgs e) { base.OnValueChanging (sender, e); }
/// <summary> /// Set horizontal alignment of selected text. /// </summary> /// <param name="cellContext"></param> /// <param name="horAlignment"></param> public void SetSelectionAlignment(CellContext cellContext, HorizontalAlignment horAlignment) { ValueChangeEventArgs valArgs = new ValueChangeEventArgs(null, horAlignment); if (cellContext.Grid != null) cellContext.Grid.Controller.OnValueChanging(cellContext, valArgs); if (cellContext.Grid != null) cellContext.Grid.Controller.OnValueChanged(cellContext, EventArgs.Empty); }
/// <summary> /// Fired before the value of the cell is changed. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public virtual void OnValueChanging(CellContext sender, ValueChangeEventArgs e) { }
private void NumberPicker_ValueChanged(object sender, ValueChangeEventArgs e) { Element.Value = e.NewVal; }
public override void OnValueChanging(CellContext sender, ValueChangeEventArgs e) { base.OnValueChanging(sender, e); }
void onGameStateChange (object sender, ValueChangeEventArgs e) { if (e.MemberName != "IsChecked" || (bool)e.NewValue != true) return; //force update of position mesh SelectionPos = selPos; }
public override void OnValueChanging(CellContext sender, ValueChangeEventArgs e) { base.OnValueChanging(sender, e); if (sender.Cell != null && sender.Cell.Controller != null) sender.Cell.Controller.OnValueChanging(sender, e); }
private void Events_LocationChanged(object sender, ValueChangeEventArgs <GameLocation> e) { // as locations can have different season, revalidate conditions RevalidateConditions(null, EffectChangeReason.Reset); }
/// <summary> /// Fired before the value of the cell is changed. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void OnValueChanging(CellContext sender, ValueChangeEventArgs e) { if (ValueChanging!=null) ValueChanging(sender, e); }