Example #1
0
 private void Hero_Moved(Entity hero, ValueChangeEventArgs <Vec> args)
 {
     if (mViewing == Viewing.Ground)
     {
         Repaint();
     }
 }
Example #2
0
        /// <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;
        }
Example #3
0
 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();
     }
 }
Example #4
0
 /// <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);
     }
 }
Example #5
0
        private void NumberPicker_ValueChanged(object sender, ValueChangeEventArgs e)
        {
            Element.Value = e.NewVal;
            var numberPicker = sender as NumberPicker;

            SetTextColor(numberPicker);
        }
Example #6
0
 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);
     }
 }
Example #8
0
 private void label6_ValueChange(object sender, ValueChangeEventArgs e)
 {
     if (textBox6.Enabled)
     {
         textBox6.Text = (int.Parse(textBox6.Text) + e.ChangedValue).ToString();
     }
 }
Example #9
0
 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);
            }
        }
Example #11
0
        protected void OnMoved(ValueChangeEventArgs <Vec> args)
        {
            Moved.Raise(this, args);

            if (mCollection != null)
            {
                mCollection.EntityMoved.Raise(this, args);
            }
        }
Example #12
0
        /// <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);
        }
Example #13
0
        /// <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);
        }
Example #14
0
        /// <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;
        }
Example #16
0
        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);
        }
Example #17
0
 private void Events_LocationChanged(object sender, ValueChangeEventArgs <GameLocation> e)
 {
     if (e.OldValue != null)
     {
         RemoveLightSource(e.OldValue);
     }
     if (e.NewValue != null)
     {
         CreateLightSource(e.NewValue);
     }
 }
Example #18
0
		/// <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);
		}
Example #19
0
        /// <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);
            }
        }
Example #20
0
        /// <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);
            }
        }
Example #21
0
        /// <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);
            }
        }
Example #22
0
        /// <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);
            }
        }
Example #23
0
 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;
         }
     }
 }
Example #24
0
        /// <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;
                }
            }
        }
Example #25
0
        /// <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;
                }
            }
        }
Example #26
0
        /// <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);
            }
        }
Example #27
0
 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();
     }
 }
Example #28
0
 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);
 }
Example #30
0
        public void OnMoved(object sender, ValueChangeEventArgs <Vec2> eventArgs)
        {
            Vector3 worldPosition = new Vector3(eventArgs.New.x, 0, eventArgs.New.y);

            gameObject.transform.position = worldPosition;
        }
Example #31
0
 /// <summary>
 /// 滚动时,currentitem值变化
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void WheelPicker_ValueChange(object sender, ValueChangeEventArgs e)
 {
     Element.CurrentItem = e.NewVal;
 }
Example #32
0
        /// <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);
	
		}
Example #34
0
        /// <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);
        }
Example #35
0
 /// <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;
 }
Example #37
0
 public override void OnValueChanging(CellContext sender, ValueChangeEventArgs e)
 {
     base.OnValueChanging(sender, e);
 }
Example #38
0
		/// <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)
		{
		}
		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);
 }
Example #42
0
		/// <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);
		}