Icon


Node Information
Gets Icon from the specified resource.
General Information
• This node doesn't have other available options.
Visual
Visual

Ports
Text Type DataType Accepts IsList CustomAcception
Icon OUT Icon MULTIPLE FALSE FALSE
Width OUT Int32 MULTIPLE FALSE FALSE
Height OUT Int32 MULTIPLE FALSE FALSE

Source
namespace Korduene.KGraph.Nodes.Objects
{
    [IsNode("Icon")]
    public class IconObject : Node
    {
        Port img = new Port(PortType.OUT, typeof(System.Drawing.Icon), AcceptsLinks.MULTIPLE, "Icon");
        Port width = new Port(PortType.OUT, typeof(int), AcceptsLinks.MULTIPLE, "Width");
        Port height = new Port(PortType.OUT, typeof(int), AcceptsLinks.MULTIPLE, "Height");
        [System.ComponentModel.TypeConverter(typeof(IconsResourcesToList))]
        public string Icon
        {
            set { img.Value = value; }
            get { return img.Value; }
        }
        public IconObject()
        {
            NodeType = KGraph.NodeType.Variable;
            Name = "Icon";
            ReturnType = typeof(System.Drawing.Icon);
            Icon = "(None)";
            AddPort(img);
            AddPort(width);
            AddPort(height);
            Information = "Gets Icon from the specified resource.";
        }
        public override string Code()
        {
            width.Instructions = this.ID + ".HorizontalResolution";
            height.Instructions = this.ID + ".VerticalResolution";
            return " ResMan.GetIcon(" + q + Icon + q + ")";
        }
    }
}