diff --git a/doc/reference/src/images/resharper-live-prop-def.png b/doc/reference/src/images/resharper-live-prop-def.png new file mode 100644 index 00000000..c6b96b92 Binary files /dev/null and b/doc/reference/src/images/resharper-live-prop-def.png differ diff --git a/doc/reference/src/images/resharper-live-templates.png b/doc/reference/src/images/resharper-live-templates.png index 9c3defb1..e1efc005 100644 Binary files a/doc/reference/src/images/resharper-live-templates.png and b/doc/reference/src/images/resharper-live-templates.png differ diff --git a/doc/reference/src/images/resharper-property-ref-1.png b/doc/reference/src/images/resharper-property-ref-1.png new file mode 100644 index 00000000..bd4cc8b6 Binary files /dev/null and b/doc/reference/src/images/resharper-property-ref-1.png differ diff --git a/doc/reference/src/images/resharper-property-ref-2.png b/doc/reference/src/images/resharper-property-ref-2.png new file mode 100644 index 00000000..bd42ee95 Binary files /dev/null and b/doc/reference/src/images/resharper-property-ref-2.png differ diff --git a/doc/reference/src/images/resharper-property-ref-3.png b/doc/reference/src/images/resharper-property-ref-3.png new file mode 100644 index 00000000..46de3ec0 Binary files /dev/null and b/doc/reference/src/images/resharper-property-ref-3.png differ diff --git a/doc/reference/src/images/resharper-type-completion-1.png b/doc/reference/src/images/resharper-type-completion-1.png new file mode 100644 index 00000000..1d7d05e3 Binary files /dev/null and b/doc/reference/src/images/resharper-type-completion-1.png differ diff --git a/doc/reference/src/images/resharper-type-completion-2.png b/doc/reference/src/images/resharper-type-completion-2.png new file mode 100644 index 00000000..ebab0bdc Binary files /dev/null and b/doc/reference/src/images/resharper-type-completion-2.png differ diff --git a/doc/reference/src/images/resharper-type-completion-3.png b/doc/reference/src/images/resharper-type-completion-3.png new file mode 100644 index 00000000..88934cbb Binary files /dev/null and b/doc/reference/src/images/resharper-type-completion-3.png differ diff --git a/doc/reference/src/images/resharper-type-completion-4.png b/doc/reference/src/images/resharper-type-completion-4.png new file mode 100644 index 00000000..b726989c Binary files /dev/null and b/doc/reference/src/images/resharper-type-completion-4.png differ diff --git a/doc/reference/src/images/vsnet-solution-templates.png b/doc/reference/src/images/vsnet-solution-templates.png new file mode 100644 index 00000000..177e5fe0 Binary files /dev/null and b/doc/reference/src/images/vsnet-solution-templates.png differ diff --git a/doc/reference/src/vsnet.xml b/doc/reference/src/vsnet.xml index 08c15b41..db6fcf86 100644 --- a/doc/reference/src/vsnet.xml +++ b/doc/reference/src/vsnet.xml @@ -16,7 +16,12 @@ * limitations under the License. */ --> - + Visual Studio.NET Integration @@ -24,21 +29,17 @@ XML Editing and Validation - - Most of this section is well travelled territory for those familiar with editing XML files in their favorite XML editor. The XML configuration data that defines the objects that Spring will manage for you are validated against the Spring.NET XML Schema at runtime. The location of the XML configuration data to create an IApplicationContext can be any of the resource - locations supported by Spring's IResource - abstraction. (See for more - information.) To create an IApplicationContext - using a "standalone" XML configuration file the custom configuration - section in the standard .NET application configuration would read: - - + locations supported by Spring's IResource abstraction. + (See for more information.) To create + an IApplicationContext using a "standalone" XML + configuration file the custom configuration section in the standard .NET + application configuration would read: <spring> @@ -48,15 +49,15 @@ </spring> - The VS.NET 2005 XML editor can use the attribute - - xsi:schemaLocation - - as a hint to associate the physical location of a schema file with the XML document being edited. VS.NET 2002/2003 do not recognize the - - xsi:schemaLocation - - element. If you reference the Spring.NET XML schema as shown below, you can get intellisense and validation support while editing a Spring configuration file in VS.NET 2005. In order to get this functionality in VS.NET 2002/2003 you will need to register the schema with VS.NET or include the schema as part of your application project. + The VS.NET 2005 or later, the XML editor uses the attribute + xsi:schemaLocation as a hint to associate the physical + location of a schema file with the XML document being edited. VS.NET + 2002/2003 do not recognize the xsi:schemaLocation + element. If you reference the Spring.NET XML schema as shown below, you + can get intellisense and validation support while editing a Spring + configuration file in VS.NET 2005/2008. In order to get this functionality + in VS.NET 2002/2003 you will need to register the schema with VS.NET or + include the schema as part of your application project. <?xml version="1.0" encoding="UTF-8"?> <objects xmlns="http://www.springframework.net" @@ -71,52 +72,66 @@ ... </objects> - - It is typically more convenient to install the schema in VS.NET, - even for VS.NET 2005, as it makes the xml a little less verbose and you - don't need to keep copying the XSD file for each project you create. For - VS.NET 2003 the schema directory will be either + even for VS.NET 2005/2008, as it makes the xml a little less verbose and + you don't need to keep copying the XSD file for each project you create. + For VS.NET 2003 the schema directory is - + + - <para><literal>C:\Program Files\Microsoft Visual Studio .NET - 2003\Common7\Packages\schemas\xml</literal> for VS 2003</para> + <tgroup cols="2"> + <thead> + <row> + <entry align="center">Visual Studio VersionĀ </entry> - + <entry align="center">Directory to put Spring .XSD filesĀ </entry> + </row> + </thead> - <para>or</para> + <tbody> + <row> + <entry>VS.NET 2003</entry> - + <entry> + <literal>C:\Program Files\Microsoft Visual Studio .NET + 2003\Common7\Packages\schemas\xml</literal> + </entry> + </row> - <para><literal>C:\Program Files\Microsoft Visual Studio - .NET\Common7\Packages\schemas\xml</literal> for VS.NET 2002</para> + <row> + <entry>VS.NET 2005</entry> - + <entry> + <literal>C:\Program Files\Microsoft Visual Studio + 8\Xml\Schemas</literal> + </entry> + </row> - <para>The VS.NET 2005 directory for XML schemas is</para> + <row> + <entry>VS.NET 2008</entry> - + <entry> + <literal>C:\Program Files\Microsoft Visual Studio + 9.0\Xml\Schemas</literal> + </entry> + </row> + </tbody> + </tgroup> + </table> - <para> - <literal>C:\Program Files\Microsoft Visual Studio - 8\Xml\Schemas</literal> - </para> - - + <table> + <title /> + </table> <para>Spring's .xsd schemas are located in the directory doc/schema. In that directory is also a NAnt build file to help copy over the .xsd files to the appropriate VS.NET locations. To execute this script simply type '<literal>nant</literal>' in the doc/schema directory.</para> - - <para>Once you have registered the schema with VS.NET you can adding only the namespace declaration to the objects element,</para> - - <para> <programlisting language="myxml"><?xml version="1.0" encoding="UTF-8"?> <objects xmlns="http://www.springframework.net"> @@ -138,17 +153,12 @@ targetSchema property in the Property Sheet for the configuration file.</para> - - <para>As shown in the section <xref linkend="objects-factory-client" /> Spring.NET supports using .NET's application configuration file as the location to store the object definitions that will be managed by the object factory.</para> - - - <programlisting language="myxml"> -<configuration> + <programlisting language="myxml"><configuration> <configSections> <sectionGroup name="spring"> @@ -174,48 +184,149 @@ - <para>In this case VS.NET 2002/2003 will still provide you with - intellisense help but you will not be able to fully validate the document - as the entire schema for App.config is not known. To be able to validate - this document one would need to install the <ulink + <para>In this case VS.NET 2003 will still provide you with intellisense + help but you will not be able to fully validate the document as the entire + schema for App.config is not known. To be able to validate this document + one would need to install the <ulink url="http://www.radsoftware.com.au/articles/intellisensewebconfig.aspx">.NET Configuration File schema</ulink> and an additional schema that incorporates the <literal><spring></literal> and <literal><context></literal> section in addition to the <literal><objects></literal> would need to be created.</para> - - - <para>Validating schema is a new feature in VS 2005 it is validating all - the time while you edit, you will see any errors that it finds in the - Error List window.</para> - - + <para>Validating schema is a new feature in VS 2005 or later. It is + validating all the time while you edit, you will see any errors that it + finds in the Error List window.</para> <para>Keep these trade offs in mind as you decide where to place the bulk of your configuration information. Conventional wisdom is do quick prototyping with App.config and use another IResource location, file or embedded assembly resource, for serious development.</para> + </sect1> - + <sect1> + <title>XML Type Completion in VS.NET using Resharper + + Resharper supports intellisence completion for the value of the type + attribute when editing Spring's XML files. The key combination is + Shift+Alt+Space. This is shown below for the case of specifying the type + of a DAO object in the NHibernate sample application + + + + + + + + You start to type the name of the class and will get a filter list. + In this case we are typing HibernateOrderDao. + + + + + + + + Hittingn 'enter' will then insert the fully qualfied type name with + the namespace but not the assembly reference. To add the assembly + reference either hit 'CTRL+ENTER" or select the yellow 'light bulb' to and + select 'add module qualification'. + + + + + + + + You will need to remove the extraneous 'Verstion' information. This + will leave you with the following object definition. + + + + + + + + If you use Spring's autowiring functionality, then you can even + avoid having to type the property information when referring to + collaborating objects. See . + for more information on autowiring. + + + + Resharper templates + + Resharper offers live templates for assistance while coding as well + as file templates. Spring 1.3 provides a few of each type to help you be + more efficient when performing common configuration related tasks. To + install the templates follow the directions in the 'dev-support' + directory. One installed the following templates are available + + + + + + + + + + + + + + + + For example, to set a property reference for the object definition + from the previous chapter, type 'odref' and you will be prompted to hit + 'tab' to complete the XML fragment. + + + + + + + + Hitting tab will generate the XML to use for an object property + values, object constructors and object definitions. + + + + + + + + You will need to type the name of the property and name of the + reference. Unfortunately, intellisence for property completion and ref + completion is not available. Typing the missing information in then leaves + the completed object definition. + + + + + + + + There are similar live templates for object definitions, object + property values, and object constructors. Versions of XML Schema - The schema was updated from Spring 1.0.1 to 1.0.2 in order to - support generics. The schema for version 1.0.1 is located under - http://www.springframework.net/xsd/1.0.1/ The schema - for the latest version will always be located under - http://www.springframework.net/xsd/ + The latest version of the schema will always be located under + http://www.springframework.net/xsd/ The filename of the + .xsd files contains the first Spring.NET version to which they apply. + - Integrated API help + API documentation Spring provides API documentation that can be integrated within - Visual Studio. There are two versions of the documentation, one for VS.NET - 2002/2003 and the other for VS 2005. They differ only in the format - applied, VS 2005 using the sexy new format. Enjoy! + Visual Studio. There are two versions of the documentation, one for .NET + 1.1 and one for .NET 2.0/3.0. They differ only in the format applied and + the versions of VS.NET that supported. There is also standalone HTMLHELP + format API documentation. You will need to download the help file + seperately from the distribution. - \ No newline at end of file +