//-------------------------------------------------------------------------------------------------- public void RemovePanel(PropertyPanel panel) { var index = PropertyPanels.IndexOfFirst(p => p.Panel == panel); if (index >= 0) { PropertyPanels.RemoveAt(index); panel.Dispose(); } _HiddenPanels.Remove(panel); }
//-------------------------------------------------------------------------------------------------- public void AddPanel(PropertyPanel panel, PropertyPanel insertAfter) { var index = PropertyPanels.IndexOfFirst(p => p.Panel == insertAfter); if (index >= 0) { PropertyPanels.Insert(index + 1, new PropertyPanelItem(PropertyPanels[index].SortingKey, panel)); } else { PropertyPanels.Add(new PropertyPanelItem(int.MaxValue, panel)); } panel.OnAddedToPane(this); }
//-------------------------------------------------------------------------------------------------- #region IPropertyPanelManager public void AddPanel(PropertyPanel panel, int sortingKey) { var index = PropertyPanels.IndexOfFirst(p => p.SortingKey > sortingKey); if (index >= 0) { PropertyPanels.Insert(index, new PropertyPanelItem(sortingKey, panel)); } else { PropertyPanels.Add(new PropertyPanelItem(sortingKey, panel)); } panel.OnAddedToPane(this); }