Ejemplo n.º 1
0
 /// <summary>
 /// Triggers the event.
 /// </summary>
 /// <param name="eventName">Event name.</param>
 /// <param name="args">Arguments.</param>
 static public void Trigger(eEvent eventName, params object[] args)
 {
     if (eventDictionary[(int)eventName] != null)
     {
         try
         {
             eventDictionary[(int)eventName](args);
         }
         catch { }
     }
 }
Ejemplo n.º 2
0
    public static void StopListening(eEvent eventName, UnityAction <BaseEvent> listener)
    {
        if (eventManager == null)
        {
            return;
        }
        UnityEventBase thisEvent = null;

        if (instance.eventDictionary.TryGetValue(eventName, out thisEvent))
        {
            thisEvent.RemoveListener(listener);
        }
    }
Ejemplo n.º 3
0
    public static void StartListening(eEvent eventName, UnityAction <BaseEvent> listener)
    {
        UnityEventBase thisEvent = null;

        if (instance.eventDictionary.TryGetValue(eventName, out thisEvent))
        {
            thisEvent.AddListener(listener);
        }
        else
        {
            thisEvent = new UnityEventBase();
            thisEvent.AddListener(listener);
            instance.eventDictionary.Add(eventName, thisEvent);
        }
    }
Ejemplo n.º 4
0
 public void ShowDialog()
 {
     eExitResult = NavigationButtons.Navigation.eEvent.NOTHING;
     LastStartupDialog_TYPE = ChildDialog.GetType().ToString();
     if (!bDoModal)
     {
         ChildDialog.StartPosition = FormStartPosition.CenterScreen;
         ChildDialog.TopMost = true;
         ChildDialog.Visible = true;
         ChildDialog.Show();
         while (eExitResult == NavigationButtons.Navigation.eEvent.NOTHING)
         {
             Application.DoEvents();
         }
         if (ChildDialog.IsAccessible)
         {
             ChildDialog.Close();
         }
     }
     else
     {
         ChildDialog.ShowDialog();
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Triggers the event.
 /// </summary>
 /// <param name="eventName">Event name.</param>
 static public void Trigger(eEvent eventName)
 {
     Trigger(eventName, null);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Stops the listening an Event.
 /// Its best to be called OnDisabled
 /// </summary>
 /// <param name="eventName">Event name.</param>
 /// <param name="listener">Listener.</param>
 static public void Remove(eEvent eventName, EventArguments listener)
 {
     eventDictionary[(int)eventName] -= listener;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Starts the listening an event.
 /// Its best to be called OnEnabled
 /// </summary>
 /// <param name="eventName">Event name.</param>
 /// <param name="listener">Listener.</param>
 static public void Listen(eEvent eventName, EventArguments listener)
 {
     eventDictionary[(int)eventName] += listener;
 }
 internal void After(eEvent evt, object sender, EventArgs e)
 {
 }
 internal void Before(eEvent evt, object sender, EventArgs e)
 {
 }