Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
        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);
            }
        }