using System.Windows.Forms;
using Core.Common.Gui.ContextMenu;
namespace Core.Common.Gui.TestUtils.ContextMenu
{
///
/// This class can be used for easily testing the custom items which are added to a context menu.
///
public class CustomItemsOnlyContextMenuBuilder : IContextMenuBuilder
{
///
/// The context menu which is build.
///
private readonly ContextMenuStrip contextMenu = new ContextMenuStrip();
///
/// Does nothing.
///
/// The .
public IContextMenuBuilder AddDeleteItem()
{
return this;
}
///
/// Does nothing.
///
/// The .
public IContextMenuBuilder AddExpandAllItem()
{
return this;
}
///
/// Does nothing.
///
/// The .
public IContextMenuBuilder AddCollapseAllItem()
{
return this;
}
///
/// Does nothing.
///
/// The .
public IContextMenuBuilder AddOpenItem()
{
return this;
}
///
/// Does nothing.
///
/// The .
public IContextMenuBuilder AddExportItem()
{
return this;
}
///
/// Does nothing.
///
/// The .
public IContextMenuBuilder AddImportItem()
{
return this;
}
///
/// Does nothing.
///
/// The .
public IContextMenuBuilder AddPropertiesItem()
{
return this;
}
///
/// Adds a toolstrip separator.
///
/// The .
public IContextMenuBuilder AddSeparator()
{
contextMenu.Items.Add(new ToolStripSeparator());
return this;
}
///
/// Adds a custom item to the .
///
/// The custom to add to the .
/// The .
public IContextMenuBuilder AddCustomItem(StrictContextMenuItem item)
{
contextMenu.Items.Add(item);
return this;
}
///
/// Obtain the , which has been constructed by using .
///
/// The constructed .
public ContextMenuStrip Build()
{
return contextMenu;
}
}
}