/// <summary> /// Gets child index /// </summary> /// <param name="child"></param> /// <returns></returns> override public int GetChildIndex(ComponentAdapter child) { return(ContentChildren.FindIndex(delegate(ComponentAdapter componentAdapter) { return componentAdapter == child; })); }
/// <summary> /// Returns the tab children /// This could be overriden in subclass /// </summary> /// <returns></returns> public virtual List <DisplayListMember> GetTabChildren() { return(ContentChildren.FindAll(delegate(DisplayListMember child) { InteractiveComponent c = child as InteractiveComponent; //return null != c && c.Enabled && c.Visible && c.FocusEnabled; return FocusManager.IsFocusCandidate(c); })); }
/*public override DisplayListMember RemoveChild(DisplayListMember child) * { * FormItem fi = (FormItem)child; * fi.Dispose(); * * base.RemoveChild(child); * * return child; * }*/ protected override void CommitProperties() { base.CommitProperties(); if (_labelWidthChanged) { _labelWidthChanged = false; ContentChildren.ForEach(delegate(DisplayListMember child) { FormItem fi = child as FormItem; if (null != fi) { fi.LabelWidth = LabelWidth; } }); } }
/// <summary> /// Removes all children /// </summary> override public void RemoveAllChildren() { if (!Instantiated || !DesignerState.IsPlaying) // not instantiated // 20130512 { return; } for (int i = transform.childCount - 1; i >= 0; i--) { var childAdapter = GuiLookup.GetAdapter(transform.GetChild(i)); if (null != childAdapter) { RemoveChild(childAdapter); } } ContentChildren.Clear(); }
/// <summary> /// Removes the childAdapter /// </summary> /// <param name="childAdapter"></param> override public void RemoveChild(ComponentAdapter childAdapter) { ContentChildren.Remove(childAdapter); childAdapter.transform.parent = null; if (!Instantiated || !DesignerState.IsPlaying) // not instantiated { return; } var container = (Group)Component; if (null != container) { container.RemoveContentChild(childAdapter.Component); } }
/// <summary> /// Adds the content child /// </summary> /// <param name="child"></param> /// <param name="register"></param> override public void AddChild(ComponentAdapter child, bool register) { if (ContentChildren.Contains(child)) { ContentChildren.Remove(child); } ContentChildren.Add(child); if (child.FactoryMode) { return; } if (!Instantiated || !DesignerState.IsPlaying) // not instantiated { return; } DoInstantiate(child, register); }
/// <summary> /// Adds the content child at position /// </summary> /// <param name="index"></param> /// <param name="child"></param> /// <param name="register"></param> override public void AddChildAt(int index, ComponentAdapter child, bool register) { ContentChildren.Remove(child); if (ContentChildren.Count > 0) { throw new Exception("Only a single child is supported for Scroller"); } ContentChildren.Add(child); if (child.FactoryMode) { return; } if (!Instantiated || !DesignerState.IsPlaying) // not instantiated { return; } DoInstantiate(child, register); }