Пример #1
0
        private void comboBoxResponsible_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                if (null != comboBoxResponsible.SelectedItem && freezeHandler == false)
                {
                    ColorDefinition selectedResponsible = (ColorDefinition)comboBoxResponsible.SelectedItem;

                    if (null != selectedBCF && null != selectedIssue && null != selElementProperties)
                    {
                        selElementProperties.ResponsibleParty = selectedResponsible.ParameterValue;

                        if (bcfDictionary.ContainsKey(selectedBCF.MarkupFileId))
                        {
                            if (bcfDictionary[selectedBCF.MarkupFileId].ContainsKey(selectedIssue.IssueId))
                            {
                                if (bcfDictionary[selectedBCF.MarkupFileId][selectedIssue.IssueId].ElementDictionary.ContainsKey(selElementProperties.ElementId))
                                {
                                    bcfDictionary[selectedBCF.MarkupFileId][selectedIssue.IssueId].ElementDictionary.Remove(selElementProperties.ElementId);
                                    bcfDictionary[selectedBCF.MarkupFileId][selectedIssue.IssueId].ElementDictionary.Add(selElementProperties.ElementId, selElementProperties);
                                }
                            }
                        }

                        bool updatedSheet = BCFParser.UpdateElementProperties(selElementProperties, BCFParameters.BCF_Responsibility, selectedBCF.ViewpointFileId);

                        m_handler.CurrentElement = selElementProperties;
                        m_handler.Request.Make(RequestId.UpdateResponsibility);
                        m_event.Raise();
                        SetFocus();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Failed to set responsibility itme.\n" + ex.Message, "Set Responsibility Items", MessageBoxButton.OK, MessageBoxImage.Warning);
            }
        }