Example #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();
        }
Example #2
0
        /// <summary>
        /// Saves all unsaved values in the grid
        /// </summary>
        public override void UpdateContent()
        {
            if (elementNameBox.IsFocused)
            {
                BindingExpression be = elementNameBox.GetBindingExpression(TextBox.TextProperty);
                be.UpdateSource();
            }

            renameElement = null;
        }
Example #3
0
        /// <summary>
        /// Displays selected content container in the Properties window
        /// </summary>
        /// <param name="c"></param>
        public void Display(PSM_ContentContainer c)
        {
            IDictionaryEnumerator ie = grid.Resources.GetEnumerator();

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

            elementNameBox.DataContext = c.Controller.NamedElement;

            appearance.SetElement(c.Controller.DiagramController, c.ViewHelper);
            appearance.DisableEdit();
        }
Example #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();
        }