var routeCollection = ...; // this.Url.RouteCollection 
var requestContext = ...; // this.RequestContext
var controllerType = typeof(MyController);
var apiJson = new System.Text.StringBuilder();
var output = new JsonStringBuilderWriter(text);
var description = Sencha.Direct.Api.DescriptionCache.GetControllerDescription(controllerType);
var routerUrl = description.GetRouterUrl(requestContext, routeCollection);

output.WriteJson("Ext.Direct.addProvider(");
output.WriteObjectBegin();
output.WriteMember("url", routerUrl);
output.WriteMember("type", "remoting");
output.WriteMember("namespace", description.Namespace);
output.WriteMember("actions");
description.SerializeTo(output);
output.WriteObjectEnd();
output.WriteJson(");\r\n");
output.Flush();

var api = apiJson.ToString();

Last edited Apr 27, 2012 at 3:17 PM by ShaiHulud, version 1

Comments

No comments yet.