SpecialFolder Path


Node Information
Gets the path of the specified special folder on the current machine.
General Information
• This node doesn't have other available options.
Visual
Visual

Ports
Text Type DataType Accepts IsList CustomAcception
FolderPath OUT String MULTIPLE FALSE FALSE

Source
namespace Korduene.KGraph.Nodes.Win32.Information
{
    [IsNode("SpecialFolder Path")]
    public class SpecialFolders : Node
    {
        Port a = new Port(PortType.OUT, typeof(string), AcceptsLinks.MULTIPLE, "FolderPath");
        public SpecialFolder Folder
        {
            set { Settings[0] = value.ToString(); }
            get
            {
                if (string.IsNullOrEmpty(Settings[0])) { return SpecialFolder.Desktop; }
                else { return (SpecialFolder)Enum.Parse(typeof(SpecialFolder), Settings[0]); }
            }
        }
        public SpecialFolders()
        {
            Name = "SpecialFolder Path";
            AddPort(a);
            a.Instructions = "init";
            Information = "Gets the path of the specified special folder on the current machine.";
        }
        public override void UpdateResults()
        {
            if (Folder == SpecialFolder.Temp)
            {
                a.Instructions = "System.IO.Path.GetTempPath()";
            }
            else if (Folder == SpecialFolder.Downloads)
            {
                a.Instructions = "(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + " + "@" + q + @"\Downloads\" + q + ")";
            }
            else
            {
                a.Instructions = "(Environment.GetFolderPath(Environment.SpecialFolder." + Folder.ToString() + ") + " + "@" + q + @"\" + q + ")";
            }
        }
    }
}