public void LoadProject(string projectFilename, IDesignerProject project)
        {
            LoadProjectFile(projectFilename, project);

            string projectFolder = Path.GetDirectoryName(projectFilename).PathSlash(ProjectSerialiserV1.ProjectFilesFolder);

            var apiExtensions = LoadApiExtensionFiles(projectFolder.PathSlash(ProjectSerialiserV1.ApiExtensionFolder));
            var options       = LoadUserOptions(projectFolder.PathSlash(ProjectSerialiserV1.UserOptionFolder));
            var functions     = LoadFunctionFiles(projectFolder.PathSlash(ProjectSerialiserV1.FunctionFilesFolder));
            var rootFolder    = LoadOutputsFile(projectFolder);
            var includedFiles = LoadStaticFilenames(projectFolder.PathSlash(ProjectSerialiserV1.StaticFilesFolder));

            project.ApiExtensions = apiExtensions;
            project.SetUserOptions(options);

            project.Functions.Clear();
            project.Functions.AddRange(functions);

            project.RootOutput = rootFolder;

            project.ClearIncludedFiles();
            project.AddIncludedFiles(includedFiles);

            project.SetupDynamicfilesAndFolders();
        }
        private void ReadUserOptions(XmlNode options, IDesignerProject project)
        {
            var userOptionNodes = options.SelectNodes("Option");

            if (userOptionNodes == null)
            {
                return;
            }

            List <UserOption> userOptions = new List <UserOption>();

            foreach (XmlElement uoNode in userOptionNodes)
            {
                var uo = ReadUserOption(uoNode);
                userOptions.Add(uo);
            }

            ReadUserOptionDetails(userOptions, options.SelectSingleNode("UserOptionDetails"));

            project.SetUserOptions(userOptions);
        }
        private void ReadUserOptions(XmlNode options, IDesignerProject project)
        {
            var userOptionNodes = options.SelectNodes("Option");
            if (userOptionNodes == null) return;

            List<UserOption> userOptions = new List<UserOption>();
            foreach (XmlElement uoNode in userOptionNodes)
            {
                var uo = ReadUserOption(uoNode);
                userOptions.Add(uo);
            }

            ReadUserOptionDetails(userOptions, options.SelectSingleNode("UserOptionDetails"));

            project.SetUserOptions(userOptions);
        }
        public void LoadProject(string projectFilename, IDesignerProject project)
        {
            LoadProjectFile(projectFilename, project);

            string projectFolder = Path.GetDirectoryName(projectFilename).PathSlash(ProjectSerialiserV1.ProjectFilesFolder);

            var apiExtensions = LoadApiExtensionFiles(projectFolder.PathSlash(ProjectSerialiserV1.ApiExtensionFolder));
            var options = LoadUserOptions(projectFolder.PathSlash(ProjectSerialiserV1.UserOptionFolder));
            var functions = LoadFunctionFiles(projectFolder.PathSlash(ProjectSerialiserV1.FunctionFilesFolder));
            var rootFolder = LoadOutputsFile(projectFolder);
            var includedFiles = LoadStaticFilenames(projectFolder.PathSlash(ProjectSerialiserV1.StaticFilesFolder));

            project.ApiExtensions = apiExtensions;
            project.SetUserOptions(options);

            project.Functions.Clear();
            project.Functions.AddRange(functions);

            project.RootOutput = rootFolder;

            project.ClearIncludedFiles();
            project.AddIncludedFiles(includedFiles);

            project.SetupDynamicfilesAndFolders();
        }