public void AddEvent(string name, Keys[] keyStroke, object instance, string method, object[] parameters) { eventHandler evnt = new eventHandler(name, getKeyStrokeString(keyStroke), keyStroke.Count(), instance, method, parameters); events.Add(evnt); events = events.OrderByDescending(itm => itm.KeysNumber).ToList(); }
public playListItem(string _filePath, eventHandler clickety) { filePath = _filePath; this.Text = filePath; this.Size = new System.Drawing.Size(194, 16); this.AutoSize = false; this.Click += new EventHandler(clickety); }
public xRenderable(Microsoft.DirectX.Direct3D.Device device) { D3DDevice = device; RenderID = 0; OnClick += new eventHandler(DefaultEvent); OnMouseOut += new eventHandler(DefaultEvent); OnMouseOver += new eventHandler(DefaultEvent); }
private static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam) { if (nCode >= 0 && wParam == (IntPtr)WM_KEYDOWN) { int vkCode = Marshal.ReadInt32(lParam); Keys vk = (Keys)vkCode; if (!keysDown.Contains(vk)) { keysDown.Add((Keys)vkCode); string keyStrokeString = getKeyStrokeString(keysDown.ToArray()); eventHandler e = events.Find(evnt => (evnt.Triggered == false && evnt.KeyStroke == keyStrokeString)); if (e != null) { e.call(); } if (LOG_KEYS) { Console.WriteLine("KeyDown : " + vk); } } } else if (nCode >= 0 && wParam == (IntPtr)WM_KEYUP) { int vkCode = Marshal.ReadInt32(lParam); Keys vk = (Keys)vkCode; if (keysDown.Contains(vk)) { string keyStrokeString = getKeyStrokeString(keysDown.ToArray()); if (keyStrokeString == "") { foreach (eventHandler ev in events.FindAll(evnt => (evnt.Triggered == true))) { ev.Triggered = false; } } else { eventHandler e = events.Find(evnt => (evnt.Triggered == true && evnt.KeyStroke == keyStrokeString)); if (e != null) { e.Triggered = false; } } keysDown.Remove((Keys)vk); if (LOG_KEYS) { Console.WriteLine("KeyUp : " + (Keys)vkCode); } } } return(CallNextHookEx(_hookID, nCode, wParam, lParam)); }
void init() { Screen.orientation = ScreenOrientation.Landscape; at_confirm = false; reset_audio = false; eh = new eventHandler(InputModule.instance); CDTimer TriggerStartNewGame = new CDTimer(1f, InputModule.instance); TriggerStartNewGame.TakeDownTime(); }
public static void RemoveListener(string type, eventHandler listener) { if (!eventDic.ContainsKey(type)) { Debug.LogError(type + ":不存在!"); } else { eventDic[type].Remove(listener); } }
public static void AddListener(string type, eventHandler listener) { if (!eventDic.ContainsKey(type)) { HashSet <eventHandler> eventCollection = new HashSet <eventHandler>(); eventDic.Add(type, eventCollection); eventDic[type].Add(listener); } else { eventDic[type].Add(listener); } }
// Use this for initialization void Start() { _cachedTransform = transform; _offsetVector = new Vector3(horizontalDistance, verticalDistance, 0); _startUpVector = new Vector3(startUpHorizontalDistance, verticalDistance, 0); _currentSpeed = 0; _eventHandler = target.gameObject.GetComponent <eventHandler>(); if (_eventHandler == null) { throw new NullReferenceException("Event handler not found"); } _platformerControl = target.gameObject.GetComponent <platformerControl>(); if (_platformerControl == null) { throw new NullReferenceException("Event handler not found"); } _currentAnimationName = "flyidle_custom"; }
public void RegisterEventHandler(eventHandler eh) { listeners.Add(eh); }
=> Initialize(eventSource, eventName, eventHandler, weakReference, eventBindingFlags);
public void AddEvent(string name, Keys[] keyStroke, object instance, string method, object[] parameters) { eventHandler evnt = new eventHandler(name, getKeyStrokeString(keyStroke), instance, method, parameters); events.Add(evnt); }
// Use this for initialization void Start() { reset_audio = false; GameObject.Find("GameMode").GetComponent <GameMode>().init(); eh = new eventHandler(InputModule.instance); }