Esempio n. 1
0
        public override void ConfigureDetailForm(DetailSettingsForm detailForm)
        {
            var fig = _owner.Figure;

            /// line detail page
            var borderPage = new EdgeLineDetailPage(new [] { _owner.Host });

            borderPage.LineColor     = fig.LineColor;
            borderPage.LineWidth     = fig.LineWidth;
            borderPage.LineDashStyle = fig.LineDashStyle;
            borderPage.IsModified    = false;
            detailForm.RegisterPage("線", borderPage);
        }
Esempio n. 2
0
        public override void ConfigureDetailForm(DetailSettingsForm detailForm)
        {
            var fig = _owner.Figure;

            var assoc  = _owner.Model;
            var source = assoc.SourceMemberEnd;
            var target = assoc.TargetMemberEnd;

            /// property detail page
            var propObj = new PropObj()
            {
                IsSourceNavigable = assoc.IsSourceNavigable,
                IsTargetNavigable = assoc.IsTargetNavigable,
                SourceMemberEnd   = new MemberEnd()
                {
                    Name             = source.Name,
                    Stereotype       = source.Stereotype,
                    Aggregation      = source.Aggregation,
                    IsUpperUnlimited = source.IsUpperUnlimited,
                    Upper            = source.Upper,
                    Lower            = source.Lower,
                    Visibility       = source.Visibility,
                },
                TargetMemberEnd = new MemberEnd()
                {
                    Name             = target.Name,
                    Stereotype       = target.Stereotype,
                    Aggregation      = target.Aggregation,
                    IsUpperUnlimited = target.IsUpperUnlimited,
                    Upper            = target.Upper,
                    Lower            = target.Lower,
                    Visibility       = target.Visibility,
                },
            };

            Func <object, ICommand> updateCmdProvider = obj => {
                var old = new PropObj()
                {
                    IsSourceNavigable = assoc.IsSourceNavigable,
                    IsTargetNavigable = assoc.IsTargetNavigable,
                    SourceMemberEnd   = new MemberEnd()
                    {
                        Name             = source.Name,
                        Stereotype       = source.Stereotype,
                        Aggregation      = source.Aggregation,
                        IsUpperUnlimited = source.IsUpperUnlimited,
                        Upper            = source.Upper,
                        Lower            = source.Lower,
                        Visibility       = source.Visibility,
                    },
                    TargetMemberEnd = new MemberEnd()
                    {
                        Name             = target.Name,
                        Stereotype       = target.Stereotype,
                        Aggregation      = target.Aggregation,
                        IsUpperUnlimited = target.IsUpperUnlimited,
                        Upper            = target.Upper,
                        Lower            = target.Lower,
                        Visibility       = target.Visibility,
                    },
                };
                return(new DelegatingCommand(
                           () => {
                    assoc.IsSourceNavigable = propObj.IsSourceNavigable;
                    assoc.IsTargetNavigable = propObj.IsTargetNavigable;

                    source.Name = propObj.SourceMemberEnd.Name;
                    source.Stereotype = propObj.SourceMemberEnd.Stereotype;
                    source.Aggregation = propObj.SourceMemberEnd.Aggregation;
                    source.IsUpperUnlimited = propObj.SourceMemberEnd.IsUpperUnlimited;
                    source.Upper = propObj.SourceMemberEnd.Upper;
                    source.Lower = propObj.SourceMemberEnd.Lower;
                    source.Visibility = propObj.SourceMemberEnd.Visibility;

                    target.Name = propObj.TargetMemberEnd.Name;
                    target.Stereotype = propObj.TargetMemberEnd.Stereotype;
                    target.Aggregation = propObj.TargetMemberEnd.Aggregation;
                    target.IsUpperUnlimited = propObj.TargetMemberEnd.IsUpperUnlimited;
                    target.Upper = propObj.TargetMemberEnd.Upper;
                    target.Lower = propObj.TargetMemberEnd.Lower;
                    target.Visibility = propObj.TargetMemberEnd.Visibility;
                },
                           () => {
                    assoc.IsSourceNavigable = old.IsSourceNavigable;
                    assoc.IsTargetNavigable = old.IsTargetNavigable;

                    source.Name = old.SourceMemberEnd.Name;
                    source.Stereotype = old.SourceMemberEnd.Stereotype;
                    source.Aggregation = old.SourceMemberEnd.Aggregation;
                    source.IsUpperUnlimited = old.SourceMemberEnd.IsUpperUnlimited;
                    source.Upper = old.SourceMemberEnd.Upper;
                    source.Lower = old.SourceMemberEnd.Lower;
                    source.Visibility = old.SourceMemberEnd.Visibility;

                    target.Name = old.TargetMemberEnd.Name;
                    target.Stereotype = old.TargetMemberEnd.Stereotype;
                    target.Aggregation = old.TargetMemberEnd.Aggregation;
                    target.IsUpperUnlimited = old.TargetMemberEnd.IsUpperUnlimited;
                    target.Upper = old.TargetMemberEnd.Upper;
                    target.Lower = old.TargetMemberEnd.Lower;
                    target.Visibility = old.TargetMemberEnd.Visibility;
                }
                           ));
            };
            var propPage = new PropertyDetailSettingsPage(propObj, updateCmdProvider);

            detailForm.RegisterPage("モデル", propPage);

            /// line detail page
            var borderPage = new EdgeLineDetailPage(new[] { _owner.Host });

            borderPage.LineColor     = fig.LineColor;
            borderPage.LineWidth     = fig.LineWidth;
            borderPage.LineDashStyle = fig.LineDashStyle;
            borderPage.IsModified    = false;
            detailForm.RegisterPage("線", borderPage);
        }