Author: mhutch
Date: 2006-07-21 11:31:07 -0400 (Fri, 21 Jul 2006)
New Revision: 62865
Added:
trunk/monodevelop/Extras/AspNetAddIn/Project/AspNetCodeBehindProvider.cs
trunk/monodevelop/Extras/AspNetAddIn/Project/AspNetDisplayBinding.cs
trunk/monodevelop/Extras/AspNetAddIn/Project/VerifyCodeBehindBuildStep.cs
trunk/monodevelop/Extras/AspNetAddIn/Templates/CodeBehindWebService.xft.xml
trunk/monodevelop/Extras/AspNetAddIn/Templates/EmptyWebService.xft.xml
Removed:
trunk/monodevelop/Extras/AspNetAddIn/Project/CodeBehindClassBuilder.cs
trunk/monodevelop/Extras/AspNetAddIn/Project/CodeBehindProjectFileExtension.cs
Modified:
trunk/monodevelop/Extras/AspNetAddIn/AspNetAddIn.addin.xml
trunk/monodevelop/Extras/AspNetAddIn/AspNetAddIn.mdp
trunk/monodevelop/Extras/AspNetAddIn/ChangeLog
trunk/monodevelop/Extras/AspNetAddIn/Makefile.am
trunk/monodevelop/Extras/AspNetAddIn/Parser/PageInfoVisitor.cs
trunk/monodevelop/Extras/AspNetAddIn/Project/AspNetAppProject.cs
trunk/monodevelop/Extras/AspNetAddIn/Templates/CodeBehindWebControl.xft.xml
trunk/monodevelop/Extras/AspNetAddIn/Templates/CodeBehindWebForm.xft.xml
trunk/monodevelop/Extras/AspNetAddIn/Templates/CodeBehindWebHandler.xft.xml
trunk/monodevelop/Extras/AspNetAddIn/Templates/WebApplication.xpt.xml
Log:
2006-07-21 Michael Hutchinson <[EMAIL PROTECTED]>
* Project/AspNetAppProject.cs:
* Project/VerifyCodeBehindBuildStep.cs:
Move Codebehind verification into a separate build step.
* Project/CodeBehindClassBuilder.cs:
* Project/AspNetCodeBehindProvider.cs:
Deleted. Functionality moved to MonoDevelop.DesignerSupport.
* Project/AspNetAppProject.cs:
* AspNetAddIn.addin.xml:
* Project/CodeBehindProjectFileExtension.cs:
Implement CodeBehindProvider architecture.
* Parser/PageInfoVisitor.cs:
Find CodeBehind info for more filetypes.
* Templates/CodeBehindWebHandler.xft.xml:
* Templates/CodeBehindWebControl.xft.xml:
* Templates/CodeBehindWebForm.xft.xml:
* Templates/WebApplication.xpt.xml:
Remove unnecessary underscores in CodeBehind class names.
* Templates/CodeBehindWebService.xft.xml:
* Templates/EmptyWebService.xft.xml:
New templates.
* Project/AspNetDisplayBinding.cs:
New file. For now, makes it possible to open ASP.NET mime types.
* AspNetAddIn.addin.xml:
* Makefile.am:
* AspNetAddIn.mdp:
Include new files, remove old ones.
Modified: trunk/monodevelop/Extras/AspNetAddIn/AspNetAddIn.addin.xml
===================================================================
--- trunk/monodevelop/Extras/AspNetAddIn/AspNetAddIn.addin.xml 2006-07-21
14:47:23 UTC (rev 62864)
+++ trunk/monodevelop/Extras/AspNetAddIn/AspNetAddIn.addin.xml 2006-07-21
15:31:07 UTC (rev 62865)
@@ -18,14 +18,16 @@
<AddIn id="MonoDevelop.Projects.Gui" version="0.12.0"/>
<AddIn id="MonoDevelop.Ide" version="0.12.0"/>
<AddIn id="MonoDevelop.SourceEditor" version="0.12.0"/>
- <AddIn id="CSharpBinding" version="0.9.0"/>
+ <AddIn id="MonoDevelop.DesignerSupport" version="0.0.1"/>
</Dependencies>
<Extension path = "/MonoDevelop/FileTemplates">
<FileTemplate id = "EmptyWebForm" resource =
"EmptyWebForm.xft.xml"/>
<FileTemplate id = "EmptyWebHandler" resource =
"EmptyWebHandler.xft.xml"/>
<FileTemplate id = "EmptyWebControl" resource =
"EmptyWebControl.xft.xml"/>
+ <FileTemplate id = "EmptyWebService" resource =
"EmptyWebService.xft.xml"/>
<FileTemplate id = "CodeBehindWebControl" resource =
"CodeBehindWebControl.xft.xml"/>
+ <FileTemplate id = "CodeBehindWebService" resource =
"CodeBehindWebService.xft.xml"/>
<FileTemplate id = "CodeBehindWebForm" resource =
"CodeBehindWebForm.xft.xml"/>
<FileTemplate id = "CodeBehindWebHandler" resource =
"CodeBehindWebHandler.xft.xml"/>
</Extension>
@@ -39,31 +41,16 @@
</Extension>
<Extension path = "/SharpDevelop/Workbench/FileFilter">
- <FileFilter id = "AspNetWebForm"
+ <FileFilter id = "AspNetWebFiles"
insertbefore = "AllFiles"
- _label = "ASP.NET Web Form (*.aspx)"
- extensions = "*.aspx" />
- <FileFilter id = "AspNetWebHandler"
- insertbefore = "AllFiles"
- _label = "ASP.NET Web Handler (*.ashx)"
- extensions = "*.ashx" />
- <FileFilter id = "AspNetWebUserControl"
- insertbefore = "AllFiles"
- _label = "ASP.NET User Control (*.ascx)"
- extensions = "*.ascx" />
+ _label = "ASP.NET Files"
+ extensions = "*.aspx,*.ashx,*.asmx,*.ascx" />
</Extension>
<Extension path = "/SharpDevelop/Workbench/ProjectBindings">
<ProjectBinding id = "AspNetApplication" class =
"AspNetAddIn.AspNetAppProjectBinding" />
</Extension>
- <Extension path =
"/SharpDevelop/Workbench/Pads/MonoDevelop.Ide.Gui.Pads.ProjectPad">
- <PadOption id = "ShowCodeBehindClasses" _label = "Show
CodeBehind classes with parent files" defaultValue = "True" />
- <PadOption id = "ShowCodeBehindFiles" _label = "Show CodeBehind
files" defaultValue = "False" />
- <NodeBuilder id = "CodeBehindProjectFileExtension" class =
"AspNetAddIn.CodeBehindProjectFileExtension"/>
- <NodeBuilder id = "CodeBehindClassBuilder" class =
"AspNetAddIn.CodeBehindClassBuilder"/>
- </Extension>
-
<Extension path = "/SharpDevelop/Workbench/SerializableClasses">
<DataType class = "AspNetAddIn.AspNetAppProject" />
<DataType class = "AspNetAddIn.AspNetAppProjectConfiguration" />
@@ -76,4 +63,20 @@
class = "AspNetAddIn.XspOptionsPanel"/>
</Conditional>
</Extension>
+
+ <Extension path = "/MonoDevelop/DesignerSupport/CodeBehindProviders">
+ <Class id="AspNetCodeBehindProvider"
class="AspNetAddIn.AspNetCodeBehindProvider"/>
+ </Extension>
+
+ <Extension path = "/SharpDevelop/Workbench/DisplayBindings">
+ <DisplayBinding id = "AspNetDisplayBinding"
+ supportedformats = "Source Code"
+ class = "AspNetAddIn.AspNetDisplayBinding"/>
+ </Extension>
+
+ <Extension path = "/SharpDevelop/Workbench/BuildPipeline">
+ <Conditional activeproject="AspNetApp">
+ <Class insertbefore = "MainBuildStep" class =
"AspNetAddIn.VerifyCodeBehindBuildStep" />
+ </Conditional>
+ </Extension>
</AddIn>
Modified: trunk/monodevelop/Extras/AspNetAddIn/AspNetAddIn.mdp
===================================================================
--- trunk/monodevelop/Extras/AspNetAddIn/AspNetAddIn.mdp 2006-07-21
14:47:23 UTC (rev 62864)
+++ trunk/monodevelop/Extras/AspNetAddIn/AspNetAddIn.mdp 2006-07-21
15:31:07 UTC (rev 62865)
@@ -13,11 +13,7 @@
<CodeGeneration compiler="Csc" warninglevel="4" optimize="True"
unsafecodeallowed="False" generateoverflowchecks="True"
generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
- <DeploymentInformation strategy="File">
- <excludeFiles>
- <ExcludeFile file="./Makefile.am" />
- </excludeFiles>
- </DeploymentInformation>
+ <DeployTargets />
<Contents>
<File name="./AspNetAddIn.addin.xml" subtype="Code" buildaction="Nothing"
/>
<File name="./Project" subtype="Directory" buildaction="Compile" />
@@ -62,10 +58,16 @@
<File name="./Parser/PageInfoVisitor.cs" subtype="Code"
buildaction="Compile" />
<File name="./Parser/WebFormReferenceManager.cs" subtype="Code"
buildaction="Compile" />
<File name="./Parser/Document.cs" subtype="Code" buildaction="Compile" />
- <File name="./Project/CodeBehindProjectFileExtension.cs" subtype="Code"
buildaction="Compile" />
- <File name="./Project/CodeBehindClassBuilder.cs" subtype="Code"
buildaction="Compile" />
<File name="./Project/XspParameters.cs" subtype="Code"
buildaction="Compile" />
<File name="./Gui/XspOptionsPanel.cs" subtype="Code" buildaction="Compile"
/>
+ <File name="./ChangeLog" subtype="Code" buildaction="Compile" />
+ <File name="./Templates/EmptyWebService.xft.xml" subtype="Code"
buildaction="EmbedAsResource" />
+ <File name="./Templates/CodeBehindWebService.xft.xml" subtype="Code"
buildaction="EmbedAsResource" />
+ <File name="./Project/AspNetDisplayBinding.cs" subtype="Code"
buildaction="Compile" />
+ <File name="./Project/AspNetViewContent.cs" subtype="Code"
buildaction="Compile" />
+ <File name="./Project/AspNetCodeBehindProvider.cs" subtype="Code"
buildaction="Compile" />
+ <File name="./Project/VerifyCodeBehindBuildStep.cs" subtype="Code"
buildaction="Compile" />
+ <File name="./AspNetAddIn.glade" subtype="Code" buildaction="Nothing" />
</Contents>
<References>
<ProjectReference type="Project" localcopy="True"
refto="MonoDevelop.Components" />
@@ -83,13 +85,17 @@
<ProjectReference type="Gac" localcopy="True" refto="System,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<ProjectReference type="Gac" localcopy="True" refto="System.Xml,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<ProjectReference type="Gac" localcopy="True" refto="System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
- <ProjectReference type="Gac" localcopy="True" refto="NRefactory,
Version=0.0.0.0, Culture=neutral" />
<ProjectReference type="Gac" localcopy="True"
refto="System.Drawing.Design, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" />
<ProjectReference type="Gac" localcopy="True" refto="System.Design,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<ProjectReference type="Gac" localcopy="True" refto="System.Drawing,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<ProjectReference type="Project" localcopy="True"
refto="MonoDevelop.Projects.Gui" />
- <ProjectReference type="Gac" localcopy="True" refto="Mono.Security,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
<ProjectReference type="Gac" localcopy="True" refto="gnome-sharp,
Version=2.8.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<ProjectReference type="Gac" localcopy="True" refto="gnome-vfs-sharp,
Version=2.8.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+ <ProjectReference type="Project" localcopy="True"
refto="MonoDevelop.DesignerSupport" />
</References>
+ <DeploymentInformation strategy="File">
+ <excludeFiles>
+ <ExcludeFile file="./Makefile.am" />
+ </excludeFiles>
+ </DeploymentInformation>
</Project>
\ No newline at end of file
Modified: trunk/monodevelop/Extras/AspNetAddIn/ChangeLog
===================================================================
--- trunk/monodevelop/Extras/AspNetAddIn/ChangeLog 2006-07-21 14:47:23 UTC
(rev 62864)
+++ trunk/monodevelop/Extras/AspNetAddIn/ChangeLog 2006-07-21 15:31:07 UTC
(rev 62865)
@@ -1,3 +1,39 @@
+2006-07-21 Michael Hutchinson <[EMAIL PROTECTED]>
+
+ * Project/AspNetAppProject.cs:
+ * Project/VerifyCodeBehindBuildStep.cs:
+ Move Codebehind verification into a separate build step.
+
+ * Project/CodeBehindClassBuilder.cs:
+ * Project/AspNetCodeBehindProvider.cs:
+ Deleted. Functionality moved to MonoDevelop.DesignerSupport.
+ * Project/AspNetAppProject.cs:
+ * AspNetAddIn.addin.xml:
+ * Project/CodeBehindProjectFileExtension.cs:
+ Implement CodeBehindProvider architecture.
+
+ * Parser/PageInfoVisitor.cs:
+ Find CodeBehind info for more filetypes.
+
+ * Templates/CodeBehindWebHandler.xft.xml:
+ * Templates/CodeBehindWebControl.xft.xml:
+ * Templates/CodeBehindWebForm.xft.xml:
+ * Templates/WebApplication.xpt.xml:
+ Remove unnecessary underscores in CodeBehind class names.
+
+ * Templates/CodeBehindWebService.xft.xml:
+ * Templates/EmptyWebService.xft.xml:
+ New templates.
+
+
+ * Project/AspNetDisplayBinding.cs:
+ New file. For now, makes it possible to open ASP.NET mime types.
+
+ * AspNetAddIn.addin.xml:
+ * Makefile.am:
+ * AspNetAddIn.mdp:
+ Include new files, remove old ones.
+
2006-07-04 Michael Hutchinson <[EMAIL PROTECTED]>
* Templates/CodeBehindWebControl.xft.xml:
Modified: trunk/monodevelop/Extras/AspNetAddIn/Makefile.am
===================================================================
--- trunk/monodevelop/Extras/AspNetAddIn/Makefile.am 2006-07-21 14:47:23 UTC
(rev 62864)
+++ trunk/monodevelop/Extras/AspNetAddIn/Makefile.am 2006-07-21 15:31:07 UTC
(rev 62865)
@@ -13,6 +13,7 @@
-r:$(top_builddir)/build/AddIns/MonoDevelop.Projects.dll \
-r:$(top_builddir)/build/AddIns/MonoDevelop.Ide.dll \
-r:$(top_builddir)/build/AddIns/MonoDevelop.Components.dll \
+
-r:$(top_builddir)/build/AddIns/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.dll
\
$(GTK_SHARP_LIBS) \
$(GNOME_SHARP_LIBS) \
$(GLADE_SHARP_LIBS)
@@ -22,10 +23,13 @@
Project/AspNetAppProjectBinding.cs \
Project/AspNetAppProjectConfiguration.cs \
Project/AspNetFileDescriptionTemplate.cs \
- Project/CodeBehindClassBuilder.cs \
- Project/CodeBehindProjectFileExtension.cs \
+ Project/AspNetCodeBehindProvider.cs \
+ Project/AspNetDisplayBinding.cs \
Project/XspParameters.cs \
+ Project/VerifyCodeBehindBuildStep.cs \
+ \
Gui/XspOptionsPanel.cs \
+ \
Parser/Document.cs \
Parser/MemberListVisitor.cs \
Parser/WebFormReferenceManager.cs \
@@ -54,9 +58,11 @@
Templates/EmptyWebHandler.xft.xml \
Templates/EmptyWebForm.xft.xml \
Templates/EmptyWebControl.xft.xml \
+ Templates/EmptyWebService.xft.xml \
Templates/CodeBehindWebHandler.xft.xml \
Templates/CodeBehindWebForm.xft.xml \
Templates/CodeBehindWebControl.xft.xml \
+ Templates/CodeBehindWebService.xft.xml \
Templates/WebApplication.xpt.xml \
AspNetAddIn.glade
Modified: trunk/monodevelop/Extras/AspNetAddIn/Parser/PageInfoVisitor.cs
===================================================================
--- trunk/monodevelop/Extras/AspNetAddIn/Parser/PageInfoVisitor.cs
2006-07-21 14:47:23 UTC (rev 62864)
+++ trunk/monodevelop/Extras/AspNetAddIn/Parser/PageInfoVisitor.cs
2006-07-21 15:31:07 UTC (rev 62865)
@@ -40,15 +40,34 @@
private string inheritedClass;
private string codeBehindFile;
private string language;
+ private AspNetAddIn.WebSubtype type = WebSubtype.None;
public override void Visit (DirectiveNode node)
{
- if (String.Compare (node.Name, "page", true) != 0)
- return;
+ switch (node.Name.ToLower ()) {
+ case "page":
+ type = WebSubtype.WebForm;
+ break;
+ case "control":
+ type = WebSubtype.WebControl;
+ break;
+ case "webservice":
+ type = WebSubtype.WebService;
+ break;
+ case "webhandler":
+ type = WebSubtype.WebHandler;
+ break;
+ default:
+ type = WebSubtype.None;
+ return;
+ }
- inheritedClass = (string) node.Attributes ["inherits"];
- codeBehindFile = (string) node.Attributes
["codebehind"];
- language = (string) node.Attributes ["language"];
+ inheritedClass = node.Attributes ["inherits"] as string;
+ if (inheritedClass == null)
+ inheritedClass = node.Attributes ["class"] as
string;
+
+ codeBehindFile = node.Attributes ["codebehind"] as
string;
+ language = node.Attributes ["language"] as string;
}
public string InheritedClass {
@@ -62,5 +81,9 @@
public string Language {
get { return language; }
}
+
+ public AspNetAddIn.WebSubtype Subtype {
+ get { return type; }
+ }
}
}
Modified: trunk/monodevelop/Extras/AspNetAddIn/Project/AspNetAppProject.cs
===================================================================
--- trunk/monodevelop/Extras/AspNetAddIn/Project/AspNetAppProject.cs
2006-07-21 14:47:23 UTC (rev 62864)
+++ trunk/monodevelop/Extras/AspNetAddIn/Project/AspNetAppProject.cs
2006-07-21 15:31:07 UTC (rev 62865)
@@ -110,11 +110,6 @@
return conf;
}
- public override void Deserialize (ITypeSerializer handler,
DataCollection data)
- {
- base.Deserialize (handler, data);
- }
-
#endregion
#region build/prebuild/execute
@@ -160,17 +155,8 @@
operationMonitor.Dispose ();
console.Dispose ();
}
- }
+ }
- protected override void DoPreBuild (IProgressMonitor monitor)
- {
- foreach (ProjectFile file in ProjectFiles) {
- if (DetermineWebSubtype (file) ==
WebSubtype.WebForm)
- VerifyCodeBehind (file, monitor);
- }
- }
-
-
protected override ICompilerResult DoBuild (IProgressMonitor
monitor)
{
AspNetAppProjectConfiguration conf =
(AspNetAppProjectConfiguration) ActiveConfiguration;
@@ -189,119 +175,6 @@
#endregion
- #region CodeBehind verification
-
- public void VerifyCodeBehind (ProjectFile file,
IProgressMonitor monitor)
- {
- Document doc = GetDocument (file);
- IClass cls = GetCodeBehindClass (file, false);
- //TODO: close file views before modifying them
-
- if (cls == null) {
- monitor.ReportWarning ("Cannot find CodeBehind
class \"" + doc.Info.InheritedClass + "\" for file \"" + file.Name + "\".");
- return;
- }
-
- //TODO: currently case-sensitive, so some languages may
not like this
- bool ignoreCase = false;
-
- if (cls != null) {
- foreach (System.CodeDom.CodeMemberField member
in doc.MemberList.List.Values) {
- bool found = false;
-
- //check for identical property names
- foreach (IProperty prop in
cls.Properties) {
- if (string.Compare (prop.Name,
member.Name, ignoreCase) == 0) {
- monitor.ReportWarning
("Cannot add field \"" + member.Name + "\" from \"" + file.Name +
-
"\" to CodeBehind file \"" + cls.BodyRegion.FileName +
-
"\", because there is already a property with that name.");
- found = true;
- break;
- }
- }
-
- //check for identical method names
- foreach (IMethod meth in cls.Methods) {
- if (string.Compare (meth.Name,
member.Name, ignoreCase) == 0) {
- monitor.ReportWarning
("Cannot add field \"" + member.Name + "\" from \"" + file.Name +
-
"\" to CodeBehind file \"" + cls.BodyRegion.FileName +
-
"\", because there is already a method with that name on line " +
meth.BodyRegion.BeginLine + ".");
- found = true;
- break;
- }
- }
-
- //check for matching fields
- foreach (IField field in cls.Fields) {
- if (string.Compare (field.Name,
member.Name, ignoreCase) == 0) {
- found = true;
-
- //check whether they're
accessible
- if (!(field.IsPublic ||
field.IsProtected || field.IsProtectedOrInternal)) {
-
monitor.ReportWarning ("Cannot add field \"" + member.Name + "\" from \"" +
file.Name +
-
"\" to CodeBehind file \"" + cls.BodyRegion.FileName +
-
"\", because there is already a field with that name, " +
-
"which cannot be accessed by the deriving page.");
- break;
- }
-
- //check they're the
same type
- //TODO: check for base
type compatibility
- if (string.Compare
(member.Type.BaseType, field.ReturnType.FullyQualifiedName, ignoreCase) != 0) {
-
monitor.ReportWarning ("Cannot add field \"" + member.Name + "\" with type \""
+ member.Type.BaseType + "\" from \"" + file.Name +
-
"\" to CodeBehind file \"" + cls.BodyRegion.FileName +
-
"\", because there is already a field with that name, " +
-
"which appears to have a different type, \"" +
field.ReturnType.FullyQualifiedName + "\".");
- break;
- }
- }
- }
-
- if (!found)
-
MonoDevelop.Ide.Gui.IdeApp.ProjectOperations.CodeRefactorer.AddMember (cls,
member);
- }
- }
- }
-
- public IList GetAllCodeBehindClasses (bool throwOnError)
- {
- System.Collections.ArrayList classes = new
System.Collections.ArrayList ();
-
- foreach (ProjectFile file in this.ProjectFiles) {
- Document doc = GetDocument (file);
-
- if (doc.Info.InheritedClass == null)
- continue;
-
- IParserContext ctx =
MonoDevelop.Ide.Gui.IdeApp.ProjectOperations.ParserDatabase.GetProjectParserContext
(this);
- IClass cls = ctx.GetClass
(doc.Info.InheritedClass);
-
- if (cls != null)
- classes.Add (cls);
- else if (throwOnError)
- throw new Exception ("The CodeBehind
class \"" + doc.Info.InheritedClass + "\" cannot be found");
- }
-
- return classes;
- }
-
- public IClass GetCodeBehindClass (ProjectFile file, bool
throwOnError)
- {
- Document doc = GetDocument (file);
-
- if (doc.Info.InheritedClass == null)
- return null;
-
- IParserContext ctx =
MonoDevelop.Ide.Gui.IdeApp.ProjectOperations.ParserDatabase.GetProjectParserContext
(this);
- IClass cls = ctx.GetClass (doc.Info.InheritedClass);
- if ((cls == null) && (throwOnError))
- throw new Exception ("The CodeBehind class \""
+ doc.Info.InheritedClass + "\" cannot be found");
-
- return cls;
- }
-
- #endregion
-
#region File utility methods
public Document GetDocument (ProjectFile file)
@@ -333,9 +206,7 @@
case "asmx":
return WebSubtype.WebService;
case "gif":
- goto case "jpg"; //mono compiler
messing up; trivial fallthroughs should be possible
case "png":
- goto case "jpg";
case "jpg":
return WebSubtype.WebImage;
case "skin":
Added: trunk/monodevelop/Extras/AspNetAddIn/Project/AspNetCodeBehindProvider.cs
===================================================================
--- trunk/monodevelop/Extras/AspNetAddIn/Project/AspNetCodeBehindProvider.cs
2006-07-21 14:47:23 UTC (rev 62864)
+++ trunk/monodevelop/Extras/AspNetAddIn/Project/AspNetCodeBehindProvider.cs
2006-07-21 15:31:07 UTC (rev 62865)
@@ -0,0 +1,56 @@
+
+using System;
+using System.Collections.Generic;
+
+using MonoDevelop.Projects;
+using MonoDevelop.Projects.Parser;
+
+using AspNetAddIn.Parser;
+
+namespace AspNetAddIn
+{
+
+ public class AspNetCodeBehindProvider:
MonoDevelop.DesignerSupport.CodeBehind.ICodeBehindProvider
+ {
+ public IList<IClass> GetAllCodeBehindClasses (Project proj)
+ {
+ List<IClass> classes = new List<IClass> ();
+
+ AspNetAppProject aProj = proj as AspNetAppProject;
+ if (aProj == null)
+ return classes;
+
+ foreach (ProjectFile file in proj.ProjectFiles) {
+ Document doc = aProj.GetDocument (file);
+
+ if (doc.Info.InheritedClass == null)
+ continue;
+
+ IParserContext ctx =
MonoDevelop.Ide.Gui.IdeApp.ProjectOperations.ParserDatabase.GetProjectParserContext
(proj);
+ IClass cls = ctx.GetClass
(doc.Info.InheritedClass);
+
+ if (cls != null)
+ classes.Add (cls);
+ }
+
+ return classes;
+ }
+
+ public IClass GetCodeBehind (ProjectFile file)
+ {
+ AspNetAppProject proj = file.Project as
AspNetAppProject;
+ if (proj == null)
+ return null;
+
+ Document doc = proj.GetDocument (file);
+
+ if (doc.Info.InheritedClass == null)
+ return null;
+
+ IParserContext ctx =
MonoDevelop.Ide.Gui.IdeApp.ProjectOperations.ParserDatabase.GetProjectParserContext
(proj);
+ IClass cls = ctx.GetClass (doc.Info.InheritedClass);
+
+ return cls;
+ }
+ }
+}
Added: trunk/monodevelop/Extras/AspNetAddIn/Project/AspNetDisplayBinding.cs
===================================================================
--- trunk/monodevelop/Extras/AspNetAddIn/Project/AspNetDisplayBinding.cs
2006-07-21 14:47:23 UTC (rev 62864)
+++ trunk/monodevelop/Extras/AspNetAddIn/Project/AspNetDisplayBinding.cs
2006-07-21 15:31:07 UTC (rev 62865)
@@ -0,0 +1,63 @@
+
+using System;
+
+using MonoDevelop.Ide.Codons;
+using MonoDevelop.Ide.Gui;
+
+namespace AspNetAddIn
+{
+
+
+ public class AspNetDisplayBinding : IDisplayBinding
+ {
+
+ public string DisplayName {
+ get { return "ASP.NET Source"; }
+ }
+
+
+ public bool CanCreateContentForFile(string fileName)
+ {
+ WebSubtype type = AspNetAppProject.DetermineWebSubtype
(System.IO.Path.GetExtension (fileName));
+
+ switch (type) {
+ case WebSubtype.WebForm:
+ case WebSubtype.WebControl:
+ case WebSubtype.WebHandler:
+ case WebSubtype.WebService:
+ IDisplayBinding db =
IdeApp.Workbench.DisplayBindings.GetBindingForMimeType ("text");
+ return (db != null);
+ default:
+ return false;
+ }
+ }
+
+ public bool CanCreateContentForMimeType (string mimetype)
+ {
+ switch (mimetype) {
+ case "application/x-aspx":
+ case "application/x-ascx":
+ case "application/x-asmx":
+ case "application/x-ashx":
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ public IViewContent CreateContentForFile (string fileName)
+ {
+ IDisplayBinding db =
IdeApp.Workbench.DisplayBindings.GetBindingForMimeType ("text/plain");
+ return db.CreateContentForFile (fileName);
+ }
+
+ public IViewContent CreateContentForMimeType (string mimeType,
System.IO.Stream content)
+ {
+ //SourceEditor AddIn won't open won't the web
application mimetypes directly
+ IDisplayBinding db =
IdeApp.Workbench.DisplayBindings.GetBindingForMimeType ("text/plain");
+ return db.CreateContentForMimeType ("text/plain",
content);
+ }
+
+
+ }
+}
Deleted: trunk/monodevelop/Extras/AspNetAddIn/Project/CodeBehindClassBuilder.cs
===================================================================
--- trunk/monodevelop/Extras/AspNetAddIn/Project/CodeBehindClassBuilder.cs
2006-07-21 14:47:23 UTC (rev 62864)
+++ trunk/monodevelop/Extras/AspNetAddIn/Project/CodeBehindClassBuilder.cs
2006-07-21 15:31:07 UTC (rev 62865)
@@ -1,75 +0,0 @@
-//
-// CodeBehindClassBuilder.cs : Displays CodeBehind classes in the Solution Pad
-//
-// Authors:
-// Michael Hutchinson <[EMAIL PROTECTED]>
-//
-// Copyright (C) 2006 Michael Hutchinson
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using MonoDevelop.Projects.Parser;
-using MonoDevelop.Ide.Gui.Pads;
-using MonoDevelop.Ide.Gui.Pads.ProjectPad;
-
-namespace AspNetAddIn
-{
- class CodeBehindClassBuilder: TypeNodeBuilder
- {
- public override Type NodeDataType {
- get { return typeof (IClass); }
- }
-
- public override Type CommandHandlerType {
- get { return typeof (ClassCommandHandler); }
- }
-
- public override string GetNodeName (ITreeNavigator thisNode,
object dataObject)
- {
- return ((IClass) dataObject).Name;
- }
-
- public override void BuildNode (ITreeBuilder treeBuilder,
object dataObject, ref string label, ref Gdk.Pixbuf icon, ref Gdk.Pixbuf
closedIcon)
- {
- IClass cls = (IClass) dataObject;
- icon = Context.GetIcon
(MonoDevelop.Ide.Gui.IdeApp.Services.Icons.GetIcon (cls));
- string fileName = (cls.Region.FileName == null)? "" :
System.IO.Path.GetFileName (cls.Region.FileName);
- label = String.Format ("Inherits {0} in {1}", cls.Name,
fileName);
- }
- }
-
- class ClassCommandHandler: NodeCommandHandler
- {
- public override void ActivateItem ()
- {
- IClass cls = (IClass) CurrentNode.DataItem;
- if (cls.Region.FileName != null) {
- int line = cls.Region.BeginLine;
- string file = cls.Region.FileName;
-
MonoDevelop.Ide.Gui.IdeApp.Workbench.OpenDocument (file, Math.Max (1, line), 1,
true);
- }
- }
- }
-}
Deleted:
trunk/monodevelop/Extras/AspNetAddIn/Project/CodeBehindProjectFileExtension.cs
===================================================================
---
trunk/monodevelop/Extras/AspNetAddIn/Project/CodeBehindProjectFileExtension.cs
2006-07-21 14:47:23 UTC (rev 62864)
+++
trunk/monodevelop/Extras/AspNetAddIn/Project/CodeBehindProjectFileExtension.cs
2006-07-21 15:31:07 UTC (rev 62865)
@@ -1,133 +0,0 @@
-//
-// CodeBehindProjectFileExtension.cs: Adds CodeBehind classes to the Solution
-// Pad, and hides CodeBehind files.
-//
-// Authors:
-// Michael Hutchinson <[EMAIL PROTECTED]>
-//
-// Copyright (C) 2006 Michael Hutchinson
-//
-//
-// This source code is licenced under The MIT License:
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using MonoDevelop.Projects;
-using MonoDevelop.Projects.Parser;
-using MonoDevelop.Ide;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Ide.Gui.Pads;
-using MonoDevelop.Ide.Gui.Pads.ProjectPad;
-
-
-namespace AspNetAddIn
-{
- public class CodeBehindProjectFileExtension : NodeBuilderExtension
- {
- MonoDevelop.Projects.ProjectFileEventHandler
projectFileEventHandler;
- ClassInformationEventHandler classInformationEventHandler;
-
- protected override void Initialize ()
- {
- projectFileEventHandler = (ProjectFileEventHandler)
IdeApp.Services.DispatchService.GuiDispatch (new ProjectFileEventHandler
(onFileChanged));
- IdeApp.ProjectOperations.FileChangedInProject +=
projectFileEventHandler;
-
- classInformationEventHandler =
(ClassInformationEventHandler) IdeApp.Services.DispatchService.GuiDispatch (new
ClassInformationEventHandler (onClassInformationChanged));
-
IdeApp.ProjectOperations.ParserDatabase.ClassInformationChanged +=
classInformationEventHandler;
- }
-
- public override void Dispose ()
- {
- IdeApp.ProjectOperations.FileChangedInProject -=
projectFileEventHandler;
-
IdeApp.ProjectOperations.ParserDatabase.ClassInformationChanged -=
classInformationEventHandler;
- }
-
- void onFileChanged (object sender,
MonoDevelop.Projects.ProjectFileEventArgs e)
- {
- if (e.ProjectFile == null) return;
-
- ITreeBuilder builder = Context.GetTreeBuilder
(e.ProjectFile);
- if (builder != null)
- builder.UpdateAll ();
- }
-
- void onClassInformationChanged (object sender,
ClassInformationEventArgs e)
- {
- if (e.Project == null) return;
- ProjectFile file = e.Project.GetProjectFile
(e.FileName);
- if (file == null) return;
-
- ITreeBuilder builder = Context.GetTreeBuilder (file);
- if (builder != null)
- builder.UpdateAll ();
- }
-
- public override bool CanBuildNode (Type dataType)
- {
- return typeof (ProjectFile).IsAssignableFrom (dataType);
- }
-
- public override void BuildChildNodes (ITreeBuilder builder,
object dataObject)
- {
- if (builder.Options ["ShowCodeBehindClasses"]) {
- ProjectFile file = (ProjectFile) dataObject;
- AspNetAppProject proj = file.Project as
AspNetAppProject;
- if ((proj != null) && (proj.DetermineWebSubtype
(file) != WebSubtype.None )) {
- IClass cls = proj.GetCodeBehindClass
(file, false);
- if (cls != null)
- builder.AddChild (cls);
- }
- }
- }
-
- public override void GetNodeAttributes (ITreeNavigator
parentNode, object dataObject, ref NodeAttributes attributes)
- {
- if (! (parentNode.Options ["ShowCodeBehindFiles"] ||
parentNode.Options ["ShowAllFiles"])) {
- ProjectFile file = (ProjectFile) dataObject;
-
- AspNetAppProject proj = file.Project as
AspNetAppProject;
- if ((proj != null) && (proj.DetermineWebSubtype
(file) == WebSubtype.None )) {
- IParserContext ctx =
MonoDevelop.Ide.Gui.IdeApp.ProjectOperations.ParserDatabase.GetProjectParserContext
(proj);
- System.Collections.IList list =
proj.GetAllCodeBehindClasses (false);
-
- foreach (IClass cls in
ctx.GetFileContents (file.FilePath))
- if (list.Contains (cls))
- attributes =
NodeAttributes.Hidden;
- }
- }
- }
-
- public override bool HasChildNodes (ITreeBuilder builder,
object dataObject)
- {
- if (builder.Options ["ShowCodeBehindClasses"]) {
- ProjectFile file = (ProjectFile) dataObject;
- AspNetAppProject proj = file.Project as
AspNetAppProject;
- if (proj != null) {
- IClass cls = proj.GetCodeBehindClass
(file, false);
- return (cls != null);
- }
- }
- return false;
- }
-
- }
-}
Added: trunk/monodevelop/Extras/AspNetAddIn/Project/VerifyCodeBehindBuildStep.cs
===================================================================
--- trunk/monodevelop/Extras/AspNetAddIn/Project/VerifyCodeBehindBuildStep.cs
2006-07-21 14:47:23 UTC (rev 62864)
+++ trunk/monodevelop/Extras/AspNetAddIn/Project/VerifyCodeBehindBuildStep.cs
2006-07-21 15:31:07 UTC (rev 62865)
@@ -0,0 +1,113 @@
+
+using System;
+using System.IO;
+
+using MonoDevelop.Projects;
+using MonoDevelop.Projects.Parser;
+using MonoDevelop.Core.ProgressMonitoring;
+using MonoDevelop.Core;
+using MonoDevelop.DesignerSupport;
+
+using AspNetAddIn.Parser;
+
+namespace AspNetAddIn
+{
+
+ public class VerifyCodeBehindBuildStep : IBuildStep
+ {
+
+ public ICompilerResult Build (IProgressMonitor monitor, Project
project)
+ {
+ AspNetAppProject aspProject = project as
AspNetAppProject;
+
+ if (aspProject == null)
+ return null;
+
+ IParserContext ctx =
MonoDevelop.Ide.Gui.IdeApp.ProjectOperations.ParserDatabase.GetProjectParserContext
(project);
+
+ foreach (ProjectFile file in project.ProjectFiles) {
+ WebSubtype type =
AspNetAppProject.DetermineWebSubtype (Path.GetExtension (file.FilePath));
+ if ((type != WebSubtype.WebForm) && (type !=
WebSubtype.WebControl))
+ continue;
+
+ Document doc = aspProject.GetDocument (file);
+ if (string.IsNullOrEmpty
(doc.Info.InheritedClass))
+ continue;
+
+ IClass cls = ctx.GetClass
(doc.Info.InheritedClass);
+ if (cls == null) {
+ monitor.ReportWarning ("Cannot find
CodeBehind class \"" + doc.Info.InheritedClass + "\" for file \"" + file.Name
+ "\".");
+ return null;
+ }
+
+ //TODO: close file views before modifying them
+ //TODO: currently case-sensitive, so some
languages may not like this
+ bool ignoreCase = false;
+
+ if (cls != null) {
+ foreach (System.CodeDom.CodeMemberField
member in doc.MemberList.List.Values) {
+ bool found = false;
+
+ //check for identical property
names
+ foreach (IProperty prop in
cls.Properties) {
+ if (string.Compare
(prop.Name, member.Name, ignoreCase) == 0) {
+
monitor.ReportWarning ("Cannot add field \"" + member.Name + "\" from \"" +
file.Name +
+
"\" to CodeBehind file \"" + cls.BodyRegion.FileName +
+
"\", because there is already a property with that name.");
+ found = true;
+ break;
+ }
+ }
+
+ //check for identical method
names
+ foreach (IMethod meth in
cls.Methods) {
+ if (string.Compare
(meth.Name, member.Name, ignoreCase) == 0) {
+
monitor.ReportWarning ("Cannot add field \"" + member.Name + "\" from \"" +
file.Name +
+
"\" to CodeBehind file \"" + cls.BodyRegion.FileName +
+
"\", because there is already a method with that name on line " +
meth.BodyRegion.BeginLine + ".");
+ found = true;
+ break;
+ }
+ }
+
+ //check for matching fields
+ foreach (IField field in
cls.Fields) {
+ if (string.Compare
(field.Name, member.Name, ignoreCase) == 0) {
+ found = true;
+
+ //check whether
they're accessible
+ if
(!(field.IsPublic || field.IsProtected || field.IsProtectedOrInternal)) {
+
monitor.ReportWarning ("Cannot add field \"" + member.Name + "\" from \"" +
file.Name +
+
"\" to CodeBehind file \"" + cls.BodyRegion.FileName +
+
"\", because there is already a field with that name, " +
+
"which cannot be accessed by the deriving page.");
+ break;
+ }
+
+ //check they're
the same type
+ //TODO: check
for base type compatibility
+ if
(string.Compare (member.Type.BaseType, field.ReturnType.FullyQualifiedName,
ignoreCase) != 0) {
+
monitor.ReportWarning ("Cannot add field \"" + member.Name + "\" with type \""
+ member.Type.BaseType + "\" from \"" + file.Name +
+
"\" to CodeBehind file \"" + cls.BodyRegion.FileName +
+
"\", because there is already a field with that name, " +
+
"which appears to have a different type, \"" +
field.ReturnType.FullyQualifiedName + "\".");
+ break;
+ }
+ }
+ }
+
+ if (!found)
+
MonoDevelop.Ide.Gui.IdeApp.ProjectOperations.CodeRefactorer.AddMember (cls,
member);
+ }
+ }
+ }
+
+ return null;
+ }
+
+ public bool NeedsBuilding (Project project)
+ {
+ return false;
+ }
+ }
+}
Modified:
trunk/monodevelop/Extras/AspNetAddIn/Templates/CodeBehindWebControl.xft.xml
===================================================================
--- trunk/monodevelop/Extras/AspNetAddIn/Templates/CodeBehindWebControl.xft.xml
2006-07-21 14:47:23 UTC (rev 62864)
+++ trunk/monodevelop/Extras/AspNetAddIn/Templates/CodeBehindWebControl.xft.xml
2006-07-21 15:31:07 UTC (rev 62865)
@@ -16,7 +16,7 @@
<TemplateFiles>
<AspNetFile DefaultExtension=".ascx" name="Default">
<FileText>
-<![CDATA[<%@ Control Language="${Language}" ClassName="${Namespace}._${Name}"
%>]]>
+<![CDATA[<%@ Control Language="${Language}" Inherits="${Namespace}.${Name}"
%>]]>
</FileText>
</AspNetFile>
@@ -27,7 +27,7 @@
namespace ${Namespace} {
- public class _${Name} : UserControl
+ public class ${Name} : UserControl
{
public void ButtonClick (object sender, EventArgs e)
{
Modified:
trunk/monodevelop/Extras/AspNetAddIn/Templates/CodeBehindWebForm.xft.xml
===================================================================
--- trunk/monodevelop/Extras/AspNetAddIn/Templates/CodeBehindWebForm.xft.xml
2006-07-21 14:47:23 UTC (rev 62864)
+++ trunk/monodevelop/Extras/AspNetAddIn/Templates/CodeBehindWebForm.xft.xml
2006-07-21 15:31:07 UTC (rev 62865)
@@ -16,7 +16,7 @@
<TemplateFiles>
<AspNetFile name="${Name}.aspx">
<FileText>
- <![CDATA[<%@ Page Language="${Language}"
Inherits="${Namespace}._${Name}" %>
+ <![CDATA[<%@ Page Language="${Language}"
Inherits="${Namespace}.${Name}" %>
${Doctype}
<html>
<head>
@@ -39,7 +39,7 @@
namespace ${Namespace} {
- public class _${Name} : Page
+ public class ${Name} : Page
{
public void onButtonClick (object sender, EventArgs e)
{
Modified:
trunk/monodevelop/Extras/AspNetAddIn/Templates/CodeBehindWebHandler.xft.xml
===================================================================
--- trunk/monodevelop/Extras/AspNetAddIn/Templates/CodeBehindWebHandler.xft.xml
2006-07-21 14:47:23 UTC (rev 62864)
+++ trunk/monodevelop/Extras/AspNetAddIn/Templates/CodeBehindWebHandler.xft.xml
2006-07-21 15:31:07 UTC (rev 62865)
@@ -16,7 +16,7 @@
<TemplateFiles>
<AspNetFile name="${Name}.ashx">
<FileText>
-<![CDATA[<%@ WebHandler Language="${Language}" Class="${Namespace}._${Name}"
%>]]>
+<![CDATA[<%@ WebHandler Language="${Language}" Class="${Namespace}.${Name}"
%>]]>
</FileText>
</AspNetFile>
@@ -29,7 +29,7 @@
namespace ${Namespace} {
- public class _${Name} : IHttpHandler {
+ public class ${Name} : IHttpHandler {
public void ProcessRequest (HttpContext context) {
context.Response.ContentType = "text/plain";
Added:
trunk/monodevelop/Extras/AspNetAddIn/Templates/CodeBehindWebService.xft.xml
===================================================================
--- trunk/monodevelop/Extras/AspNetAddIn/Templates/CodeBehindWebService.xft.xml
2006-07-21 14:47:23 UTC (rev 62864)
+++ trunk/monodevelop/Extras/AspNetAddIn/Templates/CodeBehindWebService.xft.xml
2006-07-21 15:31:07 UTC (rev 62865)
@@ -0,0 +1,44 @@
+<?xml version="1.0"?>
+<Template Originator="Michael Hutchinson"
+ Created="2006/07/13"
+ LastModified="2006/07/13">
+
+ <!-- Template Header -->
+ <TemplateConfiguration>
+ <_Name>Web Service with CodeBehind</_Name>
+ <Category>ASP.NET</Category>
+ <Icon>md-html-file-icon</Icon>
+ <LanguageName>*</LanguageName>
+ <_Description>Creates an ASP.NET web service with a CodeBehind
class.</_Description>
+ </TemplateConfiguration>
+
+ <!-- Template Content -->
+ <TemplateFiles>
+ <AspNetFile name="${Name}.asmx">
+ <FileText>
+<![CDATA[<%@ WebService Language="C#" Class="${Namespace}.${Name}" %>]]>
+ </FileText>
+ </AspNetFile>
+
+ <CodeTranslationFile name="${Name}.asmx.${LanguageExtension}">
+<![CDATA[using System;
+using System.Web.Services;
+
+namespace ${Namespace}
+{
+ class ${Name}
+ {
+
+ [WebMethod]
+ public string SayHello()
+ {
+ return "Hello World";
+ }
+ }
+}]]>
+ </CodeTranslationFile>
+ </TemplateFiles>
+
+ <FileOptions />
+
+</Template>
Added: trunk/monodevelop/Extras/AspNetAddIn/Templates/EmptyWebService.xft.xml
===================================================================
--- trunk/monodevelop/Extras/AspNetAddIn/Templates/EmptyWebService.xft.xml
2006-07-21 14:47:23 UTC (rev 62864)
+++ trunk/monodevelop/Extras/AspNetAddIn/Templates/EmptyWebService.xft.xml
2006-07-21 15:31:07 UTC (rev 62865)
@@ -0,0 +1,45 @@
+<?xml version="1.0"?>
+<Template Originator="Michael Hutchinson"
+ Created="2006/07/13"
+ LastModified="2006/07/13">
+
+ <!-- Template Header -->
+ <TemplateConfiguration>
+ <_Name>Web Service</_Name>
+ <Category>ASP.NET</Category>
+ <Icon>md-html-file-icon</Icon>
+ <LanguageName>*</LanguageName>
+ <_Description>Creates an ASP.NET web service.</_Description>
+ </TemplateConfiguration>
+
+ <!-- Template Content -->
+ <TemplateFiles>
+ <AspNetFile name="${Name}.asmx">
+ <FileText>
+<![CDATA[<%@ WebService Language="C#" Class="${Namespace}.${Name}" %>
+${CodeRegion:script1}
+]]>
+ </FileText>
+ <CodeTranslationFile TagName="script1">
+<![CDATA[using System;
+using System.Web.Services;
+
+namespace ${Namespace}
+{
+ class ${Name}
+ {
+
+ [WebMethod]
+ public string SayHello()
+ {
+ return "Hello World";
+ }
+ }
+}]]>
+ </CodeTranslationFile>
+ </AspNetFile>
+ </TemplateFiles>
+
+ <FileOptions />
+
+</Template>
Modified: trunk/monodevelop/Extras/AspNetAddIn/Templates/WebApplication.xpt.xml
===================================================================
--- trunk/monodevelop/Extras/AspNetAddIn/Templates/WebApplication.xpt.xml
2006-07-21 14:47:23 UTC (rev 62864)
+++ trunk/monodevelop/Extras/AspNetAddIn/Templates/WebApplication.xpt.xml
2006-07-21 15:31:07 UTC (rev 62865)
@@ -33,7 +33,7 @@
<Files>
<AspNetFile name="Default.aspx">
<FileText>
- <![CDATA[<%@ Page
Language="${Language}" Inherits="${Namespace}._${Name}" %>
+ <![CDATA[<%@ Page
Language="${Language}" Inherits="${Namespace}.${Name}" %>
${Doctype}
<html>
<head>
@@ -56,7 +56,7 @@
namespace ${Namespace} {
- public class _${Name} : Page
+ public class ${Name} : Page
{
public void onButtonClick (object sender, EventArgs e)
{
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches