Beispiel #1
0
 /// <summary>
 /// Calls dispose, but does a null check first.
 /// </summary>
 /// <param name="control"></param>
 public static void SafeDispose(XAMLiteBaseControl control)
 {
     if (control != null)
     {
         control.Dispose();
     }
 }
Beispiel #2
0
 /// <summary>
 /// Sets some parameters and adds the child to the Game.
 /// </summary>
 /// <param name="child"></param>
 private void AddChild(XAMLiteBaseControl child)
 {
     try
     {
         if (!Game.Components.Contains(child))
         {
             Game.Components.Add(child);
         }
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }