GoDigram for .NET Framework and .NET Core
Northwoods.Go Namespace / GoIconicNode Class / CreateIcon Method / CreateIcon(ResourceManager,String) Method
Provides the ResourceManager holding an Image resource named by iconname. If this parameter is null, GoImage.DefaultResourceManager is used instead.

The name of the Image resource in the ResourceManager given by res, or else a file name if no resource manager can be used (i.e., when both res is null and GoImage.DefaultResourceManager is null).

If the value is an empty string, the Image will be blank; you can set Image.GoImage.Name to show or change the image displayed by the GoImage that is the Image.

If the value is null, the Icon is not a GoImage but a GoDrawing; you can then set the Figure to change the shape shown as the icon.

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
    Provides the ResourceManager holding an Image resource named by iconname. If this parameter is null, GoImage.DefaultResourceManager is used instead.
    iconname

    The name of the Image resource in the ResourceManager given by res, or else a file name if no resource manager can be used (i.e., when both res is null and GoImage.DefaultResourceManager is null).

    If the value is an empty string, the Image will be blank; you can set Image.GoImage.Name to show or change the image displayed by the GoImage that is the Image.

    If the value is null, the Icon is not a GoImage but a GoDrawing; you can then set the Figure to change the shape shown as the icon.

    Return Value

    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) {
        GoImage img = new GoImage();
        if (res != null)
          img.ResourceManager = res;
        img.Name = iconname;
        img.Selectable = false;
        img.Resizable = false;
        return img;
      } else {
        GoDrawing rect = new GoDrawing(GoFigure.Rectangle);
        rect.Selectable = false;
        rect.Resizable = false;
        rect.Size = new SizeF(40, 40);
        return rect;
      }
    }
    See Also