当前位置: 首页>>代码示例>>C#>>正文


C# Menu.AddActions方法代码示例

本文整理汇总了C#中System.Windows.Forms.Menu.AddActions方法的典型用法代码示例。如果您正苦于以下问题:C# Menu.AddActions方法的具体用法?C# Menu.AddActions怎么用?C# Menu.AddActions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.Menu的用法示例。


在下文中一共展示了Menu.AddActions方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddBuildSpecificActions

 private void AddBuildSpecificActions(Menu.MenuItemCollection items, bool needsLeadingSeparator)
 {
     var selectedItems = builds.Grid.SelectedRows;
     if (selectedItems.Count > 0)
     {
         if (needsLeadingSeparator)
         {
             items.AddSeparator();
         }
         var row = selectedItems[0].DataRow;
         var buildId = row["ID"];
         var buildName = row["Name"];
         var builtInActions = new[]
         {
             new MenuAction("defaultOpen", "&Open", true,
                         () => SetCurrentBuild(buildId, buildName) ),
         };
         items.AddActions(builtInActions);
         var specificActions = _buildRepository.GetBuildActions(buildId);
         if (specificActions.Count > 0)
         {
             items.AddSeparator();
             items.AddActions(specificActions);
         }
     }
 }
开发者ID:olivierdagenais,项目名称:branchreview,代码行数:26,代码来源:BuildBrowser.cs

示例2: AddTaskSpecificActions

 private void AddTaskSpecificActions(Menu.MenuItemCollection items, bool needsLeadingSeparator)
 {
     var taskId = taskGrid.FindSelectedId();
     if (taskId != null)
     {
         var specificActions = _taskRepository.GetTaskActions(taskId);
         if (specificActions.Count > 0)
         {
             if (needsLeadingSeparator)
             {
                 items.AddSeparator();
             }
             items.AddActions(specificActions);
         }
         if (_sourceRepository != null)
         {
             if (specificActions.Count > 0)
             {
                 items.AddSeparator();
             }
             items.AddActions(
                 new MenuAction("createBranch", "Create branch for task {0}".FormatInvariant(taskId), true,
                     () => CreateBranch(taskId)),
                 new MenuAction("goToBranch", "Go to branch for task {0}".FormatInvariant(taskId), true,
                     () => GoToBranchFor(taskId))
             );
         }
     }
 }
开发者ID:olivierdagenais,项目名称:branchreview,代码行数:29,代码来源:TaskBrowser.cs

示例3: AddShelvesetSpecificActions

 private void AddShelvesetSpecificActions(Menu.MenuItemCollection items, bool needsLeadingSeparator)
 {
     var selectedItems = shelvesetGrid.Grid.SelectedRows;
     if (selectedItems.Count > 0)
     {
         if (needsLeadingSeparator)
         {
             items.AddSeparator();
         }
         var row = selectedItems[0].DataRow;
         var shelvesetId = row["ID"];
         var shelvesetName = (string) row["Name"];
         var builtInActions = new[]
         {
             new MenuAction("defaultInspect", "&Inspect", true,
                            () => SetCurrentShelveset(shelvesetId, shelvesetName) ),
         };
         items.AddActions(builtInActions);
         var specificActions = _shelvesetRepository.GetShelvesetActions(shelvesetId);
         if (specificActions.Count > 0)
         {
             items.AddSeparator();
             items.AddActions(specificActions);
         }
     }
 }
开发者ID:olivierdagenais,项目名称:branchreview,代码行数:26,代码来源:ShelvesetBrowser.cs

示例4: AddBranchSpecificActions

 private void AddBranchSpecificActions(Menu.MenuItemCollection items, bool needsLeadingSeparator)
 {
     var selectedRows = branchGrid.Grid.SelectedRows;
     if (selectedRows.Count > 0)
     {
         if (needsLeadingSeparator)
         {
             items.AddSeparator();
         }
         var row = selectedRows[0].DataRow;
         var branchId = row["ID"];
         var taskId = row["TaskID"];
         var builtInActions = new[]
         {
             new MenuAction("defaultInspect", "&Inspect", true,
                         () => SetCurrentBranch(branchId, taskId) ),
             new MenuAction("defaultOpen", "&Work on this", row["BasePath"] != DBNull.Value,
                         () => StartWorkOnBranch(branchId, taskId) ),
         };
         items.AddActions(builtInActions);
         var specificActions = _sourceRepository.GetBranchActions(branchId);
         if (specificActions.Count > 0)
         {
             items.AddSeparator();
             items.AddActions(specificActions);
         }
     }
 }
开发者ID:olivierdagenais,项目名称:branchreview,代码行数:28,代码来源:BranchBrowser.cs

示例5: AddRevisionSpecificActions

 private void AddRevisionSpecificActions(Menu.MenuItemCollection items, bool needsLeadingSeparator)
 {
     var selectedItems = activityRevisions.Grid.SelectedRows;
     if (selectedItems.Count > 0)
     {
         if (needsLeadingSeparator)
         {
             items.AddSeparator();
         }
         var row = selectedItems[0].DataRow;
         var revisionId = row["ID"];
         var builtInActions = new[]
         {
             new MenuAction("defaultOpen", "&Open", true,
                         () => SetCurrentRevision(revisionId) ),
         };
         items.AddActions(builtInActions);
         // TODO: Should there be specific actions per revision?  Maybe an external view, like TFS has...
     }
 }
开发者ID:olivierdagenais,项目名称:branchreview,代码行数:20,代码来源:RevisionBrowser.cs


注:本文中的System.Windows.Forms.Menu.AddActions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。