public override void InitializeChildControlStructure() { statusBar.Panels.UIACollectionChanged += new CollectionChangeEventHandler(OnCollectionChanged); for (int i = 0; i < statusBar.Panels.Count; ++i) { StatusBarPanelProvider panel = GetPanelProvider(i); AddChildProvider(panel); } }
public StatusBarPanelProvider RemovePanelAt(int index) { StatusBarPanelProvider panel = null; if (index < panels.Count) { panel = panels [index]; panels.RemoveAt(index); panel.Terminate(); } return(panel); }
#pragma warning disable 169 private void OnCollectionChanged(object sender, CollectionChangeEventArgs e) { if (e.Action == CollectionChangeAction.Add) { StatusBarPanelProvider panel = GetPanelProvider((int)e.Element); AddChildProvider(panel); } else if (e.Action == CollectionChangeAction.Remove) { StatusBarPanelProvider panel = RemovePanelAt((int)e.Element); RemoveChildProvider(panel); } else if (e.Action == CollectionChangeAction.Refresh) { ClearPanelsCollection(); OnNavigationChildrenCleared(); } }
public StatusBarPanelProvider GetPanelProvider(int index) { StatusBarPanelProvider panel = null; if (index < 0 || index >= statusBar.Panels.Count) { return(null); } else if (index >= panels.Count) { for (int loop = panels.Count - 1; loop < index; ++loop) { panel = new StatusBarPanelProvider(statusBar.Panels [index]); panels.Add(panel); panel.Initialize(); } } return(panels [index]); }
public StatusBarPanelProvider GetPanelProvider (int index) { StatusBarPanelProvider panel = null; if (index < 0 || index >= statusBar.Panels.Count) return null; else if (index >= panels.Count) { for (int loop = panels.Count - 1; loop < index; ++loop) { panel = new StatusBarPanelProvider (statusBar.Panels [index]); panels.Add (panel); panel.Initialize (); } } return panels [index]; }