Beispiel #1
0
        public static IState Instance(Number amount)
        {
            input = amount;

            MenuList list = new MenuList();

            list.Add(new CheckPaymentInfo());
            list.AddRange(CurrencyPaymentInfo.GetCurrencies());
            list.AddRange(CreditPaymentInfo.GetCredits());
            States.List.Instance(list);
            return(state);
        }
Beispiel #2
0
        private ShapeContextMenu()
        {
            mnuAlignTop        = new ToolStripMenuItem(Strings.MenuAlignTop, Resources.AlignTop, mnuAlignTop_Click);
            mnuAlignLeft       = new ToolStripMenuItem(Strings.MenuAlignLeft, Resources.AlignLeft, mnuAlignLeft_Click);
            mnuAlignBottom     = new ToolStripMenuItem(Strings.MenuAlignBottom, Resources.AlignBottom, mnuAlignBottom_Click);
            mnuAlignRight      = new ToolStripMenuItem(Strings.MenuAlignRight, Resources.AlignRight, mnuAlignRight_Click);
            mnuAlignHorizontal = new ToolStripMenuItem(Strings.MenuAlignHorizontal, Resources.AlignHorizontal, mnuAlignHorizontal_Click);
            mnuAlignVertical   = new ToolStripMenuItem(Strings.MenuAlignVertical, Resources.AlignVertical, mnuAlignVertical_Click);
            mnuAlign           = new ToolStripMenuItem(Strings.MenuAlign, null,
                                                       mnuAlignTop,
                                                       mnuAlignLeft,
                                                       mnuAlignBottom,
                                                       mnuAlignRight,
                                                       new ToolStripSeparator(),
                                                       mnuAlignHorizontal,
                                                       mnuAlignVertical
                                                       );

            mnuSameWidth    = new ToolStripMenuItem(Strings.MenuSameWidth, null, mnuSameWidth_Click);
            mnuSameHeight   = new ToolStripMenuItem(Strings.MenuSameHeight, null, mnuSameHeight_Click);
            mnuSameSize     = new ToolStripMenuItem(Strings.MenuSameSize, null, mnuSameSize_Click);
            mnuMakeSameSize = new ToolStripMenuItem(Strings.MenuMakeSameSize, null, mnuSameWidth,
                                                    mnuSameHeight,
                                                    mnuSameSize
                                                    );

            MenuList.AddRange(GeneralContextMenu.Default.MenuItems);
            MenuList.AddRange(new ToolStripItem[] {
                new ToolStripSeparator(),
                mnuAlign,
                mnuMakeSameSize,
            });

            UpdateTexts();
        }
Beispiel #3
0
        private void InitMenuItems()
        {
            mnuUnidirectional = new ToolStripMenuItem(Strings.GetString("menu_unidirectional"),
                                                      Properties.Resources.Unidirectional, mnuUnidirectional_Click);
            mnuBidirectional = new ToolStripMenuItem(Strings.GetString("menu_bidirectional"),
                                                     Properties.Resources.Bidirectional, mnuBidirectional_Click);
            mnuDirection = new ToolStripMenuItem(Strings.GetString("menu_direction"), null,
                                                 mnuUnidirectional,
                                                 mnuBidirectional
                                                 );

            mnuAssociation = new ToolStripMenuItem(Strings.GetString("menu_association"),
                                                   Properties.Resources.Association, mnuAssociation_Click);
            mnuComposition = new ToolStripMenuItem(Strings.GetString("menu_composition"),
                                                   Properties.Resources.Composition, mnuComposition_Click);
            mnuAggregation = new ToolStripMenuItem(Strings.GetString("menu_aggregation"),
                                                   Properties.Resources.Aggregation, mnuAggregation_Click);
            mnuType = new ToolStripMenuItem(Strings.GetString("menu_type"), null,
                                            mnuAssociation,
                                            mnuComposition,
                                            mnuAggregation
                                            );

            MenuList.AddRange(ConnectionContextMenu.Default.MenuItems);
            MenuList.InsertRange(5, new ToolStripItem[] {
                new ToolStripSeparator(),
                mnuDirection,
                mnuType,
            });
        }
