public void RemoveListener(CallBackMethod listener)
 {
     if (listeners != null)
     {
         listeners -= listener;
     }
 }
示例#2
0
 public static void SubscribeListeners(string inEvent, CallBackMethod listener)
 {
     if (!listeners.ContainsKey(inEvent))
     {
         listeners.Add(inEvent, listener);
     }
     else
     {
         listeners[inEvent] += listener;
     }
 }
示例#3
0
            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;
        }
示例#8
0
    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);
        }
    }
示例#9
0
 public void AddCallBackMethod(int userID, CallBackMethod method) //делегат который будет вызывать метод в WindowsForms с взодящим параметром - сообщением
 {
     _clients.FirstOrDefault(c => c.UserID == userID).CallbackMethods += method;
 }
示例#10
0
 public void AddCallBackMethod(OpenXmlElement element, CallBackMethod method)
 {
     _callBackMethods.Add(element.ElementTypeId, method);
 }
示例#11
0
文件: BasePacket.cs 项目: tgy/CSharp
 public void SetEventCallBack(CallBackMethod callBackMethod)
 {
     EventCallBackMethod = callBackMethod;
 }
示例#12
0
 public void SetEventCallBack(CallBackMethod callBackMethod)
 {
     EventCallBackMethod = callBackMethod;
 }
示例#13
0
 public void FadeOut(CallBackMethod callBack)
 {
     StartCoroutine(CoroutineFade(timeToFade, -1, callBack));
 }