Registry Set Value


Node Information
Sets value in the selected Hive, select the Hive in the properties window and choose the ValueName, set the value then call 'Set'.
General Information
• This node doesn't have other available options.
Visual
Visual

Ports
Text Type DataType Accepts IsList CustomAcception
Set IN RUN MULTIPLE FALSE FALSE
ValueName IN String MULTIPLE FALSE FALSE
Value IN String MULTIPLE FALSE FALSE

Source
namespace Korduene.KGraph.Nodes.Win32.Registry
{
    [IsNode("Set Value")]
    public class SetValue : Node
    {
        Port run = new Port(PortType.IN, typeof(RUN), AcceptsLinks.MULTIPLE, "Set");
        Port valueName = new Port(PortType.IN, typeof(string), AcceptsLinks.MULTIPLE, "ValueName");
        Port val = new Port(PortType.IN, 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 Value
        {
            set { val.Value = value.ToString(); }
            get { return GetRuntimeValue(val); }
        }
        public SetValue()
        {
            Name = "Registry Set Value";
            NodeType = KGraph.NodeType.Method;
            Hive = RegistryHives.CurrentUser;
            AddPort(run);
            AddPort(valueName);
            AddPort(val);
            Information = "Sets value in the selected Hive, select the Hive in the properties window " +
            "and choose the ValueName, set the value then call 'Set'.";
        }
        public override string Code()
        {
            return "Microsoft.Win32.Registry." + Hive.ToString() + ".SetValue(" + GetValue(valueName) + "," + GetValue(val) + ");";
        }
    }
}