Beispiel #4
0
        private void InitMenuItems()
        {
            mnuEditMembers = new ToolStripMenuItem(Strings.GetString("menu_edit_members"),
                                                   Properties.Resources.EditMembers, mnuEditMembers_Click);
            mnuAutoWidth = new ToolStripMenuItem(Strings.GetString("menu_auto_width"),
                                                 null, mnuAutoWidth_Click);
            mnuAutoHeight = new ToolStripMenuItem(Strings.GetString("menu_auto_height"),
                                                  null, mnuAutoHeight_Click);
            mnuCollapseAllSelected = new ToolStripMenuItem(
                Strings.GetString("menu_collapse_all_selected"),
                null, mnuCollapseAllSelected_Click);
            mnuExpandAllSelected = new ToolStripMenuItem(
                Strings.GetString("menu_expand_all_selected"),
                null, mnuExpandAllSelected_Click);
            mnuSize = new ToolStripMenuItem(Strings.GetString("menu_size"), null,
                                            mnuAutoWidth,
                                            mnuAutoHeight,
                                            new ToolStripSeparator(),
                                            mnuCollapseAllSelected,
                                            mnuExpandAllSelected
                                            );

            MenuList.AddRange(ShapeContextMenu.Default.MenuItems);
            MenuList.AddRange(new ToolStripItem[] {
                mnuSize,
                new ToolStripSeparator(),
                mnuEditMembers,
            });
        }
Beispiel #5
0
        private void InitMenuItems()
        {
            mnuAddNewElement = new ToolStripMenuItem(Strings.MenuNew, Resources.NewElement);
            mnuNewPackage    = new ToolStripMenuItem(Strings.MenuPackage, Resources.Package, mnuNewPackage_Click);
            mnuNewClass      = new ToolStripMenuItem(Strings.MenuClass, Resources.Class, mnuNewClass_Click);
            mnuNewStructure  = new ToolStripMenuItem(Strings.MenuStruct, Resources.Structure, mnuNewStructure_Click);
            mnuNewInterface  = new ToolStripMenuItem(Strings.MenuInterface, Resources.Interface32, mnuNewInterface_Click);
            mnuNewEnum       = new ToolStripMenuItem(Strings.MenuEnum, Resources.Enum, mnuNewEnum_Click);
            mnuNewDelegate   = new ToolStripMenuItem(Strings.MenuDelegate, Resources.Delegate, mnuNewDelegate_Click);
            mnuNewComment    = new ToolStripMenuItem(Strings.MenuComment, Resources.Comment, mnuNewComment_Click);

            mnuAddNewElement.DropDownItems.AddRange(new ToolStripItem[] {
                mnuNewPackage,
                mnuNewClass,
                mnuNewStructure,
                mnuNewInterface,
                mnuNewEnum,
                mnuNewDelegate,
                mnuNewComment
            });

            mnuEditPackage = new ToolStripMenuItem(
                Strings.MenuEditPackage,
                Resources.EditComment, mnuEditPackage_Click);

            MenuList.Add(mnuAddNewElement);
            MenuList.Add(new ToolStripSeparator());
            MenuList.AddRange(ShapeContextMenu.Default.MenuItems);
            MenuList.AddRange(new ToolStripItem[] {
                new ToolStripSeparator(),
                mnuEditPackage,
            });
        }
Beispiel #6
0
        private void InitMenuItems( )
        {
            mnuAutoRouting = new ToolStripMenuItem(Strings.MenuAutoRouting, null, mnuAutoRouting_Click);

            MenuList.AddRange(GeneralContextMenu.Default.MenuItems);
            MenuList.AddRange(new ToolStripItem[] { new ToolStripSeparator( ), mnuAutoRouting });
        }
