private void CreateNewPackage()
        {
            string nameBase = "Package";
            string name     = nameBase;
            string path     = null;
            int    i        = 0;

            while (true)
            {
                path = BuilderPackage.PackagesDir + name + ".json";
                if (!File.Exists(path))
                {
                    break;
                }

                name = nameBase + (++i).ToString();
            }

            var package = new BuilderPackage();

            package.name = name;
            package.InitializeNew();
            var obj = new JObject();

            package.ToJson(obj);
            File.WriteAllText(path, obj.ToString(Newtonsoft.Json.Formatting.Indented), Encoding.UTF8);

            this._currentPackageName  = name;
            this._currentPackage      = package;
            this._currentPackageDirty = false;
        }
        private BuilderPackage LoadPackage(string name)
        {
            var config = new BuilderPackage();

            string path = BuilderPackage.PackagesDir + name + ".json";

            config.name = name;
            if (File.Exists(path))
            {
                config.FromJson(JObject.Parse(File.ReadAllText(path)));
            }
            else
            {
                config.InitializeNew();
            }

            return(config);
        }