Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

ResultFactoryRegistry Class

A result factory is responsible for create an IResult instance from a given string representation.

For a list of all members of this type, see ResultFactoryRegistry Members .

System.Object
   ResultFactoryRegistry

[Visual Basic]
Public Class ResultFactoryRegistry
[C#]
public class ResultFactoryRegistry

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

Factories get registered with the ResultFactoryRegistry for a certain resultMode string. DefaultResultWebNavigator uses ResultFactoryRegistry for converting strings into IResult instances implementing the corresponding navigation logic.

Result string representations are always of the form:
"<resultmode>:<textual result representation>"
Calling CreateResult on the registry will cause the registry to first extract the leading resultmode to obtain the corresponding IResultFactory instance and handle the actual IResult instantiation by delegating to CreateResult.

The following example illustrates the usual flow:
class MySpecialResultLogic : IResult
{
  ...
}

class MySpecialResultLogicFactory : IResultFactory
{
   IResult Create( string mode, string expression ) { /* ... convert 'expression' into 
MySpecialResultLogic */ }
}

// register with global factory
ResultFactoryRegistry.RegisterResultFactory( "mySpecialMode", new MySpecialResultLogicFactory );

// configure your Results
<object type="mypage.aspx">
   <property name="Results">
      <dictionary>
         <entry key="continue" value="mySpecialMode:<some MySpecialResultLogic string representation>" />
      </dictionary>
   </property>

// on your page call
myPage.SetResult("continue");

Requirements

Namespace: Spring.Web.Support

Assembly: Spring.Web (in Spring.Web.dll)

See Also

ResultFactoryRegistry Members | Spring.Web.Support Namespace | ResultFactoryRegistry | IResult | Result | DefaultResultWebNavigator | SetResult | SetResult