Beispiel #7
0
        private void InitMenuItems( )
        {
            mnuEditComment = new ToolStripMenuItem(Strings.MenuEditComment, Resources.EditComment, mnuEditComment_Click);

            MenuList.AddRange(ShapeContextMenu.Default.MenuItems);
            MenuList.AddRange(new ToolStripItem[] { new ToolStripSeparator( ), mnuEditComment });
        }
Beispiel #8
0
        private AssociationContextMenu()
        {
            mnuUnidirectional = new ToolStripMenuItem(Strings.MenuUnidirectional, Resources.Unidirectional, mnuUnidirectional_Click);
            mnuBidirectional  = new ToolStripMenuItem(Strings.MenuBidirectional, Resources.Bidirectional, mnuBidirectional_Click);
            mnuDirection      = new ToolStripMenuItem(Strings.MenuDirection, null, mnuUnidirectional, mnuBidirectional);

            mnuAssociation = new ToolStripMenuItem(Strings.MenuAssociation, Resources.Association, mnuAssociation_Click);
            mnuComposition = new ToolStripMenuItem(Strings.MenuComposition, Resources.Composition, mnuComposition_Click);
            mnuAggregation = new ToolStripMenuItem(Strings.MenuAggregation, Resources.Aggregation, mnuAggregation_Click);
            mnuType        = new ToolStripMenuItem(Strings.MenuType, null, mnuAssociation, mnuComposition, mnuAggregation);

            mnuReverse = new ToolStripMenuItem(Strings.MenuReverse, null, mnuReverse_Click);
            mnuEdit    = new ToolStripMenuItem(Strings.MenuEditAssociation, Resources.Property, mnuEdit_Click);

            MenuList.AddRange(ConnectionContextMenu.Default.MenuItems);
            MenuList.InsertRange(7, new ToolStripItem[] {
                mnuDirection,
                mnuType,
                mnuReverse,
                new ToolStripSeparator(),
            });
            MenuList.Add(mnuEdit);

            UpdateTexts();
        }
Beispiel #9
0
        public override void DownArrow()
        {
            MenuList pastPayments = new MenuList();

            pastPayments.AddRange(cr.Document.Payments);
            cr.State = List.Instance(pastPayments, new ProcessSelectedItem(cr.Document.VoidPayment));
        }
Beispiel #10
0
        private StateShapeContextMenu()
        {
            mnuAutoSize   = new ToolStripMenuItem(Strings.MenuAutoSize, null, mnuAutoSize_Click);
            mnuAutoWidth  = new ToolStripMenuItem(Strings.MenuAutoWidth, null, mnuAutoWidth_Click);
            mnuAutoHeight = new ToolStripMenuItem(Strings.MenuAutoHeight, null, mnuAutoHeight_Click);
            mnuSize       = new ToolStripMenuItem(Strings.MenuSize, null,
                                                  mnuAutoSize,
                                                  mnuAutoWidth,
                                                  mnuAutoHeight
                                                  );

            mnuStageStart        = new ToolStripMenuItem(Strings.StageStart, null, mnuStageStart_Click);
            mnuStageIntermediate = new ToolStripMenuItem(Strings.StageIntermediate, null, mnuStageIntermediate_Click);
            mnuStageEnd          = new ToolStripMenuItem(Strings.StageEnd, null, mnuStageEnd_Click);
            mnuStage             = new ToolStripMenuItem(Strings.Stage, null,
                                                         mnuStageStart,
                                                         mnuStageIntermediate,
                                                         mnuStageEnd);

            MenuList.AddRange(ShapeContextMenu.Default.MenuItems);
            MenuList.AddRange(new ToolStripItem[] {
                mnuSize,
                new ToolStripSeparator(),
                mnuStage
            });

            UpdateTexts();
        }
        private void InitMenuItems()
        {
            mnuCut = new ToolStripMenuItem(Strings.MenuCut,
                                           Resources.Cut,
                                           mnuCut_Click);
            mnuCopy = new ToolStripMenuItem(Strings.MenuCopy,
                                            Resources.Copy,
                                            mnuCopy_Click);
            mnuDelete = new ToolStripMenuItem(Strings.MenuDelete,
                                              Resources.Delete,
                                              mnuDelete_Click);
            mnuCopyAsImage = new ToolStripMenuItem(
                Strings.MenuCopyImageToClipboard,
                Resources.CopyAsImage,
                mnuCopyAsImage_Click);
            mnuSaveAsImage = new ToolStripMenuItem(
                Strings.MenuSaveSelectionAsImage,
                Resources.Image,
                mnuSaveAsImage_Click);

            MenuList.AddRange(new ToolStripItem[]
            {
                mnuCut,
                mnuCopy,
                mnuDelete,
                new ToolStripSeparator(),
                mnuCopyAsImage,
                mnuSaveAsImage
            });
        }
