Esempio n. 1
0
File: Event.cs Progetto: Matodor/mUI
            /*---------SAVEABLE DATA---------*/

            public Event(string eventKey) : base($"mSE_{eventKey}")
            {
                EventKey  = eventKey;
                Enabled   = true;
                LastEvent = DateTime.MinValue;

                Load();
            }
Esempio n. 2
0
File: Event.cs Progetto: Matodor/mUI
            public void Invoke(object payload = null)
            {
                if (!Enabled)
                {
                    return;
                }

                BeforeEventCounter++;
                if (BeforeInvoke(this, new EventArgs
                {
                    Payload = payload
                }))
                {
                    EventCounter++;
                    LastEvent = DateTime.Now;
                    OnEvent(this, new EventArgs
                    {
                        Payload = payload
                    });
                }
            }