示例#1
0
        /// <summary>
        /// Saves all unsaved values in the grid
        /// </summary>
        public override void UpdateContent()
        {
            if (classNameBox.IsFocused)
            {
                BindingExpression be = classNameBox.GetBindingExpression(TextBox.TextProperty);
                be.UpdateSource();
            }
            else
            if (elementNameBox.IsFocused)
            {
                BindingExpression be = elementNameBox.GetBindingExpression(TextBox.TextProperty);
                be.UpdateSource();
            }

            renameElement = null;
            renameClass   = null;

            foreach (TextBox t in attBoxes)
            {
                if (t.IsFocused && renameAlias != null)
                {
                    CheckUniqueAliasName(t, null);

                    renameAlias.selectedAttribute = (PSMAttribute)(t.DataContext);
                    BindingExpression be = t.GetBindingExpression(TextBox.TextProperty);
                    be.UpdateSource();
                }
            }

            renameAlias = null;
            attBoxes.Clear();
        }
        /// <summary>
        /// Saves all unsaved values in the grid
        /// </summary>
        public override void UpdateContent()
        {
            foreach (TextBox t in attBoxes)
            {
                if (t.IsFocused && renameAttribute != null)
                {
                    CheckUniqueAliasName(t, null);

                    renameAttribute.selectedAttribute = (PSMAttribute)(t.DataContext);
                    BindingExpression be = t.GetBindingExpression(TextBox.TextProperty);
                    be.UpdateSource();
                }
            }
            renameAttribute = null;
        }
        /// <summary>
        /// Displays Attribute container in the Properties window
        /// </summary>
        /// <param name="c"></param>
        public void Display(PSM_AttributeContainer c)
        {
            IDictionaryEnumerator ie = grid.Resources.GetEnumerator();

            while (ie.MoveNext())
            {
                if (ie.Key.ToString() == "renameAttribute")
                {
                    renameAttribute            = (RenameAliasConverter)ie.Value;
                    renameAttribute.Controller = c.Controller;
                }
            }

            controller         = c.Controller;
            attBox.DataContext = c.AttributeContainer.PSMAttributes;

            appearance.SetElement(c.Controller.DiagramController, c.ViewHelper);
            appearance.DisableEdit();
        }
示例#4
0
        /// <summary>
        ///  Displayes PSM class selected on the canvas
        /// </summary>
        /// <param name="c"></param>
        public void Display(XCaseViewBase c, MainWindow mainwin)
        {
            mv = mainwin;

            SelectedClassController = c.Controller;

            IDictionaryEnumerator ie = grid.Resources.GetEnumerator();

            while (ie.MoveNext())
            {
                if (ie.Key.ToString() == "renameClass")
                {
                    renameClass            = (RenamePSMClassConverter)ie.Value;
                    renameClass.Controller = SelectedClassController;
                }
                else
                if (ie.Key.ToString() == "renameAlias")
                {
                    renameAlias            = (RenameAliasConverter)ie.Value;
                    renameAlias.Controller = SelectedClassController;
                }
                else
                if (ie.Key.ToString() == "renameElement")
                {
                    renameElement            = (RenameElementConverter)ie.Value;
                    renameElement.Controller = SelectedClassController;
                }
            }

            classNameBox.DataContext        = ((PSM_ClassController)SelectedClassController).Class;
            elementNameBox.DataContext      = ((PSM_ClassController)SelectedClassController).Class;
            attBox.DataContext              = ((PSM_ClassController)SelectedClassController).Class.AllPSMAttributes;
            representedClassBox.DataContext = ((PSM_ClassController)SelectedClassController).Class;

            appearance.SetElement(c.Controller.DiagramController, c.ViewHelper);
            appearance.DisableEdit();
        }