Beispiel #12
0
        private void InitMenuItems()
        {
            mnuEditMembers = new ToolStripMenuItem(Strings.MenuEditMembers,
                                                   Resources.EditMembers, mnuEditMembers_Click);
            mnuAutoSize = new ToolStripMenuItem(Strings.MenuAutoSize,
                                                null, mnuAutoSize_Click);
            mnuAutoWidth = new ToolStripMenuItem(Strings.MenuAutoWidth,
                                                 null, mnuAutoWidth_Click);
            mnuAutoHeight = new ToolStripMenuItem(Strings.MenuAutoHeight,
                                                  null, mnuAutoHeight_Click);
            mnuCollapseAllSelected = new ToolStripMenuItem(
                Strings.MenuCollapseAllSelected,
                null, mnuCollapseAllSelected_Click);
            mnuExpandAllSelected = new ToolStripMenuItem(
                Strings.MenuExpandAllSelected,
                null, mnuExpandAllSelected_Click);
            mnuSize = new ToolStripMenuItem(Strings.MenuSize, null,
                                            mnuAutoSize,
                                            mnuAutoWidth,
                                            mnuAutoHeight,
                                            new ToolStripSeparator(),
                                            mnuCollapseAllSelected,
                                            mnuExpandAllSelected
                                            );

            MenuList.AddRange(ShapeContextMenu.Default.MenuItems);
            MenuList.AddRange(new ToolStripItem[] {
                mnuSize,
                new ToolStripSeparator(),
                mnuEditMembers,
            });
        }
Beispiel #13
0
        private void Refresh(bool rmodule, bool rmenu, bool rmenudtl, bool rrole, bool ruser)
        {
            if (rmodule)
            {
                ModuleList.Clear();
                ModuleList.AddRange(PubMaster.Mod.RoleSql.QueryWcsModuleList());
            }

            if (rmenu)
            {
                MenuList.Clear();
                MenuList.AddRange(PubMaster.Mod.RoleSql.QueryWcsMenuList());
            }

            if (rmenudtl)
            {
                MenuDtlList.Clear();
                MenuDtlList.AddRange(PubMaster.Mod.RoleSql.QueryWcsMenuDtlList());
            }

            if (rrole)
            {
                RoleList.Clear();
                RoleList.AddRange(PubMaster.Mod.RoleSql.QueryWcsRoleList());
            }

            if (ruser)
            {
                UserList.Clear();
                UserList.AddRange(PubMaster.Mod.RoleSql.QueryWcsUserList());
            }
        }
        private void InitMenuItems()
        {
            mnuEditComment = new ToolStripMenuItem(
                Strings.GetString("menu_edit_comment"),
                Properties.Resources.EditComment, mnuEditComment_Click);

            MenuList.AddRange(ShapeContextMenu.Default.MenuItems);
            MenuList.AddRange(new ToolStripItem[] {
                new ToolStripSeparator(),
                mnuEditComment,
            });
        }
