コード例 #1
0
 /// <summary>
 /// Display MRU item containers
 /// </summary>
 /// <param name="containers">MRU containers to display</param>
 public override void ShowMRUItems(List <MRUItemsContainer> containers)
 {
     if (ItemViews != null)
     {
         ItemViews.Clear();
     }
     ItemViews    = new List <IMRUItemView>();
     menuContents = new List <ToolStripItem>();
     containers.ForEach(container =>
     {
         MRUContainerToolStripSeparator separator = new MRUContainerToolStripSeparator();
         separator.Text = container.ContainerCaption;
         separator.SetTextPresentation(this.Font, new SolidBrush(Color.Gray));
         menuContents.Add(separator);
         container.Items.ToList().ForEach(item =>
         {
             var mruItemMenu = new MRUItemMenu();
             mruItemMenu.Initialize(item, localization.ItemLocalization);
             ItemViews.Add(mruItemMenu);
             menuContents.Add(mruItemMenu);
         });
     });
     if (containers.Count() > 0)
     {
         menuContents.Add(new ToolStripSeparator());
         menuContents.Add(CreateClearAllMenu());
     }
     AttachMenuItems();
 }
コード例 #2
0
 /// <summary>
 /// Display MRU item containers
 /// </summary>
 /// <param name="containers">MRU containers to display</param>
 public override void ShowMRUItems(List <MRUItemsContainer> containers)
 {
     if (ItemViews != null)
     {
         ItemViews.Clear();
     }
     ItemViews = new List <IMRUItemView>();
     containers.ForEach(container =>
     {
         container.Items.ToList().ForEach(item =>
         {
             var mruItemMenu = new MRUItemMenu();
             mruItemMenu.Initialize(item, localization.ItemLocalization);
             ItemViews.Add(mruItemMenu);
         });
     });
     AttachMenuItems();
 }