|
|
@ -29,13 +29,13 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs |
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
public class NewProjectDialog : BaseSharpDevelopForm |
|
|
|
public class NewProjectDialog : BaseSharpDevelopForm |
|
|
|
{ |
|
|
|
{ |
|
|
|
Container components = new System.ComponentModel.Container(); |
|
|
|
protected Container components = new System.ComponentModel.Container(); |
|
|
|
|
|
|
|
|
|
|
|
ArrayList alltemplates = new ArrayList(); |
|
|
|
protected ArrayList alltemplates = new ArrayList(); |
|
|
|
ArrayList categories = new ArrayList(); |
|
|
|
protected ArrayList categories = new ArrayList(); |
|
|
|
Hashtable icons = new Hashtable(); |
|
|
|
protected Hashtable icons = new Hashtable(); |
|
|
|
|
|
|
|
|
|
|
|
bool openCombine; |
|
|
|
protected bool openCombine; |
|
|
|
|
|
|
|
|
|
|
|
public NewProjectDialog(bool openCombine) |
|
|
|
public NewProjectDialog(bool openCombine) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -47,12 +47,16 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs |
|
|
|
InitializeView(); |
|
|
|
InitializeView(); |
|
|
|
|
|
|
|
|
|
|
|
((TreeView)ControlDictionary["categoryTreeView"]).Select(); |
|
|
|
((TreeView)ControlDictionary["categoryTreeView"]).Select(); |
|
|
|
((TextBox)ControlDictionary["locationTextBox"]).Text = PropertyService.Get("ICSharpCode.SharpDevelop.Gui.NewProjectDialog.DefaultPath", Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "SharpDevelop Projects")).ToString(); |
|
|
|
((TextBox)ControlDictionary["locationTextBox"]).Text = PropertyService.Get("ICSharpCode.SharpDevelop.Gui.Dialogs.NewProjectDialog.DefaultPath", Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "SharpDevelop Projects")); |
|
|
|
StartPosition = FormStartPosition.CenterParent; |
|
|
|
StartPosition = FormStartPosition.CenterParent; |
|
|
|
Icon = null; |
|
|
|
Icon = null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void InitializeView() |
|
|
|
public NewProjectDialog() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected virtual void InitializeView() |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImageList smalllist = new ImageList(); |
|
|
|
ImageList smalllist = new ImageList(); |
|
|
|
ImageList imglist = new ImageList(); |
|
|
|
ImageList imglist = new ImageList(); |
|
|
@ -116,7 +120,7 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// TODO : insert sub categories
|
|
|
|
// TODO : insert sub categories
|
|
|
|
Category GetCategory(string categoryname) |
|
|
|
protected Category GetCategory(string categoryname) |
|
|
|
{ |
|
|
|
{ |
|
|
|
foreach (Category category in categories) { |
|
|
|
foreach (Category category in categories) { |
|
|
|
if (category.Text == categoryname) |
|
|
|
if (category.Text == categoryname) |
|
|
@ -127,22 +131,24 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs |
|
|
|
return newcategory; |
|
|
|
return newcategory; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void InitializeTemplates() |
|
|
|
protected virtual void InitializeTemplates() |
|
|
|
{ |
|
|
|
{ |
|
|
|
foreach (ProjectTemplate template in ProjectTemplate.ProjectTemplates) { |
|
|
|
foreach (ProjectTemplate template in ProjectTemplate.ProjectTemplates) { |
|
|
|
TemplateItem titem = new TemplateItem(template); |
|
|
|
TemplateItem titem = new TemplateItem(template); |
|
|
|
if (titem.Template.Icon != null) { |
|
|
|
if (titem.Template.Icon != null) { |
|
|
|
icons[titem.Template.Icon] = 0; // "create template icon"
|
|
|
|
icons[titem.Template.Icon] = 0; // "create template icon"
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (template.NewProjectDialogVisible == true) { |
|
|
|
Category cat = GetCategory(titem.Template.Category); |
|
|
|
Category cat = GetCategory(titem.Template.Category); |
|
|
|
cat.Templates.Add(titem); |
|
|
|
cat.Templates.Add(titem); |
|
|
|
if (cat.Templates.Count == 1) |
|
|
|
if (cat.Templates.Count == 1) |
|
|
|
titem.Selected = true; |
|
|
|
titem.Selected = true; |
|
|
|
|
|
|
|
} |
|
|
|
alltemplates.Add(titem); |
|
|
|
alltemplates.Add(titem); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void CategoryChange(object sender, TreeViewEventArgs e) |
|
|
|
protected void CategoryChange(object sender, TreeViewEventArgs e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
((ListView)ControlDictionary["templateListView"]).Items.Clear(); |
|
|
|
((ListView)ControlDictionary["templateListView"]).Items.Clear(); |
|
|
|
if (((TreeView)ControlDictionary["categoryTreeView"]).SelectedNode != null) { |
|
|
|
if (((TreeView)ControlDictionary["categoryTreeView"]).SelectedNode != null) { |
|
|
@ -360,7 +366,7 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void InitializeComponents() |
|
|
|
protected void InitializeComponents() |
|
|
|
{ |
|
|
|
{ |
|
|
|
SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("Resources.NewProjectDialog.xfrm")); |
|
|
|
SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("Resources.NewProjectDialog.xfrm")); |
|
|
|
|
|
|
|
|
|
|
@ -413,7 +419,7 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs |
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Represents a category
|
|
|
|
/// Represents a category
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
internal class Category : TreeNode |
|
|
|
public class Category : TreeNode |
|
|
|
{ |
|
|
|
{ |
|
|
|
ArrayList categories = new ArrayList(); |
|
|
|
ArrayList categories = new ArrayList(); |
|
|
|
ArrayList templates = new ArrayList(); |
|
|
|
ArrayList templates = new ArrayList(); |
|
|
@ -445,7 +451,7 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs |
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Holds a new file template
|
|
|
|
/// Holds a new file template
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
internal class TemplateItem : ListViewItem |
|
|
|
public class TemplateItem : ListViewItem |
|
|
|
{ |
|
|
|
{ |
|
|
|
ProjectTemplate template; |
|
|
|
ProjectTemplate template; |
|
|
|
|
|
|
|
|
|
|
|