Beispiel #15
0
        public override void Enter()
        {
            MenuList pastPayments = new MenuList();

            pastPayments.AddRange(cr.Document.Payments);

            ProcessSelectedItem psi = new ProcessSelectedItem(cr.Document.VoidPayment);

            pastPayments.MoveLast();
            pastPayments.MovePrevious();
            cr.State = List.Instance(pastPayments, psi);
        }
Beispiel #16
0
        private ConnectionContextMenu()
        {
            mnuAutoRouting = new ToolStripMenuItem(Strings.MenuAutoRouting, null, mnuAutoRouting_Click);

            MenuList.AddRange(GeneralContextMenu.Default.MenuItems);
            MenuList.AddRange(new ToolStripItem[]
            {
                new ToolStripSeparator(),
                mnuAutoRouting,
            });

            UpdateTexts();
        }
        private void InitMenuItems()
        {
            mnuAutoRouting = new ToolStripMenuItem(Strings.GetString("menu_auto_routing"),
                                                   null, mnuAutoRouting_Click);
            mnuProperties = new ToolStripMenuItem(Strings.GetString("menu_properties"),
                                                  Properties.Resources.Property, mnuProperties_Click);

            MenuList.AddRange(GeneralContextMenu.Default.MenuItems);
            MenuList.AddRange(new ToolStripItem[] {
                new ToolStripSeparator(),
                mnuAutoRouting,
                mnuProperties,
            });
        }
Beispiel #18
0
        private void InitMenuItems()
        {
            mnuAddNewElement = new ToolStripMenuItem(Strings.MenuNew, Resources.NewElement);

            mnuNewActor               = new ToolStripMenuItem(Strings.AddNewActor, Resources.Actor, (s, e) => Diagram?.CreateShape(EntityType.Actor));
            mnuNewUseCase             = new ToolStripMenuItem(Strings.AddNewUseCase, Resources.UseCase, (s, e) => Diagram?.CreateShape(EntityType.UseCase));
            mnuNewSystemBoundary      = new ToolStripMenuItem(Strings.AddNewSystemBoundary, Resources.SystemBoundary, (o, e) => Diagram?.CreateShape(EntityType.SystemBoundary));
            mnuNewComment             = new ToolStripMenuItem(Strings.MenuComment, Resources.Comment, (s, e) => Diagram?.CreateShape(EntityType.Comment));
            mnuNewAssociation         = new ToolStripMenuItem(Strings.MenuAssociation, Resources.Association, (s, e) => Diagram?.CreateConnection(RelationshipType.UseCaseAssociation));
            mnuNewIncludes            = new ToolStripMenuItem(Strings.AddNewIncludes, Resources.Includes, (s, e) => Diagram?.CreateConnection(RelationshipType.Inclusion));
            mnuNewExtends             = new ToolStripMenuItem(Strings.AddNewExtends, Resources.Extends, (s, e) => Diagram?.CreateConnection(RelationshipType.Extension));
            mnuNewGeneralization      = new ToolStripMenuItem(Strings.MenuGeneralization, Resources.Generalization, (s, e) => Diagram?.CreateConnection(RelationshipType.UseCaseGeneralization));
            mnuNewCommentRelationship = new ToolStripMenuItem(Strings.MenuCommentRelationship, Resources.CommentRel, (s, e) => Diagram?.CreateConnection(RelationshipType.Comment));

            mnuUndo = new ToolStripMenuItem(Strings.MenuUndo, Resources.Undo, (s, e) => throw new NotImplementedException("Undo is not yet implemented"));
            mnuRedo = new ToolStripMenuItem(Strings.MenuRedo, Resources.Redo, (s, e) => throw new NotImplementedException("Redo is not yet implemented"));

            mnuPaste       = new ToolStripMenuItem(Strings.MenuPaste, Resources.Paste, (s, e) => Diagram?.Paste());
            mnuSaveAsImage = new ToolStripMenuItem(Strings.MenuSaveAsImage, Resources.Image, (s, e) => Diagram?.SaveAsImage());
            mnuSelectAll   = new ToolStripMenuItem(Strings.MenuSelectAll, null, (s, e) => Diagram?.SelectAll());

            mnuAddNewElement.DropDownItems.AddRange(new ToolStripItem[] {
                mnuNewActor,
                mnuNewUseCase,
                mnuNewSystemBoundary,
                mnuNewComment,
                new ToolStripSeparator(),
                mnuNewAssociation,
                mnuNewIncludes,
                mnuNewExtends,
                mnuNewGeneralization,
                mnuNewCommentRelationship
            });

            MenuList.AddRange(new ToolStripItem[] {
                mnuAddNewElement,
                new ToolStripSeparator(),
                mnuUndo,
                mnuRedo,
                new ToolStripSeparator(),
                mnuPaste,
                mnuSaveAsImage,
                mnuSelectAll
            });
        }
