Registry Get Value


Node Information
Gets value from the selected Hive, select the Hive in the properties window and choose the ValueName, choose a default value so if the value couldn't be retrieved the default value will be returned instead.
General Information
• This node doesn't have other available options.
Visual
Visual

Ports
Text Type DataType Accepts IsList CustomAcception
ValueName IN String MULTIPLE FALSE FALSE
DefaultValue IN String MULTIPLE FALSE FALSE
Value OUT String MULTIPLE FALSE FALSE

Source
namespace Korduene.KGraph.Nodes.Win32.Registry
{
    [IsNode("Get Value")]
    public class GetValue : Node
    {
        Port valueName = new Port(PortType.IN, typeof(string), AcceptsLinks.MULTIPLE, "ValueName");
        Port defaultval = new Port(PortType.IN, typeof(string), AcceptsLinks.MULTIPLE, "DefaultValue");
        Port val = new Port(PortType.OUT, typeof(string), AcceptsLinks.MULTIPLE, "Value");
        public RegistryHives Hive { set { Settings[0] = value.ToString(); } get { return (RegistryHives)Enum.Parse(typeof(RegistryHives), Settings[0]); } }
        public string ValueName
        {
            set { valueName.Value = value.ToString(); }
            get { return GetRuntimeValue(valueName); }
        }
        public string DefaultValue
        {
            set { defaultval.Value = value.ToString(); }
            get { return GetRuntimeValue(defaultval); }
        }
        public GetValue()
        {
            Name = "Registry Get Value";
            NodeType = KGraph.NodeType.Function;
            ReturnType = typeof(string);
            Hive = RegistryHives.CurrentUser;
            AddPort(valueName);
            AddPort(defaultval);
            AddPort(val);
            Information = "Gets value from the selected Hive, select the Hive in the properties window " +
                    "and choose the ValueName, choose a default value so if the value couldn't be retrieved the default value will be returned instead.";
        }
        public override string Code()
        {
            return " return Microsoft.Win32.Registry." + Hive.ToString() + ".GetValue(" + GetValue(valueName) + "," + GetValue(defaultval) + ").ToString();";
        }
    }
}