Example #1
0
        /// <summary>
        /// Creates a picoComputer project at the specified path.
        /// </summary>
        /// <param name="path">The path to the project file.</param>
        /// <returns>The created Project.</returns>
        protected Project CreatePicoProject(string path)
        {
            path = Path.GetFullPath(path);
            string dir = Path.GetDirectoryName(path);

            if (!Directory.Exists(dir))
            { Directory.CreateDirectory(dir); }

            if (Path.GetExtension(path).ToLower() != ".mlp")
            { path += ".mlp"; }

            Project p = new Project();
            p.SetPlatformByName("picoComputer");
            p.Path = path;

            // Create and add the Main item.
            var mainItem = p.Platform.ProjectItemFactory.CreateProjectItem(p, "Main");
            p.Items.Add(mainItem);
            p.MainItem = mainItem;

            p.Save(true);

            return p;
        }