本文整理汇总了C#中TomShane.Neoforce.Controls.EventArgs类的典型用法代码示例。如果您正苦于以下问题:C# EventArgs类的具体用法?C# EventArgs怎么用?C# EventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EventArgs类属于TomShane.Neoforce.Controls命名空间,在下文中一共展示了EventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: OnBorderChanged
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
protected virtual void OnBorderChanged(EventArgs e)
{
if (BorderChanged != null) BorderChanged.Invoke(this, e);
}
开发者ID:Kammikazy,项目名称:NeoforceControls-SharpDX,代码行数:6,代码来源:Bevel.cs
示例17: btnDeleteGroup_Click
void btnDeleteGroup_Click(object sender, EventArgs e)
{
string item = cbListPicker.Items.ElementAt(cbListPicker.ItemIndex).ToString();
if (item.Equals("Other Objects") || item.Equals("master") || item.Equals("Link Groups") || item.Equals("Normal Groups"))
{
return;
}
else if (!item.Equals(""))
{
Group g = GetActiveGroup();
if (g == null) return;
if (g.Name.Equals("[G0]")) return;
foreach (object o in lstMain.Items.ToList())
{
lstMain.Items.Remove(o);
}
if (g.fullSet.Contains(room.targetNode)) room.targetNode = null;
if (g.fullSet.Contains(inspectorArea.editNode) && inspectorArea.editNode != g.defaultNode)
{
inspectorArea.InsBox.Items.Clear();
inspectorArea.rootitem = null;
inspectorArea.editNode = null;
}
g.DeleteGroup();
cbListPicker.Items.Remove(g.Name);
cbListPicker.ItemIndex = 2;
//UpdateGroupComboBoxes();
SyncTitleNumber();
}
lstMain.ScrollTo(0);
}
开发者ID:GameMakersUnion,项目名称:BoulderDash-OrbIt,代码行数:37,代码来源:Sidebar.cs
示例18: OnStyleChanged
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
protected virtual void OnStyleChanged(EventArgs e)
{
if (StyleChanged != null) StyleChanged.Invoke(this, e);
}
开发者ID:Kammikazy,项目名称:NeoforceControls-SharpDX,代码行数:6,代码来源:Bevel.cs
示例19: cbListPicker_Click
void cbListPicker_Click(object sender, EventArgs e)
{
int t = cbListPicker.ItemIndex;
cbListPicker.ItemIndex = 0;
cbListPicker.ItemIndex = t;
}
开发者ID:GameMakersUnion,项目名称:BoulderDash-OrbIt,代码行数:6,代码来源:Sidebar.cs
示例20: OnDoubleClick
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
protected override void OnDoubleClick(EventArgs e)
{
x�
��blob 1024�PNG
IHDR�w=�+tEXtCreation TimeMi 31 Mrz 2004 15:42:07 +0100�#ntIME���@P pHYs
�
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:11,代码来源:Window.cs
注:本文中的TomShane.Neoforce.Controls.EventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论