Interface IShowHidable
IShowHidable is used to show and hide elements, such as a context menus, tooltips, or text editors.
Namespace: Northwoods.Go
Assembly: Northwoods.GoDiagram.WinForms.dll
Syntax
public interface IShowHidable
Methods
Hide(Diagram, Tool)
Gets or sets the function to call when an IShowHidable is to be hidden.
Declaration
void Hide(Diagram d, Tool t)
Parameters
Type | Name | Description |
---|---|---|
Diagram | d | |
Tool | t |
Remarks
The function should "hide" the IShowHidable, either by removing any traces of it or otherwise returning the page state to one where the IShowHidable content is no longer considered active.
Setting this is not strictly necessary, if no action is to be taken when hiding the IShowHidable.
If this is called by:
- HideContextMenu(), the second argument is the ContextMenuTool.
- HideToolTip(), the second argument is the ToolManager.
- DoDeactivate(), the second argument is the TextEditingTool.
Show(GraphObject, Diagram, Tool)
Gets or sets the function to call when an IShowHidable is to be shown, such as when used as the ContextMenu or ToolTip or TextEditor.
Declaration
void Show(GraphObject g, Diagram d, Tool t)
Parameters
Type | Name | Description |
---|---|---|
GraphObject | g | |
Diagram | d | |
Tool | t |
Remarks
If this is called by:
- ShowContextMenu(IShowHidable, GraphObject), the first argument is the GraphObject for which the context menu is being shown, or null for the diagram background.
- ShowToolTip(IShowHidable, GraphObject), the first argument is the GraphObject for which the tooltip is being shown, or null for the diagram background.
- DoActivate(), the first argument is the TextBlock for which the text editor is being shown.
If you need access to any bound data for the first argument, if it is non-null, you can get it via:
obj.Part.Data
and then you can look at any of the properties you have put on that data.
When used as a context menu, typically shown elements, such as buttons, should call
diagram.CurrentTool.StopTool();
when their action is completed.