public void RemoveAt(KeyType id, Delegates.Callback callback) { var delegateList = (DelegateList)null; if (callbacksByKey.TryGetValue(id, out delegateList)) { delegateList.Remove(callback); } }
public void AddAt(KeyType id, Delegates.Callback callback) { var delegateList = (DelegateList)null; if (!callbacksByKey.TryGetValue(id, out delegateList)) { delegateList = new DelegateList(); callbacksByKey[id] = delegateList; } delegateList.Add(callback); }
public void Remove(Delegates.Callback callback) { if (Delegates.runningModificationDebug) { if (running) { Logs.errorOnChannel("Nanome.Core", "Changing delegate list while being invoked", "Remove"); return; } } callbacks.Remove(callback); }
public void trigger(Delegates.Callback task) { if (!available) { return; } available = false; Nanome.Core.Daemon.Dispatcher.queue(delegate() { task(); available = true; }); }
public bool Set(KeyType id, Delegates.Callback <ParamType> callback) { var hasKey = callbackByKey.ContainsKey(id); if (callback != null) { callbackByKey[id] = callback; } else { callbackByKey.Remove(id); } return(hasKey); }
public WatcherManagerNativeLibrary(string library, Delegates.Callback callback) { // some sanity checks. if (library == null) { throw new ArgumentNullException(nameof(library)); } if (callback == null) { throw new ArgumentNullException(nameof(callback)); } _handle = CreatePtrFromFileSystem(library); _callback = callback; }