Beispiel #19
0
        private void InitMenuItems()
        {
            mnuAlignTop = new ToolStripMenuItem(Strings.GetString("menu_align_top"),
                                                Properties.Resources.AlignTop, mnuAlignTop_Click);
            mnuAlignLeft = new ToolStripMenuItem(Strings.GetString("menu_align_left"),
                                                 Properties.Resources.AlignLeft, mnuAlignLeft_Click);
            mnuAlignBottom = new ToolStripMenuItem(Strings.GetString("menu_align_bottom"),
                                                   Properties.Resources.AlignBottom, mnuAlignBottom_Click);
            mnuAlignRight = new ToolStripMenuItem(Strings.GetString("menu_align_right"),
                                                  Properties.Resources.AlignRight, mnuAlignRight_Click);
            mnuAlignHorizontal = new ToolStripMenuItem(Strings.GetString("menu_align_horizontal"),
                                                       Properties.Resources.AlignHorizontal, mnuAlignHorizontal_Click);
            mnuAlignVertical = new ToolStripMenuItem(Strings.GetString("menu_align_vertical"),
                                                     Properties.Resources.AlignVertical, mnuAlignVertical_Click);
            mnuAlign = new ToolStripMenuItem(Strings.GetString("menu_align"), null,
                                             mnuAlignTop,
                                             mnuAlignLeft,
                                             mnuAlignBottom,
                                             mnuAlignRight,
                                             new ToolStripSeparator(),
                                             mnuAlignHorizontal,
                                             mnuAlignVertical
                                             );

            mnuSameWidth = new ToolStripMenuItem(Strings.GetString("menu_same_width"),
                                                 null, mnuSameWidth_Click);
            mnuSameHeight = new ToolStripMenuItem(Strings.GetString("menu_same_height"),
                                                  null, mnuSameHeight_Click);
            mnuSameSize = new ToolStripMenuItem(Strings.GetString("menu_same_size"),
                                                null, mnuSameSize_Click);
            mnuMakeSameSize = new ToolStripMenuItem(Strings.GetString("menu_make_same_size"), null,
                                                    mnuSameWidth,
                                                    mnuSameHeight,
                                                    mnuSameSize
                                                    );

            MenuList.AddRange(GeneralContextMenu.Default.MenuItems);
            MenuList.AddRange(new ToolStripItem[] {
                new ToolStripSeparator(),
                mnuAlign,
                mnuMakeSameSize,
            });
        }
Beispiel #20
0
        private void InitMenuItems()
        {
            mnuCut = new ToolStripMenuItem(Strings.GetString("menu_cut"),
                                           Properties.Resources.Cut, mnuCut_Click);
            mnuDelete = new ToolStripMenuItem(Strings.GetString("menu_delete"),
                                              Properties.Resources.Delete, mnuDelete_Click);
            mnuCopyAsImage = new ToolStripMenuItem(
                Strings.GetString("menu_copy_image_to_clipboard"),
                Properties.Resources.CopyAsImage, mnuCopyAsImage_Click);
            mnuSaveAsImage = new ToolStripMenuItem(
                Strings.GetString("menu_save_selection_as_image"),
                Properties.Resources.Image, mnuSaveAsImage_Click);

            MenuList.AddRange(new ToolStripItem[] {
                mnuCut,
                mnuDelete,
                new ToolStripSeparator(),
                mnuCopyAsImage,
                mnuSaveAsImage,
            });
        }
