public static void Add(this IComponentTree componentTree, ITvControl control) { var metadata = componentTree.Add(control.AsComponent()); var ctree = componentTree.RootControls() as ControlsTree; ctree.Add(control.Metadata); }
public static void InsertAfter(this IComponentTree componentTree, ITvControl control, int position) { var metadata = componentTree.Add(control.AsComponent()); var ctree = componentTree.RootControls() as ControlsTree; ctree.InsertAfter(control.Metadata, position); }
public static bool Remove(this IComponentTree componentTree, ITvControl control) { var removed = componentTree.Remove(control.AsComponent()); if (removed) { var ctree = componentTree.RootControls() as ControlsTree; ctree.Remove(control.Metadata); } return(removed); }