Beispiel #1
0
        /// <summary>
        /// Displays PIM class selected in Navigator window. Only model properties of the PIM class
        /// are displayed, not appearance properties.
        /// </summary>
        /// <param name="c">class</param>
        public void DisplayModelClass(Class c)
        {
            if (currentGrid != null)
            {
                try
                {
                    currentGrid.UpdateContent();
                }
                catch { }
                currentGrid = null;
            }

            Clear();

            if (c is PIMClass)
            {
                currentGrid = pimClassGrid;
                pimClassGrid.Display((PIMClass)c, "PIM", MainWindowRef);
                pimClassGrid.Visibility = Visibility.Visible;
            }
        }
Beispiel #2
0
        /// <summary>
        /// Invoked when a collection of selected elements on the canvas is changed.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void SelectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
        {
            //return;
            SelectedItemsCollection selection = (SelectedItemsCollection)sender;

            if (currentGrid != null)
            {
                currentGrid.UpdateContent();
                currentGrid = null;
            }

            Clear();

            if (selection.Count == 1)
            {
                ISelectable selectedItem = selection[0];
                string      selectedType = selectedItem.GetType().Name;
                if (selectedType == tPIM_Class)
                {
                    DisplaySelectedPIMClass((XCaseViewBase)selectedItem);
                }
                else if (selectedType == tPSM_Class)
                {
                    DisplaySelectedPSMClass((XCaseViewBase)selectedItem);
                }
                else if (selectedType == tXCaseComment)
                {
                    DisplaySelectedComment((XCaseComment)selectedItem);
                }
                else if (selectedType == tPIM_Association)
                {
                    DisplaySelectedAssociation((PIM_Association)selectedItem);
                }
                else if (selectedType == tAssociationDiamond)
                {
                    if (((AssociationDiamond)selectedItem).Association.AssociationClass != null)
                    {
                        DisplaySelectedAssociationClass(((AssociationDiamond)selectedItem).Association.AssociationClass);
                    }
                    else
                    {
                        DisplaySelectedAssociation(((AssociationDiamond)selectedItem).Association);
                    }
                }
                else if (selectedType == tPIM_AssociationClass)
                {
                    DisplaySelectedAssociationClass((PIM_AssociationClass)selectedItem);
                }
                else if (selectedType == tAssociationLabel)
                {
                    if (((AssociationLabel)selectedItem).Association != null)
                    {
                        if (((AssociationLabel)selectedItem).Association.AssociationClass == null)
                        {
                            DisplaySelectedAssociation(((AssociationLabel)selectedItem).Association);
                        }

                        else
                        {
                            DisplaySelectedAssociationClass(
                                ((AssociationLabel)selectedItem).Association.AssociationClass);
                        }
                    }
                    else if (((AssociationLabel)selectedItem).PSM_Association != null)
                    {
                        DisplaySelectedPSMAssociation(((AssociationLabel)selectedItem).PSM_Association);
                    }
                }
                else if (selectedType == tPSM_ContentContainer)
                {
                    DisplaySelectedPSMContentContainer((PSM_ContentContainer)selectedItem);
                }
                else if (selectedType == tPSM_Association)
                {
                    DisplaySelectedPSMAssociation((PSM_Association)selectedItem);
                }
                else if (selectedType == tPSM_AttributeContainer)
                {
                    DisplayAttributeContainer(((PSM_AttributeContainer)selectedItem));
                }
                else
                {
                }
            }
        }
Beispiel #3
0
 /// <summary>
 /// Displays currently selected <see cref="PSMAttributeContainer"/> in Properties window.
 /// </summary>
 /// <param name="c">attribute container</param>
 private void DisplayAttributeContainer(PSM_AttributeContainer c)
 {
     currentGrid = attributeContainerGrid;
     attributeContainerGrid.Display(c);
     attributeContainerGrid.Visibility = Visibility.Visible;
 }
Beispiel #4
0
 /// <summary>
 /// Displays currently selected <see cref="PSMAssociation"/> in Properties window.
 /// </summary>
 /// <param name="p"></param>
 private void DisplaySelectedPSMAssociation(PSM_Association p)
 {
     currentGrid = psmAssociationGrid;
     psmAssociationGrid.Display(p);
     psmAssociationGrid.Visibility = Visibility.Visible;
 }
Beispiel #5
0
 /// <summary>
 /// Displays currently selected <see cref="PSMContentContainer"/> in Properties window.
 /// </summary>
 /// <param name="c">content container</param>
 private void DisplaySelectedPSMContentContainer(PSM_ContentContainer c)
 {
     currentGrid = contentContainerGrid;
     contentContainerGrid.Display(c);
     contentContainerGrid.Visibility = Visibility.Visible;
 }
Beispiel #6
0
 /// <summary>
 /// Displays currently selected Association class in Properties window.
 /// </summary>
 /// <param name="c">association class</param>
 private void DisplaySelectedAssociationClass(PIM_AssociationClass c)
 {
     currentGrid = associationClassGrid;
     associationClassGrid.Display(c, MainWindowRef);
     associationClassGrid.Visibility = Visibility.Visible;
 }
Beispiel #7
0
 /// <summary>
 /// Displays currently selected Association in Properties window.
 /// </summary>
 /// <param name="a"></param>
 private void DisplaySelectedAssociation(PIM_Association a)
 {
     currentGrid = associationGrid;
     associationGrid.Display(a);
     associationGrid.Visibility = Visibility.Visible;
 }
Beispiel #8
0
 /// <summary>
 /// Displays currently selected comment in Properties window.
 /// </summary>
 /// <param name="c">comment</param>
 private void DisplaySelectedComment(XCaseComment c)
 {
     currentGrid = commentGrid;
     commentGrid.Display(c);
     commentGrid.Visibility = Visibility.Visible;
 }
Beispiel #9
0
 /// <summary>
 /// Displays currently PSM class in Properties window.
 /// </summary>
 /// <param name="c">psm class</param>
 private void DisplaySelectedPSMClass(XCaseViewBase c)
 {
     currentGrid = psmClassGrid;
     psmClassGrid.Display(c, MainWindowRef);
     psmClassGrid.Visibility = Visibility.Visible;
 }