예제 #1
0
        /// <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);
        }
예제 #2
0
        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));
                }
            }
        }
예제 #3
0
		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));
					}
				}
		}
예제 #4
0
		/// <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);
		}