/// <summary> /// Enables the updating of an UlanComponent. /// </summary> /// <param name="name">The name of the UlanComponent.</param> public void EnableComponent(string name) { UlanComponent comp = ValidateComponent(name); if (!comp.Enabled) { comp.ToggleEnabled(); } }
/// <summary> /// Enables the drawing of a DrawableUlanComponent. /// </summary> /// <param name="name">The name of the DrawableUlanComponent.</param> public void RevealComponent(string name) { UlanComponent comp = ValidateComponent(name); if (!comp.Visable) { comp.ToggleVisable(); } }
UlanComponent ValidateComponent(string name) { UlanComponent comp = FindComponent(name); if (comp == null) { throw new ArgumentNullException(string.Format("Component dosn't exist {0}", name)); } else { return(comp); } }
/// <summary> /// Adds an UlanComponent to this. /// </summary> /// <param name="component">The UlanComponent to be added.</param> public static void Add(UlanComponent component) { if (components.Count == 0) { components.Add(component); } else { for (int i = 0; i < components.Count; i++) { if (components[i].Name != component.Name) { components.Add(component); } } } }