Beispiel #21
0
        private void InitMenuItems( )
        {
            mnuAddNewElement          = new ToolStripMenuItem(Strings.MenuNew, Resources.NewEntity);
            mnuNewClass               = new ToolStripMenuItem(Strings.MenuClass, Resources.Class, mnuNewClass_Click);
            mnuNewStructure           = new ToolStripMenuItem(Strings.MenuStruct, Resources.Structure, mnuNewStructure_Click);
            mnuNewInterface           = new ToolStripMenuItem(Strings.MenuInterface, Resources.Interface32, mnuNewInterface_Click);
            mnuNewEnum                = new ToolStripMenuItem(Strings.MenuEnum, Resources.Enum, mnuNewEnum_Click);
            mnuNewDelegate            = new ToolStripMenuItem(Strings.MenuDelegate, Resources.Delegate, mnuNewDelegate_Click);
            mnuNewComment             = new ToolStripMenuItem(Strings.MenuComment, Resources.Comment, mnuNewComment_Click);
            mnuNewAssociation         = new ToolStripMenuItem(Strings.MenuAssociation, Resources.Association, mnuNewAssociation_Click);
            mnuNewComposition         = new ToolStripMenuItem(Strings.MenuComposition, Resources.Composition, mnuNewComposition_Click);
            mnuNewAggregation         = new ToolStripMenuItem(Strings.MenuAggregation, Resources.Aggregation, mnuNewAggregation_Click);
            mnuNewGeneralization      = new ToolStripMenuItem(Strings.MenuGeneralization, Resources.Generalization, mnuNewGeneralization_Click);
            mnuNewRealization         = new ToolStripMenuItem(Strings.MenuRealization, Resources.Realization, mnuNewRealization_Click);
            mnuNewDependency          = new ToolStripMenuItem(Strings.MenuDependency, Resources.Dependency, mnuNewDependency_Click);
            mnuNewNesting             = new ToolStripMenuItem(Strings.MenuNesting, Resources.Nesting, mnuNewNesting_Click);
            mnuNewCommentRelationship = new ToolStripMenuItem(Strings.MenuCommentRelationship, Resources.CommentRel, mnuNewCommentRelationship_Click);

            mnuMembersFormat                      = new ToolStripMenuItem(Strings.MenuMembersFormat, null);
            mnuShowType                           = new ToolStripMenuItem(Strings.MenuType, null);
            mnuShowType.CheckedChanged           += mnuShowType_CheckedChanged;
            mnuShowType.CheckOnClick              = true;
            mnuShowParameters                     = new ToolStripMenuItem(Strings.MenuParameters, null);
            mnuShowParameters.CheckedChanged     += mnuShowParameters_CheckedChanged;
            mnuShowParameters.CheckOnClick        = true;
            mnuShowParameterNames                 = new ToolStripMenuItem(Strings.MenuParameterNames, null);
            mnuShowParameterNames.CheckedChanged += mnuShowParameterNames_CheckedChanged;
            mnuShowParameterNames.CheckOnClick    = true;
            mnuShowInitialValue                   = new ToolStripMenuItem(Strings.MenuInitialValue, null);
            mnuShowInitialValue.CheckedChanged   += mnuShowInitialValue_CheckedChanged;
            mnuShowInitialValue.CheckOnClick      = true;

            mnuPaste       = new ToolStripMenuItem(Strings.MenuPaste, Resources.Paste, mnuPaste_Click);
            mnuSaveAsImage = new ToolStripMenuItem(Strings.MenuSaveAsImage, Resources.Image, mnuSaveAsImage_Click);
            mnuSelectAll   = new ToolStripMenuItem(Strings.MenuSelectAll, null, mnuSelectAll_Click);

            mnuAddNewElement.DropDownItems.AddRange(new ToolStripItem[] { mnuNewClass, mnuNewStructure, mnuNewInterface, mnuNewEnum, mnuNewDelegate, mnuNewComment, new ToolStripSeparator( ), mnuNewAssociation, mnuNewComposition, mnuNewAggregation, mnuNewGeneralization, mnuNewRealization, mnuNewDependency, mnuNewNesting, mnuNewCommentRelationship });
            mnuMembersFormat.DropDownItems.AddRange(new ToolStripItem[] { mnuShowType, mnuShowParameters, mnuShowParameterNames, mnuShowInitialValue });
            MenuList.AddRange(new ToolStripItem[] { mnuAddNewElement, mnuMembersFormat, new ToolStripSeparator( ), mnuPaste, mnuSaveAsImage, mnuSelectAll });
        }
