Ejemplo n.º 1
0
        protected override ContextMenuStrip GetMultiselectContextMenu(ItemsContextMenuRequestEventArgs requestEventArgs)
        {
            if (requestEventArgs.Items.Count != 2)
            {
                return(null);
            }
            var revisions = new List <Revision>(requestEventArgs.Items.Count);

            foreach (var item in requestEventArgs.Items)
            {
                var revItem = item as RevisionListItem;
                if (revItem != null)
                {
                    revisions.Add(revItem.DataContext);
                }
            }
            if (revisions.Count == 2)
            {
                var menu = new RevisionsMenu(revisions);
                Utility.MarkDropDownForAutoDispose(menu);
                return(menu);
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 2
0
 protected override ContextMenuStrip GetMultiselectContextMenu(ItemsContextMenuRequestEventArgs requestEventArgs)
 {
     if(requestEventArgs.Items.Count != 2) return null;
     var revisions = new List<Revision>(requestEventArgs.Items.Count);
     foreach(var item in requestEventArgs.Items)
     {
         var revItem = item as RevisionListItem;
         if(revItem != null)
         {
             revisions.Add(revItem.DataContext);
         }
     }
     if(revisions.Count == 2)
     {
         var menu = new RevisionsMenu(revisions);
         Utility.MarkDropDownForAutoDispose(menu);
         return menu;
     }
     else
     {
         return null;
     }
 }