當前位置: 首頁>>代碼示例>>C#>>正文


C# Menu.AddSeparator方法代碼示例

本文整理匯總了C#中System.Windows.Forms.Menu.AddSeparator方法的典型用法代碼示例。如果您正苦於以下問題:C# Menu.AddSeparator方法的具體用法?C# Menu.AddSeparator怎麽用?C# Menu.AddSeparator使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Windows.Forms.Menu的用法示例。


在下文中一共展示了Menu.AddSeparator方法的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.AddSeparator方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。