Beispiel #22
0
        public override async Task <MenuList> GetModuleMenuListAsync(ModuleAction.RenderModeEnum renderMode, ModuleAction.ActionLocationEnum location)
        {
            MenuList baseMenuList = await base.GetModuleMenuListAsync(renderMode, location);

            MenuList menuList = new MenuList();

            PageEditModule modEdit = new PageEditModule();

            menuList.New(await modEdit.GetAction_EditAsync(null), location);
            menuList.New(await GetAction_ExportPageAsync(null), location);
            menuList.New(await modEdit.GetAction_RemoveAsync(null), location);

            menuList.New(GetAction_SwitchToView(), location);
            menuList.New(GetAction_SwitchToEdit(), location);

            menuList.New(await GetAction_W3CValidationAsync(), location);
            menuList.New(await GetAction_RestartSite(), location);
            menuList.New(GetAction_ClearJsCssCache(), location);

            menuList.AddRange(baseMenuList);
            return(menuList);
        }
Beispiel #23
0
        private void MergeBasicMenus(MenuList menu, string pathPrefix = null)
        {
            if (string.IsNullOrWhiteSpace(pathPrefix))
            {
                pathPrefix = "";
            }
            else if (!pathPrefix.EndsWith("/", StringComparison.OrdinalIgnoreCase))
            {
                pathPrefix += "/";
            }

            foreach (var m in menu)
            {
                if (BasicMenus.TryGetValue(pathPrefix + m.path, out MenuItem bm))
                {
                    m.data.menu.title = bm.data.menu.title;
                    m.data.menu.icon  = bm.data.menu.icon;
                    m.data.menu.order = bm.data.menu.order;
                }

                if (!m.ForceAdd)
                {
                    // Adding menu items, which don't have Controller
                    var list = BasicMenus.Where(b => b.Key.StartsWith(pathPrefix + m.path) && b.Value.ForceAdd).Select(b => b.Value).ToList();
                    if (list.Count > 0)
                    {
                        m.children.AddRange(list);
                    }
                }

                MergeBasicMenus(m.children, pathPrefix + m.path);

                m.children = new MenuList(m.children.OrderBy(c => c.data.menu.order).ToArray());
            }

            if (string.IsNullOrWhiteSpace(pathPrefix))
            {
                // Adding root menu items, which don't have Controller
                var list = BasicMenus.Where(b => !menu.Any(m => b.Key.StartsWith(m.path))).Select(b => b.Value).ToList();
                if (list.Count > 0)
                {
                    menu.AddRange(list);
                    menu.Sort((mi1, mi2) =>
                    {
                        if (mi1?.data?.menu?.order == null && mi2?.data?.menu?.order == null)
                        {
                            return(0);
                        }
                        else if (mi1?.data?.menu?.order == null)
                        {
                            return(-1);
                        }
                        else if (mi2?.data?.menu?.order == null)
                        {
                            return(1);
                        }
                        else
                        {
                            return(mi1.data.menu.order.GetValueOrDefault().CompareTo(mi2.data.menu.order.GetValueOrDefault()));
                        }
                    });
                }
            }
        }