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

            SetTextColor(numberPicker);
        }
Esempio n. 6
0
 protected virtual void OnValueChange(ValueChangeEventArgs e)
 {
     if (ValueChange != null)
     {
         ValueChange(this, e);
     }
 }
Esempio n. 7
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)
 {
     foreach (IController controller in m_ControllerList)
     {
         controller.OnValueChanging(sender, e);
     }
 }
Esempio n. 8
0
 private void label6_ValueChange(object sender, ValueChangeEventArgs e)
 {
     if (textBox6.Enabled)
     {
         textBox6.Text = (int.Parse(textBox6.Text) + e.ChangedValue).ToString();
     }
 }
Esempio n. 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);
            }
        }
Esempio n. 11
0
        protected void OnMoved(ValueChangeEventArgs <Vec> args)
        {
            Moved.Raise(this, args);

            if (mCollection != null)
            {
                mCollection.EntityMoved.Raise(this, args);
            }
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 15
0
        void onGameStateChange(object sender, ValueChangeEventArgs e)
        {
            if (e.MemberName != "IsChecked" || (bool)e.NewValue != true)
            {
                return;
            }

            //force update of position mesh
            SelectionPos = selPos;
        }
Esempio n. 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);
        }
Esempio n. 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);
     }
 }
Esempio n. 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);
		}
Esempio n. 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);
            }
        }
Esempio n. 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);
            }
        }
Esempio n. 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);
            }
        }
Esempio n. 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);
            }
        }
Esempio n. 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;
         }
     }
 }
Esempio n. 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;
                }
            }
        }
Esempio n. 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;
                }
            }
        }
Esempio n. 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);
            }
        }
Esempio n. 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();
     }
 }
Esempio n. 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);
 }
Esempio n. 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;
        }
Esempio n. 31
0
 /// <summary>
 /// 滚动时,currentitem值变化
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void WheelPicker_ValueChange(object sender, ValueChangeEventArgs e)
 {
     Element.CurrentItem = e.NewVal;
 }
Esempio n. 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);
	
		}
Esempio n. 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);
        }
Esempio n. 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;
 }
Esempio n. 37
0
 public override void OnValueChanging(CellContext sender, ValueChangeEventArgs e)
 {
     base.OnValueChanging(sender, e);
 }
Esempio n. 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)
		{
		}
Esempio n. 39
0
		void onGameStateChange (object sender, ValueChangeEventArgs e)
		{
			if (e.MemberName != "IsChecked" || (bool)e.NewValue != true)
				return;
			
			//force update of position mesh
			SelectionPos = selPos;
		}
Esempio n. 40
0
        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);
        }
Esempio n. 41
0
 private void Events_LocationChanged(object sender, ValueChangeEventArgs <GameLocation> e)
 {
     // as locations can have different season, revalidate conditions
     RevalidateConditions(null, EffectChangeReason.Reset);
 }
Esempio n. 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);
		}