Exemple #1
0
    public IController CreateController(RequestContext context, string controllerName)
    {
        IController controller          = null;
        string      controllerClassName = string.Format("{0}Controller", controllerName);

        if (SpringApplicationContext.Contains(controllerClassName))
        {
            controller          = SpringApplicationContext.Resolve <IController>(controllerClassName);
            this.RequestContext = context;
        }
        else
        {
            controller = base.CreateController(context, controllerName);
        }
        return(controller);
    }
Exemple #2
0
 /// <summary>
 /// Returns a boolean value if the current application context contains an named object.
 /// </summary>
 /// <param name="objectName">Accepts the name of the object to check.</param>
 public static bool Contains(string objectName)
 {
     SpringApplicationContext.EnsureContext();
     return(SpringApplicationContext.Context.ContainsObject(objectName));
 }
Exemple #3
0
 /// <summary>
 /// Return a instance of an object in the context by the specified name and type.
 /// </summary>
 /// <typeparam name="T">Accepts the type of the object to resolve.</typeparam>
 /// <param name="objectName">Accepts a string object name.</param>
 public static T Resolve <T>(string objectName)
 {
     return((T)SpringApplicationContext.Resolve(objectName));
 }
Exemple #4
0
 /// <summary>
 /// Return a instance of an object in the context by the specified name.
 /// </summary>
 /// <param name="objectName">Accepts a string object name.</param>
 public static object Resolve(string objectName)
 {
     SpringApplicationContext.EnsureContext();
     return(SpringApplicationContext.Context.GetObject(objectName));
 }