public static extern uint midiOutOpen( out IntPtr lphmo, int uDeviceID, MidiOutProc dwCallback, int dwCallbackInstance, CALLBACK dwFlags );
private void Init(float interval, CALLBACK callback, bool loop = false, System.Object parameter = null) { _interval = interval; _callback = callback; _loop = loop; _parameter = parameter; _timestamp = TimeHelper.GetCurrentRealTimestamp(); }
public CDPWorkerObject(LivePacketDevice sd, CALLBACK cb) { try { selectedDevice = sd; callBack = cb; communicator = selectedDevice.Open(512, PacketDeviceOpenAttributes.Promiscuous, 1000); capturedPacket = null; } catch (Exception) { } }
public static void Init() { if (Environment.OSVersion.Platform == PlatformID.Win32NT || Environment.OSVersion.Platform == PlatformID.Win32S || Environment.OSVersion.Platform == PlatformID.Win32Windows || Environment.OSVersion.Platform == PlatformID.WinCE) { m_callback = OnKey; // Keep a reference on OnKey m_hook = NativeMethods.SetWindowsHookEx(WH.KEYBOARD_LL, m_callback, NativeMethods.LoadLibrary("user32.dll"), 0); if (m_hook == HOOK.INVALID) throw new Win32Exception(Marshal.GetLastWin32Error()); } }
public static void Fire(string name, object[] args) { DelegateObjList dol; if (globe.eventTable.TryGetValue(name, out dol)) { dol.Enter(); int count = dol.events.Count; for (int i = 0; i < count; ++i) { CALLBACK callback = dol.events[i] as CALLBACK; callback(args); } dol.Leave(); } }
private void InteropCppToCSharpButton_Click(object sender, RoutedEventArgs e) { //Set callback so C++ can call back to C#. _callback = Callback; SetCallback(_callback); // System.Int32 size = 256; System.Byte[] str = new byte[size]; for (int i = 0; i < size; i++) { str[i] = (byte)'1'; } GetCSharpText(str, out size); string result = System.Text.Encoding.UTF8.GetString(str, 0, size); InteropCppToCSharpButtonTextBox.Text = result; }
public static TimerEx Init(string timerName, float interval, CALLBACK callback, bool loop = false, System.Object parameter = null) { if (_timerRoot == null) { _timerRoot = new GameObject("TimerSpawn"); MonoBehaviour.DontDestroyOnLoad(_timerRoot); } GameObject gameObject = new GameObject(TIMEREX_NAME_PREFIX + timerName); MonoBehaviour.DontDestroyOnLoad(gameObject); gameObject.transform.parent = _timerRoot.transform; TimerEx t = gameObject.AddComponent <TimerEx>(); if (t != null) { t.Init(interval, callback, loop, parameter); return(t); } return(null); }
public void Listen(string name, CALLBACK handler) { if (handler == null) { return; } DelegateObjList dol; if (!eventTable.TryGetValue(name, out dol)) { dol = new DelegateObjList(); eventTable.Add(name, dol); } dol.Add(handler); if (parent != null) { parent.Listen(name, handler); } }
public static extern HOOK SetWindowsHookEx(WH idHook, CALLBACK lpfn, IntPtr hMod, int dwThreadId);
internal static extern Int32 McRegisterCallback(UInt32 instance, CALLBACK callbackFunction, UInt32 context);
public static void RegisterCallback(UInt32 instance, CALLBACK callbackFunction, UInt32 context) { ThrowOnMultiCamError(NativeMethods.McRegisterCallback(instance, callbackFunction, context), "Cannot register callback"); }
static extern void SetCallback(CALLBACK callback);
internal static extern bool MP4Net_ClientRegisterDrawFun(int StockHandle, CALLBACK DrawFun, int nUser);
public static extern HOOK SetWindowsHookEx(WH idHook, CALLBACK lpfn, IntPtr hMod, int dwThreadId);
public static extern int EnumWindows(CALLBACK x, int y);
public void GetHwd() { CALLBACK myCallBack = new CALLBACK(Report); EnumWindows(myCallBack, 0); }
public CDPWorkerObject(LivePacketDevice sd, CALLBACK cb) { try { selectedDevice = sd; callBack = cb; communicator = selectedDevice.Open(512, PacketDeviceOpenAttributes.Promiscuous, 1000); capturedPacket = null; } catch (Exception) { } }
public static void Fini() { // XXX: this will crash if called from the GC Finalizer Thread because // the hook needs to be removed from the same thread that installed it. if (m_hook != HOOK.INVALID) { int ret = NativeMethods.UnhookWindowsHookEx(m_hook); if (ret == 0) throw new Win32Exception(Marshal.GetLastWin32Error()); m_hook = HOOK.INVALID; } m_callback = null; }