Browse Source

Fixed SD2-653: Design tab missing for new form added to project

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1044 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 20 years ago
parent
commit
ff84b11400
  1. 55
      data/templates/file/CSharp/CSharp.Forms.Form.xft
  2. 57
      data/templates/file/CSharp/CSharp.Forms.UserControl.xft
  3. 26
      data/templates/file/VBNet/VBNet.Forms.Form.xft
  4. 24
      data/templates/file/VBNet/VBNet.Forms.UserControl.xft
  5. 31
      src/AddIns/BackendBindings/Boo/BooBinding/Project/Templates/Form.xft
  6. 6
      src/Main/Base/Project/Src/Gui/Dialogs/NewFileDialog.cs
  7. 6
      src/Main/Base/Project/Src/Internal/Templates/File/FileTemplate.cs

55
data/templates/file/CSharp/CSharp.Forms.Form.xft

@ -22,33 +22,7 @@ @@ -22,33 +22,7 @@
${ClassName} -> Class name (generally FileNameWithoutExtension w/o 'bad' characters)
-->
<Files>
<File name="${FullName}" language="C#"><![CDATA[${StandardHeader.C#}
using System;
using System.Drawing;
using System.Windows.Forms;
namespace ${StandardNamespace}
{
/// <summary>
/// Description of ${ClassName}.
/// </summary>
public partial class ${ClassName}
{
public ${ClassName}()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call.
//
}
}
}
]]></File>
<!-- Designer file must come first, so the design tab is shown correctly -->
<File name="${Path}/${FileNameWithoutExtension}.Designer.cs" dependentUpon="${FileName}" language="C#"><![CDATA[${StandardHeader.C#}
namespace ${StandardNamespace}
{
@ -89,6 +63,33 @@ namespace ${StandardNamespace} @@ -89,6 +63,33 @@ namespace ${StandardNamespace}
}
}
}
]]></File>
<File name="${FullName}" language="C#"><![CDATA[${StandardHeader.C#}
using System;
using System.Drawing;
using System.Windows.Forms;
namespace ${StandardNamespace}
{
/// <summary>
/// Description of ${ClassName}.
/// </summary>
public partial class ${ClassName}
{
public ${ClassName}()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call.
//
}
}
}
]]></File>
</Files>

57
data/templates/file/CSharp/CSharp.Forms.UserControl.xft

@ -22,34 +22,7 @@ @@ -22,34 +22,7 @@
${Path} -> Full path of the file
-->
<Files>
<File name="${FullName}" language="C#"><![CDATA[${StandardHeader.C#}
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace ${StandardNamespace}
{
/// <summary>
/// Description of ${ClassName}.
/// </summary>
public partial class ${ClassName}
{
public ${ClassName}()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call.
//
}
}
}
]]></File>
<!-- Designer file must come first, so the design tab is shown correctly -->
<File name="${Path}/${FileNameWithoutExtension}.Designer.cs" dependentUpon="${FileName}" language="C#"><![CDATA[${StandardHeader.C#}
namespace ${StandardNamespace}
{
@ -89,6 +62,34 @@ namespace ${StandardNamespace} @@ -89,6 +62,34 @@ namespace ${StandardNamespace}
}
}
}
]]></File>
<File name="${FullName}" language="C#"><![CDATA[${StandardHeader.C#}
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace ${StandardNamespace}
{
/// <summary>
/// Description of ${ClassName}.
/// </summary>
public partial class ${ClassName}
{
public ${ClassName}()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call.
//
}
}
}
]]></File>
</Files>

26
data/templates/file/VBNet/VBNet.Forms.Form.xft

@ -22,19 +22,6 @@ @@ -22,19 +22,6 @@
${Path} -> Full path of the file
-->
<Files>
<File name="${FullName}" language="VBNET"><![CDATA[${StandardHeader.VBNET}
Public Partial Class ${ClassName}
Public Sub New()
' The Me.InitializeComponent call is required for Windows Forms designer support.
Me.InitializeComponent()
'
' TODO : Add constructor code after InitializeComponents
'
End Sub
End Class
]]></File>
<File name="${Path}/${FileNameWithoutExtension}.Designer.vb" dependentUpon="${FileName}" language="VBNET"><![CDATA[${StandardHeader.VBNET}
Partial Class ${ClassName}
Inherits System.Windows.Forms.Form
@ -71,6 +58,19 @@ Partial Class ${ClassName} @@ -71,6 +58,19 @@ Partial Class ${ClassName}
Me.Text = "${ClassName}"
End Sub
End Class
]]></File>
<File name="${FullName}" language="VBNET"><![CDATA[${StandardHeader.VBNET}
Public Partial Class ${ClassName}
Public Sub New()
' The Me.InitializeComponent call is required for Windows Forms designer support.
Me.InitializeComponent()
'
' TODO : Add constructor code after InitializeComponents
'
End Sub
End Class
]]></File>
</Files>

