private void Rename(object sender, RoutedEventArgs e)
        {
            var parent = Parent;

            while (!(parent is WindowDrawing))
            {
                parent = LogicalTreeHelper.GetParent(parent);
            }

            windowDrawing = (WindowDrawing)parent;
            if (windowDrawing != null)
            {
                int lineType;
                switch (_lineStyle)
                {
                case "Full":
                    lineType = 0;
                    break;

                case "Dashed":
                    lineType = 1;
                    break;

                case "Dotted":
                    lineType = 2;
                    break;

                default:
                    lineType = 0;
                    break;
                }
                windowDrawing.FloatingTextEdition(_label, _borderColor, _fillColor, lineType);
            }
        }
        public void Initialize()
        {
            var parent = Parent;

            while (!(parent is WindowDrawing))
            {
                parent = LogicalTreeHelper.GetParent(parent);
            }

            windowDrawing = (WindowDrawing)parent;
        }
        private void ClosePopup(object sender, RoutedEventArgs e)
        {
            var parent = Parent;

            while (!(parent is WindowDrawing))
            {
                parent = LogicalTreeHelper.GetParent(parent);
            }

            windowDrawing = (WindowDrawing)parent;
            if (windowDrawing != null)
            {
                windowDrawing.CloseMessagePopup();
            }
        }
예제 #4
0
        public void Initialize()
        {
            var parent = Parent;

            while (!(parent is WindowDrawing))
            {
                parent = LogicalTreeHelper.GetParent(parent);
            }

            drawingview = (WindowDrawing)parent;

            var scrollViewer = GetDescendantByType(historyList, typeof(ScrollViewer)) as ScrollViewer;

            scrollViewer.ScrollToBottom();
        }
예제 #5
0
        public void setParameters(LinkStroke linkStroke, CustomInkCanvas canvas)
        {
            var parent = Parent;

            while (!(parent is WindowDrawing))
            {
                parent = LogicalTreeHelper.GetParent(parent);
            }

            windowDrawing = (WindowDrawing)parent;
            if (windowDrawing != null)
            {
                LinkStroke stroke = windowDrawing.surfaceDessin.GetSelectedStrokes()[0] as LinkStroke;
                _label            = stroke.name;
                _selectedColor    = stroke.style.color;
                _multiplicityFrom = stroke.from.multiplicity;
                _multiplicityTo   = stroke.to.multiplicity;

                switch (stroke.linkType)
                {
                case (int)LinkTypes.LINE:
                    _linkType = "Line";
                    break;

                case (int)LinkTypes.HERITAGE:
                    _linkType = "Heritage";
                    break;

                case (int)LinkTypes.ONE_WAY_ASSOCIATION:
                    _linkType = "One way association";
                    break;

                case (int)LinkTypes.TWO_WAY_ASSOCIATION:
                    _linkType = "Two way association";
                    break;

                case (int)LinkTypes.COMPOSITION:
                    _linkType = "Composition";
                    break;

                case (int)LinkTypes.AGGREGATION:
                    _linkType = "Aggregation";
                    break;

                default:
                    _linkType = "Line";
                    break;
                }

                switch (stroke.style.type)
                {
                case (int)LinkStyles.FULL:
                    _linkStyle = "Full";
                    break;

                case (int)LinkStyles.DOTTED:
                    _linkStyle = "Dotted";
                    break;

                default:
                    _linkStyle = "Full";
                    break;
                }

                switch (stroke.style.thickness)
                {
                case (int)LinkThicknesses.THIN:
                    _linkThickness = "Thin";
                    break;

                case (int)LinkThicknesses.NORMAL:
                    _linkThickness = "Normal";
                    break;

                case (int)LinkThicknesses.THICK:
                    _linkThickness = "Thick";
                    break;

                default:
                    _linkThickness = "Thin";
                    break;
                }
            }

            if (isBetweenTwoClasses(linkStroke, canvas))
            {
                _linkTypesList = new List <string> {
                    "Line", "One way association", "Two way association", "Heritage", "Aggregation", "Composition"
                };
            }
            else if (isLinkedToOneClass(linkStroke, canvas))
            {
                _linkTypesList = new List <string> {
                    "Line", "One way association", "Two way association"
                };
            }
            else if (isLinkedToProcess(linkStroke, canvas))
            {
                _linkTypesList = new List <string> {
                    "One way association"
                };
            }
            else
            {
                _linkTypesList = new List <string> {
                    "Line", "One way association", "Two way association"
                };
            }
            _linkStylesList = new List <string> {
                "Full", "Dotted"
            };
            _linkThicknessesList = new List <string> {
                "Thin", "Normal", "Thick"
            };

            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Label"));
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("LinkStyle"));
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("LinkType"));
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("SelectedColor"));
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("LinkThickness"));
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("MultiplicityFrom"));
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("MultiplicityTo"));
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("LinkStylesList"));
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("LinkTypesList"));
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("LinkThicknessesList"));
        }
예제 #6
0
        private void Rename(object sender, RoutedEventArgs e)
        {
            var parent = Parent;

            while (!(parent is WindowDrawing))
            {
                parent = LogicalTreeHelper.GetParent(parent);
            }

            windowDrawing = (WindowDrawing)parent;
            if (windowDrawing != null)
            {
                int linkType;
                switch (_linkType)
                {
                case "Line":
                    linkType = 0;
                    break;

                case "One way association":
                    linkType = 1;
                    break;

                case "Two way association":
                    linkType = 2;
                    break;

                case "Heritage":
                    linkType = 3;
                    break;

                case "Aggregation":
                    linkType = 4;
                    break;

                case "Composition":
                    linkType = 5;
                    break;

                default:
                    linkType = 0;
                    break;
                }

                int linkStyle;
                switch (_linkStyle)
                {
                case "Full":
                    linkStyle = 0;
                    break;

                case "Dotted":
                    linkStyle = 1;
                    break;

                default:
                    linkStyle = 0;
                    break;
                }

                int linkThickness;
                switch (_linkThickness)
                {
                case "Thin":
                    linkThickness = 0;
                    break;

                case "Normal":
                    linkThickness = 1;
                    break;

                case "Thick":
                    linkThickness = 2;
                    break;

                default:
                    linkThickness = 0;
                    break;
                }

                windowDrawing.EditLink(_label, linkType, linkStyle, _selectedColor, linkThickness, _multiplicityFrom, _multiplicityTo);
            }
        }