/// <summary>
 /// Добавить объект в сессию/убрать (s=null)
 /// </summary>
 public virtual void SetSession(Session s)
 {
     if (Session != null && (Session = s) == null)
     {
         OnVanished.Invoke(this);
     }
     else if (Session == null && (Session = s) != null)
     {
         ID = Session.AddObject(this);
         if (OnAppears != null)
         {
             OnAppears.Invoke(this);
         }
     }
 }
Beispiel #2
0
 /// <summary>
 /// Добавить объект в сессию/убрать (s=null)
 /// </summary>
 public virtual void SetSession(Session s, int id = -1)
 {
     if (Session != null && (Session = s) == null)
     {
         ID = -1;
         if (OnVanished != null)
         {
             OnVanished.Invoke(this);
         }
     }
     else if (Session == null && (Session = s) != null)
     {
         ID = id;
         if (OnAppears != null)
         {
             OnAppears.Invoke(this);
         }
     }
 }