/// <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(); } }
/// <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); } }