private void UpdateConnectorList(bool rebuild) { string prevSelectedID = ConnectorComboBox.ComboBox.SelectedValue as string; using (FlagManager.UseFlag("UpdateConnectorList")) { if (rebuild) { Connections.Clear(); } if (CurrentProject != null) { var studConnectors = CurrentProject.GetAllElements <PartConnection>(x => x.ConnectorType == LDD.Primitives.Connectors.ConnectorType.Custom2DField); if (rebuild) { Connections.AddRange(studConnectors); } else { Connections.SyncItems(studConnectors); } } } string currentSelectedID = ConnectorComboBox.ComboBox.SelectedValue as string; if (prevSelectedID != currentSelectedID) { FillSelectedConnector(false); } }
private void UpdateElementList(bool rebuild) { string prevSelectedID = ElementsComboBox.ComboBox.SelectedValue as string; using (FlagManager.UseFlag(nameof(UpdateElementList))) { if (rebuild || CurrentProject == null) { Connections.Clear(); } if (CurrentProject != null) { var studConnectors = CurrentProject.GetAllElements <PartConnection>(); if (rebuild) { Connections.AddRange(studConnectors); } else { Connections.SyncItems(studConnectors); } } } string currentSelectedID = ElementsComboBox.ComboBox.SelectedValue as string; if (prevSelectedID != currentSelectedID) { SetCurrentObject(ElementsComboBox.SelectedItem as PartConnection, false); } }