GoDigram for .NET Framework and .NET Core
Northwoods.Go Namespace / GoGeneralNode Class / CreateIcon Method / CreateIcon(ResourceManager,String) Method
a null value causes no GoNodeIcon to be allocated, but instead a GoDrawing initialized to look like a rectangle.
Example
In This Topic
    CreateIcon(ResourceManager,String) Method
    In This Topic
    Create and initialize a GoImage or a GoDrawing to act as the node's icon.
    Syntax
    protected virtual GoObject CreateIcon( 
       ResourceManager res,
       string iconname
    )

    Parameters

    res
    iconname
    a null value causes no GoNodeIcon to be allocated, but instead a GoDrawing initialized to look like a rectangle.

    Return Value

    a GoNodeIcon that obeys this node's MinimumIconSize and MaximumIconSize properties
    Example
    If you override this method, you may want the definition to do some of the things that the standard definition does:
    protected virtual GoObject CreateIcon(ResourceManager res, String iconname) {
      if (iconname != null) {
        GoNodeIcon ni = new GoNodeIcon();
        if (res != null)
          ni.ResourceManager = res;
        ni.Name = iconname;
        ni.MinimumIconSize = new SizeF(20, 20);
        ni.MaximumIconSize = new SizeF(1000, 2000);
        ni.Size = ni.MinimumIconSize;
        return ni;
      } else {
        GoDrawing rect = new GoDrawing(GoFigure.Rectangle);
        rect.Selectable = false;
        rect.Resizable = false;
        rect.Size = new SizeF(20, 20);
        return rect;
      }
    }
    See Also