Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented adding folders, saving projects automatically and updated…
… various minor aspects.
- Loading branch information
Showing
12 changed files
with
229 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Drawing; | ||
using MOAI.Management; | ||
using System.IO; | ||
|
||
namespace MOAI.Templates.Files | ||
{ | ||
public class FolderTemplate : BaseTemplate | ||
{ | ||
public override string TemplateName | ||
{ | ||
get { return "Empty Folder"; } | ||
} | ||
|
||
public override string TemplateDescription | ||
{ | ||
get { return "an empty folder for storing files"; } | ||
} | ||
|
||
public override string TemplateExtension | ||
{ | ||
get { return ""; } | ||
} | ||
|
||
public override Bitmap TemplateIcon | ||
{ | ||
get { return null; } | ||
} | ||
|
||
/// <summary> | ||
/// Creates a new empty folder in the specified project, in the specified folder. | ||
/// </summary> | ||
/// <param name="data">The solution creation data, usually derived from the user's input in a NewSolutionForm.</param> | ||
/// <returns>A new solution that can be loaded.</returns> | ||
public override MOAI.Management.File Create(string name, Project project, Folder folder) | ||
{ | ||
MOAI.Management.Folder ff = null; | ||
|
||
// Determine where to place the folder. | ||
if (folder == null) | ||
{ | ||
// Place the folder in the root of the project | ||
ff = new MOAI.Management.Folder(project, project.ProjectInfo.DirectoryName, name); | ||
project.AddFile(ff); | ||
} | ||
else | ||
{ | ||
// Place the folder in the specified folder | ||
ff = new MOAI.Management.Folder(project, project.ProjectInfo.DirectoryName, Path.Combine(folder.FolderInfo.Name, name)); | ||
folder.Add(ff); | ||
} | ||
|
||
// Create the new folder on disk. | ||
if (!Directory.Exists(ff.FolderInfo.FullName)) | ||
Directory.CreateDirectory(ff.FolderInfo.FullName); | ||
|
||
return ff; | ||
} | ||
} | ||
} |
Oops, something went wrong.