24
data/templates/file/VBNet/VBNet.Forms.UserControl.xft

@ -21,18 +21,6 @@ @@ -21,18 +21,6 @@
${Path} -> Full path of the file
-->
<Files>
<File name="${FullName}" language="VBNET"><![CDATA[${StandardHeader.VBNET}
Public Partial Class ${ClassName}
Public Sub New()
' The Me.InitializeComponent call is required for Windows Forms designer support.
Me.InitializeComponent()
'
' TODO : Add constructor code after InitializeComponents
'
End Sub
End Class
]]></File>
<File name="${Path}/${FileNameWithoutExtension}.Designer.vb" dependentUpon="${FileName}" language="VBNET"><![CDATA[${StandardHeader.VBNET}
Partial Class ${ClassName}
Inherits System.Windows.Forms.UserControl
@ -68,6 +56,18 @@ Partial Class ${ClassName} @@ -68,6 +56,18 @@ Partial Class ${ClassName}
Me.Name = "${ClassName}"
End Sub
End Class
]]></File>
<File name="${FullName}" language="VBNET"><![CDATA[${StandardHeader.VBNET}
Public Partial Class ${ClassName}
Public Sub New()
' The Me.InitializeComponent call is required for Windows Forms designer support.
Me.InitializeComponent()
'
' TODO : Add constructor code after InitializeComponents
'
End Sub
End Class
]]></File>
</Files>

31
src/AddIns/BackendBindings/Boo/BooBinding/Project/Templates/Form.xft

@ -21,21 +21,7 @@ @@ -21,21 +21,7 @@
${ClassName} -> Class name (generally FileNameWithoutExtension w/o 'bad' characters)
-->
<Files>
<File name="${FullName}" language="Boo"><![CDATA[namespace ${StandardNamespace}
import System
import System.Collections
import System.Drawing
import System.Windows.Forms
partial class ${ClassName}:
"""Description of ${ClassName}."""
def constructor():
// The InitializeComponent() call is required for Windows Forms designer support.
InitializeComponent()
// TODO: Add constructor code after the InitializeComponent() call.
]]></File>
<!-- Designer file must come first, so the design tab is shown correctly -->
<File name="${Path}/${FileNameWithoutExtension}.Designer.boo" language="Boo"><![CDATA[namespace ${StandardNamespace}
partial class ${ClassName}(System.Windows.Forms.Form):
@ -56,6 +42,21 @@ partial class ${ClassName}(System.Windows.Forms.Form): @@ -56,6 +42,21 @@ partial class ${ClassName}(System.Windows.Forms.Form):
self.Text = '${ClassName}'
self.Name = '${ClassName}'
]]></File>
<File name="${FullName}" language="Boo"><![CDATA[namespace ${StandardNamespace}
import System
import System.Collections
import System.Drawing
import System.Windows.Forms
partial class ${ClassName}:
"""Description of ${ClassName}."""
def constructor():
// The InitializeComponent() call is required for Windows Forms designer support.
InitializeComponent()
// TODO: Add constructor code after the InitializeComponent() call.
]]></File>
</Files>

6
src/Main/Base/Project/Src/Gui/Dialogs/NewFileDialog.cs

@ -370,12 +370,14 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -370,12 +370,14 @@ namespace ICSharpCode.SharpDevelop.Gui
public void SaveFile(FileDescriptionTemplate newfile, string content)
{
string parsedFileName = StringParser.Parse(newfile.Name);
string parsedContent = StringParser.Parse(content);
if (parsedFileName.StartsWith("/") || parsedFileName.StartsWith("\\"))
parsedFileName = parsedFileName.Substring(1);
if (newfile.IsDependentFile && Path.IsPathRooted(parsedFileName)) {
File.WriteAllText(parsedFileName, StringParser.Parse(content), ParserService.DefaultFileEncoding);
File.WriteAllText(parsedFileName, parsedContent, ParserService.DefaultFileEncoding);
ParserService.ParseFile(parsedFileName, parsedContent);
} else {
IWorkbenchWindow window = FileService.NewFile(Path.GetFileName(parsedFileName), StringParser.Parse(newfile.Language), StringParser.Parse(content));
IWorkbenchWindow window = FileService.NewFile(Path.GetFileName(parsedFileName), StringParser.Parse(newfile.Language), parsedContent);
if (window == null) {
return;
}

6
src/Main/Base/Project/Src/Internal/Templates/File/FileTemplate.cs

@ -309,8 +309,10 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -309,8 +309,10 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
// load the files
XmlElement files = doc.DocumentElement["Files"];
XmlNodeList nodes = files.ChildNodes;
foreach (XmlElement filenode in nodes) {
this.files.Add(new FileDescriptionTemplate(filenode));
foreach (XmlNode filenode in nodes) {
if (filenode is XmlElement) {
this.files.Add(new FileDescriptionTemplate((XmlElement)filenode));
}
}
// load scripts (if any)

Loading…
Cancel
Save