當前位置: 首頁>>代碼示例>>C#>>正文


C# Controls.EventArgs類代碼示例

本文整理匯總了C#中TomShane.Neoforce.Controls.EventArgs的典型用法代碼示例。如果您正苦於以下問題:C# EventArgs類的具體用法?C# EventArgs怎麽用?C# EventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


EventArgs類屬於TomShane.Neoforce.Controls命名空間,在下文中一共展示了EventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: OnEvent

 public void OnEvent(Control control, DetailedItem item, EventArgs e)
 {
     if (item == null || control == null || item.obj == null) return;
     if (!(item.obj is InspectorInfo)) return;
     InspectorInfo ins = (InspectorInfo)item.obj;
     if (e is KeyEventArgs && control.GetType() == typeof(TextBox))
     {
         KeyEventArgs ke = (KeyEventArgs)e;
         if (ke.Key != Microsoft.Xna.Framework.Input.Keys.Enter) return;
         TextBox textbox = (TextBox)control;
         object san = ins.TrySanitize(textbox.Text);
         if (san != null)
         {
             ins.SetValue(san);
             //Console.WriteLine(ins.parentItem.obj.GetType() + " >> " + ins + " >> " + san.GetType() + " >> " + san);
             if (GroupSync)
             {
                 ins.ApplyToAllNodes(activeGroup);
             }
         }
         marginalize(textbox);
     }
     else if (control is ComboBox)
     {
         ins.SetValue(control.Text);
         if (GroupSync)
         {
             ins.ApplyToAllNodes(activeGroup);
         }
     }
     else if (control is Button)
     {
         if (control.Name.Equals("bool_button_enabled"))
         {
             ins.SetValue(GetButtonBool((Button)control));
             if (GroupSync)
             {
                 ins.ApplyToAllNodes(activeGroup);
             }
         }
         else if (control.Name.Equals("toggle_button_enabled"))
         {
             ins.SetValue(GetButtonBool((Button)control));
             if (GroupSync)
             {
                 ins.ApplyToAllNodes(activeGroup);
             }
         }
         else if (control.Name.Equals("component_button_enabled"))
         {
             Component component = (Component)ins.obj;
             component.active = GetButtonBool((Button)control);
             if (this is ComponentView)
             {
                 ComponentView cv = (ComponentView)this;
                 if (cv.lblCurrentComp.Text.Equals(component.GetType().ToString().LastWord('.')))
                     cv.lblCurrentComp.TextColor = control.TextColor;
             }
             //ins.SetValue(checkbox.Checked);
             if (GroupSync)
             {
                 foreach (Node n in activeGroup.fullSet)
                 {
                     if (n.HasComp(component.GetType()))
                         n.comps[component.GetType()].active = component.active;
                 }
             }
         }
         else if (control.Name.Equals("component_button_remove"))
         {
             if (ins.obj is Component)
             {
                 Component component = (Component)ins.obj;
                 if (this is ComponentView && (this as ComponentView).viewType == ViewType.Link)
                 {
                     ComponentView cv = (ComponentView)this;
                     cv.rootLink.components.Remove(component.GetType());
                 }
                 else
                 {
                     component.parent.RemoveComponent(component.GetType());
                     if (GroupSync)
                     {
                         foreach (Node n in activeGroup.fullSet)
                         {
                             n.RemoveComponent(component.GetType());
                         }
                     }
                 }
             }
             if (this is ComponentView) (this as ComponentView).RefreshComponents();
         }
         else if (control.Name.Equals("method_button_invoke"))
         {
             if (ins.methodInfo != null)
             {
                 ins.methodInfo.Invoke(ins.parentobj, null);
                 if (GroupSync)
                 {
                     ins.ApplyToAllNodes(activeGroup);
//.........這裏部分代碼省略.........
開發者ID:GameMakersUnion,項目名稱:BoulderDash-OrbIt,代碼行數:101,代碼來源:InspectorView.cs

示例2: btnClose_Click

    ////////////////////////////////////////////////////////////////////////////                               

    ////////////////////////////////////////////////////////////////////////////
    void btnClose_Click(object sender, EventArgs e)
    {      
      Close(ModalResult = ModalResult.Cancel);
    }
開發者ID:Kammikazy,項目名稱:Neoforce-Mono,代碼行數:7,代碼來源:Window.cs

示例3: OnMoveEnd

    ////////////////////////////////////////////////////////////////////////////

    ////////////////////////////////////////////////////////////////////////////
    protected override void OnMoveEnd(EventArgs e)
    {
      base.OnMoveEnd(e);
      try
      {
        Alpha = oldAlpha;
      }
      catch
      {
      }
    }
開發者ID:Kammikazy,項目名稱:Neoforce-Mono,代碼行數:14,代碼來源:Window.cs

示例4: lstMain_Click

 void lstMain_Click(object sender, EventArgs e)
 {
     MouseEventArgs me = (MouseEventArgs)e;
     if (me.Button != MouseButton.Right) return;
     ListBox listbox = (ListBox)sender;
     listbox.ContextMenu.Items.ToList().ForEach(o => listbox.ContextMenu.Items.Remove(o));
     //foreach (MenuItem m in listbox.ContextMenu.Items.ToList())
     //{
     //    listbox.ContextMenu.Items.Remove(m);
     //}
     Color c = listbox.ContextMenu.Color;
     listbox.ContextMenu.Color = new Color(0f, 0f, 0f, 0f);
     if (listbox.ItemIndex >= 0 && listbox.Items.ElementAt(listbox.ItemIndex) is Node)
     {
         listbox.ContextMenu.Color = new Color(1f, 1f, 1f, 1.0f);
         listbox.ContextMenu.Items.Add(ConvertIntoList);
         listbox.ContextMenu.Items.Add(PromoteToDefault);
     }
 }
開發者ID:GameMakersUnion,項目名稱:BoulderDash-OrbIt,代碼行數:19,代碼來源:Sidebar.cs

示例5: btn_Click

 void btn_Click(object sender, EventArgs e)
 {
     MouseEventArgs ex = (e is MouseEventArgs) ? (MouseEventArgs)e : new MouseEventArgs();
       txt.Items.Add((sender == btn ? "Button" : "List") + ": Click " + ex.Button.ToString());
       txt.ItemIndex = txt.Items.Count - 1;
 }
開發者ID:Kammikazy,項目名稱:NeoforceControls-SharpDX,代碼行數:6,代碼來源:TaskEvents.cs

示例6: btnSaveNode_Click

 void btnSaveNode_Click(object sender, EventArgs e)
 {
     if (inspectorArea.editNode == null)
         PopUp.Toast("You haven't selected a Node.");
     else
         PopUp.Text("Pick a preset name", "Name preset", delegate(bool c, object input)
         {
                             if (c) Assets.saveNode(inspectorArea.editNode, (string)input);
             return true;
         });
 }
開發者ID:GameMakersUnion,項目名稱:BoulderDash-OrbIt,代碼行數:11,代碼來源:Sidebar.cs

示例7: cbListPicker_ItemIndexChanged

        void cbListPicker_ItemIndexChanged(object sender, EventArgs e)
        {
            ComboBox cmb = (ComboBox)sender;
            if (cmb.ItemIndex < 0) return;
            string item = cmb.Items.ElementAt(cmb.ItemIndex).ToString();
            if (item.Equals("Other Objects"))
            {
                foreach (object o in lstMain.Items.ToList())
                {
                    lstMain.Items.Remove(o);
                }
                lstMain.Items.Add(OrbIt.game);
                lstMain.Items.Add(room);
                lstMain.Items.Add(room.masterGroup);
            }
            else if (!item.Equals(""))
            {
                foreach (object o in lstMain.Items.ToList())
                {
                    lstMain.Items.Remove(o);
                }

                Group find = room.masterGroup.FindGroup(item);
                if (find == null) return;
                lstMain.Items.AddRange(find.fullSet);
                SyncTitleNumber(find);

                SetDefaultNodeAsEdit();

            }
            lstMain.ScrollTo(0);
        }
開發者ID:GameMakersUnion,項目名稱:BoulderDash-OrbIt,代碼行數:32,代碼來源:Sidebar.cs

示例8: OnImageChanged

 /// <summary>
 /// Handles when the control's image is changed.
 /// </summary>
 /// <param name="e"></param>
 protected virtual void OnImageChanged(EventArgs e)
 {
     if (ImageChanged != null) ImageChanged.Invoke(this, e);
 }
開發者ID:Rfvgyhn,項目名稱:Neoforce,代碼行數:8,代碼來源:ImageBox.cs

示例9: InitChoose

        private void InitChoose(object sender, EventArgs e)
        {
            //Cancel Button
            if (sender == m_Buttons[0]) m_Active = false;

            //Go to editor
            if (sender == m_Buttons[1])
            {
                //Prepare parameter
                object[] Parameters;

                //Create parameter
                Parameters = new object[2];
                Parameters[0] = m_ComboBoxs[0].Items[HeightIndex];
                Parameters[1] = m_ComboBoxs[1].Items[WidthIndex];

                //Go to story
                Global.StateManager.GoTo(StateID.Editor, Parameters);

                //Make state inactive
                m_Active = false;
            }
        }
開發者ID:yggy123,項目名稱:closed-sky,代碼行數:23,代碼來源:StateInitEditor.cs

示例10: OnMoveEnd

        /// <summary>
        /// Handler for when the window completes a move event.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnMoveEnd(EventArgs e)
        {
            base.OnMoveEnd(e);

            // Reset to original alpha value.
            try
            {
                Alpha = oldAlpha;
            }
            catch
            {
            }
        }
開發者ID:Rfvgyhn,項目名稱:Neoforce,代碼行數:17,代碼來源:Window.cs

示例11: OnClick

		////////////////////////////////////////////////////////////////////////////     

		////////////////////////////////////////////////////////////////////////////     
		protected override void OnClick(EventArgs e)
		{
			MouseEventArgs ex = (e is MouseEventArgs) ? (MouseEventArgs)e : new MouseEventArgs();

			if (ex.Button == MouseButton.Left || ex.Button == MouseButton.None)
			{
				if (mode == RadioButtonMode.Auto)
				{
					if (Parent != null)
					{
						ControlsList lst = Parent.Controls as ControlsList;
						for (int i = 0; i < lst.Count; i++)
						{
							if (lst[i] is RadioButton)
							{
								(lst[i] as RadioButton).Checked = false;
							}
						}
					}
					else if (Parent == null && Manager != null)
					{
						ControlsList lst = Manager.Controls as ControlsList;

						for (int i = 0; i < lst.Count; i++)
						{
							if (lst[i] is RadioButton)
							{
								(lst[i] as RadioButton).Checked = false;
							}
						}
					}
				}
			}
			base.OnClick(e);
		}
開發者ID:brunoduartec,項目名稱:port-ploobsengine,代碼行數:38,代碼來源:RadioButton.cs

示例12: OnMoveBegin

        /// <summary>
        /// Handler for when the window starts a move event.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnMoveBegin(EventArgs e)
        {
            base.OnMoveBegin(e);

            // Swap the current alpha values.
            try
            {
                oldAlpha = Alpha;
                Alpha = dragAlpha;
            }
            catch
            {
            }
        }
開發者ID:Rfvgyhn,項目名稱:Neoforce,代碼行數:18,代碼來源:Window.cs

示例13: OnCheckedChanged

 ////////////////////////////////////////////////////////////////////////////     
 
 ////////////////////////////////////////////////////////////////////////////     
 protected virtual void OnCheckedChanged(EventArgs e)
 {
   if (CheckedChanged != null) CheckedChanged.Invoke(this, e);
 }
開發者ID:Kammikazy,項目名稱:Neoforce-Mono,代碼行數:7,代碼來源:CheckBox.cs

示例14: OnClick

    ////////////////////////////////////////////////////////////////////////////     

    ////////////////////////////////////////////////////////////////////////////     
    protected override void OnClick(EventArgs e)    
    {
      MouseEventArgs ex = (e is MouseEventArgs) ? (MouseEventArgs)e : new MouseEventArgs();      
      
      if (ex.Button == MouseButton.Left || ex.Button == MouseButton.None)      
      {        
        Checked = !Checked;
      }  
      base.OnClick(e);
    }
開發者ID:Kammikazy,項目名稱:Neoforce-Mono,代碼行數:13,代碼來源:CheckBox.cs

示例15: OnClick

    ////////////////////////////////////////////////////////////////////////////   

    ////////////////////////////////////////////////////////////////////////////   
    protected override void OnClick(EventArgs e)
    {
      MouseEventArgs ex = e as MouseEventArgs;      
      ex.Position = new Point(ex.Position.X + sbHorz.Value, ex.Position.Y + sbVert.Value);
      
      base.OnClick(e);
    }
開發者ID:GodLesZ,項目名稱:svn-dump,代碼行數:10,代碼來源:Container.cs


注:本文中的TomShane.Neoforce.Controls.EventArgs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。