Format changes
Mainly C# / XML syntax highlighting, some outlining too.
This commit is contained in:
@@ -204,7 +204,7 @@
|
||||
</objects></programlisting>The following example shows the data access
|
||||
objects <literal>(daos.xml)</literal> configuration file:</para>
|
||||
|
||||
<programlisting><objects xmlns="http://www.springframework.net">
|
||||
<programlisting language="myxml"><objects xmlns="http://www.springframework.net">
|
||||
|
||||
<object id="AccountDao" type="Petstore.Dao.HibernateAccountDao, PetStore">
|
||||
<!-- additional collaborators and configuration for this object go here -->
|
||||
@@ -695,7 +695,7 @@ IList userList = service.GetUserNames();
|
||||
all three names refer to the same object you add to the MyApp
|
||||
configuration metadata the following aliases definitions:</para>
|
||||
|
||||
<programlisting><alias name="SubsystemA-DbProvider" alias="SubsystemB-DbProvider"/>
|
||||
<programlisting language="myxml"><alias name="SubsystemA-DbProvider" alias="SubsystemB-DbProvider"/>
|
||||
<alias name="SubsystemA-DbProvider" alias="MyApp-DbProvider"/></programlisting>
|
||||
|
||||
<para>Now each component and the main app can refer to the
|
||||
@@ -1552,7 +1552,7 @@ public class ExampleObject
|
||||
|
||||
<object id="anotherExampleObject" type="Examples.AnotherObject, ExamplesLibrary"/>
|
||||
<object id="yetAnotherObject" type="Examples.YetAnotherObject, ExamplesLibrary"/></programlisting>
|
||||
<programlisting language="csharp">[Visual Basic.NET]
|
||||
<programlisting language="vb">[Visual Basic.NET]
|
||||
Public Class ExampleObject
|
||||
|
||||
Private myObjectOne As AnotherObject
|
||||
@@ -1807,7 +1807,7 @@ public class MixedIocObject
|
||||
name as the parent object.<programlisting language="myxml"><!-- in the parent context -->
|
||||
<object id="AccountService" type="MyApp.SimpleAccountService, MyApp">
|
||||
<!-- insert dependencies as required as here -->
|
||||
</object></programlisting><programlisting><!-- in the child (descendant) context -->
|
||||
</object></programlisting><programlisting language="myxml"><!-- in the child (descendant) context -->
|
||||
<object id="AccountService" <-- notice that the name of this object is the same as the name of the 'parent' object
|
||||
type="Spring.Aop.Framework.ProxyFactoryObject, Spring.Aop">
|
||||
<property name="target">
|
||||
@@ -2058,24 +2058,24 @@ public class MixedIocObject
|
||||
|
||||
<para>The following example demonstrates collection merging:</para>
|
||||
|
||||
<programlisting> <object id="parent" abstract="true" type="Example.ComplexObject, Examples">
|
||||
<property name="AdminEmails">
|
||||
<name-values>
|
||||
<add key="administrator" value="administrator@example.com"/>
|
||||
<add key="support" value="support@example.com"/>
|
||||
</name-values>
|
||||
</property>
|
||||
</object>
|
||||
<programlisting language="myxml"><object id="parent" abstract="true" type="Example.ComplexObject, Examples">
|
||||
<property name="AdminEmails">
|
||||
<name-values>
|
||||
<add key="administrator" value="administrator@example.com"/>
|
||||
<add key="support" value="support@example.com"/>
|
||||
</name-values>
|
||||
</property>
|
||||
</object>
|
||||
|
||||
<object id="child" parent="parent" >
|
||||
<property name="AdminEmails">
|
||||
<!-- the merge is specified on the *child* collection definition -->
|
||||
<name-values merge="true">
|
||||
<add key="sales" value="sales@example.com"/>
|
||||
<add key="support" value="support@example.co.uk"/>
|
||||
</name-values>
|
||||
</property>
|
||||
</object></programlisting>
|
||||
<object id="child" parent="parent" >
|
||||
<property name="AdminEmails">
|
||||
<!-- the merge is specified on the *child* collection definition -->
|
||||
<name-values merge="true">
|
||||
<add key="sales" value="sales@example.com"/>
|
||||
<add key="support" value="support@example.co.uk"/>
|
||||
</name-values>
|
||||
</property>
|
||||
</object></programlisting>
|
||||
|
||||
<para>Notice the use of the <literal>merge=true</literal> attribute on
|
||||
the <literal><name-values/></literal> element of the
|
||||
@@ -2085,11 +2085,11 @@ public class MixedIocObject
|
||||
<literal>AdminEmails</literal> Properties collection that contains the
|
||||
result of the merging of the child's <literal>AdminEmails</literal>
|
||||
collection with the parent's <literal>AdminEmails</literal>
|
||||
collection.</para>
|
||||
collection:</para>
|
||||
|
||||
<programlisting>administrator=administrator@example.com
|
||||
sales=sales@example.com
|
||||
support=support@example.co.uk</programlisting>
|
||||
<programlisting>administrator=administrator@example.com // from parent
|
||||
sales=sales@example.com // from child
|
||||
support=support@example.co.uk // overriden by child</programlisting>
|
||||
|
||||
<para>The child Properties collection's value set inherits all
|
||||
property elements from the parent
|
||||
@@ -3920,17 +3920,21 @@ public sealed class Font : MarshalByRefObject, ICloneable, ISerializable, IDispo
|
||||
specify the name of the method that has a void no-argument signature.
|
||||
For example, the following definition:</para>
|
||||
|
||||
<para><programlisting language="myxml"><object id="exampleInitObject" type="Examples.ExampleObject" init-method="init"/>
|
||||
[C#]
|
||||
public class ExampleObject
|
||||
{
|
||||
public void Init()
|
||||
<para><programlisting language="myxml"><object id="exampleInitObject" type="Examples.ExampleObject" init-method="init"/></programlisting></para>
|
||||
|
||||
<para> <programlisting language="csharp">[C#]
|
||||
public class ExampleObject
|
||||
{
|
||||
public void Init()
|
||||
{
|
||||
// do some initialization work
|
||||
}
|
||||
}</programlisting>...is exactly the same as... <programlisting
|
||||
language="myxml"><object id="exampleInitObject" type="Examples.AnotherExampleObject"/>
|
||||
[C#]
|
||||
// do some initialization work
|
||||
}
|
||||
}</programlisting></para>
|
||||
|
||||
<para>...is exactly the same as...</para>
|
||||
|
||||
<para><programlisting language="myxml"><object id="exampleInitObject" type="Examples.AnotherExampleObject"/></programlisting><programlisting
|
||||
language="csharp">[C#]
|
||||
public class AnotherExampleObject : IInitializingObject
|
||||
{
|
||||
public void AfterPropertiesSet()
|
||||
@@ -3968,16 +3972,9 @@ public class AnotherExampleObject : IInitializingObject
|
||||
method that has a void no-argument signature. For example, the
|
||||
following definition:</para>
|
||||
|
||||
<para><programlisting language="myxml"><object id="exampleInitObject" type="Examples.ExampleObject" destroy-method="cleanup"/>
|
||||
[C#]
|
||||
public class ExampleObject
|
||||
{
|
||||
public void cleanup()
|
||||
{
|
||||
// do some destruction work (such as closing any open connection (s))
|
||||
}
|
||||
}</programlisting> is exactly the same as: <programlisting language="myxml"><object id="exampleInitObject" type="Examples.AnotherExampleObject"/>
|
||||
[C#]
|
||||
<para><programlisting language="myxml"><object id="exampleInitObject" type="Examples.AnotherExampleObject" /></programlisting></para>
|
||||
|
||||
<para><programlisting language="csharp">[C#]
|
||||
public class AnotherExampleObject : IDisposable
|
||||
{
|
||||
public void Dispose()
|
||||
@@ -3996,10 +3993,9 @@ public class AnotherExampleObject : IDisposable
|
||||
interface, the class is provided with a reference to that
|
||||
<classname>IApplicationContext</classname>.</para>
|
||||
|
||||
<programlisting>public interface IApplicationContextAware {
|
||||
IApplicationContext ApplicationContext {
|
||||
set;
|
||||
}
|
||||
<programlisting language="csharp">public interface IApplicationContextAware
|
||||
{
|
||||
IApplicationContext ApplicationContext { set; }
|
||||
}</programlisting>
|
||||
|
||||
<para>Thus objects can manipulate programmatically the
|
||||
@@ -4026,10 +4022,9 @@ public class AnotherExampleObject : IDisposable
|
||||
the class is provided with a reference to the name defined in its
|
||||
associated object definition.</para>
|
||||
|
||||
<programlisting>public interface IObjectNameAware {
|
||||
string ObjectName {
|
||||
set;
|
||||
}
|
||||
<programlisting language="csharp">public interface IObjectNameAware
|
||||
{
|
||||
string ObjectName { set; }
|
||||
}</programlisting>
|
||||
|
||||
<para>The callback is invoked after population of normal object
|
||||
@@ -4835,11 +4830,9 @@ cfg.PostProcessObjectFactory(factory);</programlisting></para>
|
||||
<para>In an ASP.NET environment you must specify the full, four-part
|
||||
name of the assembly when using a
|
||||
<literal>NameValueFileSectionHandler</literal> <programlisting
|
||||
language="myxml">
|
||||
<section name="hibernateConfiguration"
|
||||
type="System.Configuration.NameValueFileSectionHandler, System,
|
||||
Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
|
||||
</programlisting></para>
|
||||
language="myxml"><section name="hibernateConfiguration"
|
||||
type="System.Configuration.NameValueFileSectionHandler, System,
|
||||
Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/></programlisting></para>
|
||||
</note>
|
||||
|
||||
<sect4>
|
||||
@@ -4937,8 +4930,8 @@ cfg.PostProcessObjectFactory(factory);</programlisting></para>
|
||||
</configuration></programlisting> Then the value of 1000 will be used to
|
||||
overlay the value of 2000 set in the Spring.NET configuration file
|
||||
shown below <programlisting language="myxml"><objects xmlns="http://www.springframework.net"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.net http://www.springframework.net/xsd/spring-objects.xsd" >
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.net http://www.springframework.net/xsd/spring-objects.xsd" >
|
||||
|
||||
<object name="productDao" type="PropPlayApp.SimpleProductDao, PropPlayApp " >
|
||||
<property name="maxResults" value="2000"/>
|
||||
|
||||
Reference in New Issue
Block a user