本文整理汇总了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);
//.........这里部分代码省略.........
示例2: btnClose_Click
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
void btnClose_Click(object sender, EventArgs e)
{
Close(ModalResult = ModalResult.Cancel);
}
示例3: OnMoveEnd
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
protected override void OnMoveEnd(EventArgs e)
{
base.OnMoveEnd(e);
try
{
Alpha = oldAlpha;
}
catch
{
}
}
示例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);
}
}
示例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;
}
示例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;
});
}
示例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);
}
示例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);
}
示例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;
}
}
示例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
{
}
}
示例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);
}
示例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
{
}
}
示例13: OnCheckedChanged
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
protected virtual void OnCheckedChanged(EventArgs e)
{
if (CheckedChanged != null) CheckedChanged.Invoke(this, e);
}
示例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);
}
示例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);
}