public void RemoveListener(CallBackMethod listener) { if (listeners != null) { listeners -= listener; } }
public static void SubscribeListeners(string inEvent, CallBackMethod listener) { if (!listeners.ContainsKey(inEvent)) { listeners.Add(inEvent, listener); } else { listeners[inEvent] += listener; } }
public static void UnSubscribeListeners(string inEvent, CallBackMethod listener) { if (listeners.ContainsKey(inEvent)) { listeners[inEvent] -= listener; if (listeners[inEvent] == null) { listeners.Remove(inEvent); } } }
public void AddNewListener(CallBackMethod listener) { if (listener == null) { listeners = new CallBackMethod(listener); Debug.Log(listeners.Method.Name); } listeners += listener; HasListerners(); }
public void AddCallBackMethod(OpenXmlElement element, CallBackMethod method) { if (!_callBackMethods.Keys.Contains(element.ElementTypeId)) { _callBackMethods.Add(element.ElementTypeId, new List <CallBackMethod>()); } // _callBackMethods[element.ElementTypeId] is a List. Let's check if the method obj is already added to the list. if (!_callBackMethods[element.ElementTypeId].Contains(method)) { _callBackMethods[element.ElementTypeId].Add(method); } }
public void AddCallBackMethod(OpenXmlElement element, CallBackMethod method) { if (!_callBackMethods.Keys.Contains(element.ElementTypeId)) { _callBackMethods.Add(element.ElementTypeId, new List<CallBackMethod>()); } // _callBackMethods[element.ElementTypeId] is a List. Let's check if the method obj is already added to the list. if (!_callBackMethods[element.ElementTypeId].Contains(method)) { _callBackMethods[element.ElementTypeId].Add(method); } }
public Event(int uniqueID, string eventCode, CallBackMethod listener) { this.uniqueID = uniqueID; //Null-Checking if (string.IsNullOrEmpty(eventCode)) { //There is no this.eventCode = "Unassigned"; } else { this.eventCode = eventCode; } hasTriggered = false; }
IEnumerator CoroutineFade(float time, float directionFade, CallBackMethod callBack) { float timeEnd = Time.time + time; while (Time.time < timeEnd) { _canvasGroup.alpha += (Time.deltaTime / time) * directionFade; yield return(null); } if (directionFade == -1) { _canvasGroup.alpha = 0; } else { _canvasGroup.alpha = 1; } if (callBack != null) { callBack(directionFade); } }
public void AddCallBackMethod(int userID, CallBackMethod method) //делегат который будет вызывать метод в WindowsForms с взодящим параметром - сообщением { _clients.FirstOrDefault(c => c.UserID == userID).CallbackMethods += method; }
public void AddCallBackMethod(OpenXmlElement element, CallBackMethod method) { _callBackMethods.Add(element.ElementTypeId, method); }
public void SetEventCallBack(CallBackMethod callBackMethod) { EventCallBackMethod = callBackMethod; }
public void FadeOut(CallBackMethod callBack) { StartCoroutine(CoroutineFade(timeToFade, -1, callBack)); }