/// <summary> /// Adds XPathNavigable representations of the items in the propertybag /// of the controller. /// </summary> /// <param name="controller">The controller.</param> /// <param name="arguments">The arguments.</param> private static void AddPropertyBag(IRailsEngineContext railscontext, IController controller, XsltTransformationArguments arguments) { ObjectXPathContext context = new ObjectXPathContext(); //For each object in the property bag build an ObjectXPathNavigator to //create an XPath-able represenation of that object foreach (String key in controller.PropertyBag.Keys) { object value = controller.PropertyBag[key]; if (value != null) { arguments.AddParam(key, string.Empty, context.CreateNavigator(value)); } } arguments.AddParam("context", string.Empty, context.CreateNavigator(railscontext)); //arguments.AddExtensionObject("urn:request", context.Request); //arguments.AddExtensionObject("urn:response", context.Response); //arguments.AddExtensionObject("urn:server", context.Server); //arguments.AddExtensionObject("urn:session", context.Session); }
private static void AddFlash(IRailsEngineContext context, XsltTransformationArguments arguments) { if (context.Flash.Keys.Count == 0) { return; } ObjectXPathContext ocontext = new ObjectXPathContext(); //For each object in the flash build an ObjectXPathNavigator to //create an XPath-able represenation of that object foreach (String key in context.Flash.Keys) { object value = context.Flash[key]; if (value != null) { arguments.AddParam(key, string.Empty, ocontext.CreateNavigator(value)); } } }
private static void AddFlash(IRailsEngineContext context, XsltTransformationArguments arguments) { if (context.Flash.Keys.Count == 0) return; ObjectXPathContext ocontext = new ObjectXPathContext(); //For each object in the flash build an ObjectXPathNavigator to //create an XPath-able represenation of that object foreach (String key in context.Flash.Keys) { object value = context.Flash[key]; if (value != null) { arguments.AddParam(key, string.Empty, ocontext.CreateNavigator(value)); } } }