From 4a0379d84ff15326f6f44b41677c67d8aa1dd904 Mon Sep 17 00:00:00 2001
From: Matt Ward <ward.matt@gmail.com>
Date: Sun, 10 Feb 2008 13:57:22 +0000
Subject: [PATCH] Added support for string properties in file templates.
 Property grid is now anchored in the new file dialog.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2948 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
---
 src/Main/Base/Project/Src/Gui/Dialogs/NewFileDialog.cs | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/NewFileDialog.cs b/src/Main/Base/Project/Src/Gui/Dialogs/NewFileDialog.cs
index f69f923d2e..800a4e8931 100644
--- a/src/Main/Base/Project/Src/Gui/Dialogs/NewFileDialog.cs
+++ b/src/Main/Base/Project/Src/Gui/Dialogs/NewFileDialog.cs
@@ -219,6 +219,7 @@ namespace ICSharpCode.SharpDevelop.Gui
 			if (!Controls.Contains(propertyGrid)) {
 				this.SuspendLayout();
 				propertyGrid.Location = new Point(Width - GridMargin, GridMargin);
+				propertyGrid.Anchor = AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom;
 				localizedTypeDescriptor.Properties.Clear();
 				foreach (TemplateProperty property in SelectedTemplate.Properties) {
 					LocalizedProperty localizedProperty;
@@ -247,6 +248,10 @@ namespace ICSharpCode.SharpDevelop.Gui
 							}
 							StringParser.Properties["Properties." + localizedProperty.Name] = defVal;
 							localizedProperty.DefaultValue = Boolean.Parse(defVal);
+						} else {
+							string defVal = property.DefaultValue == null ? String.Empty : property.DefaultValue.ToString();
+							StringParser.Properties["Properties." + localizedProperty.Name] = defVal;
+							localizedProperty.DefaultValue = defVal;			
 						}
 					}
 					localizedProperty.LocalizedName = property.LocalizedName;