GenerateView() public method

Returns a view appropriate for this item based on the object it is inside.
public GenerateView ( IContextMenuProvider provider, object parent, ViewLayoutStack columns, bool standardStyle, bool imageColumn ) : ViewBase
provider IContextMenuProvider Provider of context menu information.
parent object Owning object reference.
columns ViewLayoutStack Containing columns.
standardStyle bool Draw items with standard or alternate style.
imageColumn bool Draw an image background for the item images.
return ViewBase
        internal void GenerateView(IContextMenuProvider provider,
                                   KryptonContextMenuItems items,
                                   object parent,
                                   ViewLayoutStack columns,
                                   bool standardStyle,
                                   bool imageColumn)
        {
            // Create the initial column
            ViewBase column = AddColumn(provider, items, columns, standardStyle, imageColumn);

            // Process each item in the collection in turn
            foreach (KryptonContextMenuItemBase item in this)
            {
                if (item.Visible)
                {
                    // Special handling of separator items
                    if (item is KryptonContextMenuSeparator)
                    {
                        // Cast to correct type
                        KryptonContextMenuSeparator separator = (KryptonContextMenuSeparator)item;

                        // If vertical break....
                        if (!separator.Horizontal)
                        {
                            // Add separator as next column view element
                            columns.Add(separator.GenerateView(provider, this, columns, standardStyle, imageColumn));

                            // Start new column for subsequent child items
                            column = AddColumn(provider, items, columns, standardStyle, imageColumn);
                        }
                        else
                        {
                            // Add separator view into the current column
                            column.Add(separator.GenerateView(provider, this, columns, standardStyle, imageColumn));
                        }
                    }
                    else
                    {
                        // All other items we just ask them for the view to add
                        column.Add(item.GenerateView(provider, this, columns, standardStyle, imageColumn));
                    }
                }
            }
        }