Ejemplo n.º 1
0
        public override ContextMenuStrip GetContextMenu(ItemContextMenuRequestEventArgs requestEventArgs)
        {
            ContextMenuStrip menu = null;

            if (requestEventArgs.Column != null)
            {
                switch ((ColumnId)requestEventArgs.SubItemId)
                {
                case ColumnId.Graph:
                    var ncid = ListBox.GetNextVisibleColumnIndex(requestEventArgs.ColumnIndex);
                    if (ncid >= 0 && ncid < ListBox.Columns.Count)
                    {
                        var column = ListBox.Columns[ncid];
                        if (IsAlignToGraphEnabled(column))
                        {
                            return(GetContextMenu(new ItemContextMenuRequestEventArgs(
                                                      requestEventArgs.Item, column, ncid,
                                                      requestEventArgs.X, requestEventArgs.Y)));
                        }
                    }
                    break;

                case ColumnId.Name:
                case ColumnId.Subject:
                    menu = PointerBounds.GetContextMenu(_drawnPointers, requestEventArgs.X, requestEventArgs.Y);
                    break;
                }
            }
            if (menu == null)
            {
                menu = new RevisionMenu(DataContext);
            }
            Utility.MarkDropDownForAutoDispose(menu);
            return(menu);
        }
Ejemplo n.º 2
0
        /// <summary>Gets the context menu.</summary>
        /// <param name="requestEventArgs">Request parameters.</param>
        /// <returns>Context menu for specified location.</returns>
        public override ContextMenuStrip GetContextMenu(ItemContextMenuRequestEventArgs requestEventArgs)
        {
            ContextMenuStrip menu = null;

            switch ((ColumnId)requestEventArgs.SubItemId)
            {
            case ColumnId.Subject:
                menu = PointerBounds.GetContextMenu(_drawnPointers, requestEventArgs.X, requestEventArgs.Y);
                break;
            }
            if (menu == null)
            {
                menu = new ReflogRecordMenu(DataContext);
            }
            Utility.MarkDropDownForAutoDispose(menu);
            return(menu);
        }