Castle.MonoRail.Framework.Internal.JSElementGeneratorBase.InternalInvoke C# (CSharp) Method

InternalInvoke() protected method

Dispatches the invocation (late bound)
protected InternalInvoke ( string method, object args ) : object
method string The method.
args object The args.
return object
		protected object InternalInvoke(string method, object[] args)
		{
			if (method == "set")
			{
				PrototypeHelper.JSGenerator.RemoveTail(parentGenerator);

				PrototypeHelper.JSGenerator.Record(parentGenerator, " = " + args[0]);

				return null;
			}
			else
			{
				PrototypeHelper.JSGenerator.ReplaceTailByPeriod(parentGenerator);
				//TODO: This code is duplicated JSCollectionGeneratorBase line 65
				DynamicDispatchSupport dispInterface = generator as DynamicDispatchSupport;
				if (dispInterface == null)
				{
					throw new MonoRail.Framework.RailsException("JS Generators must inherit DynamicDispatchSupport");
				}
				if (dispInterface.IsGeneratorMethod(method))
				{
					dispInterface.Dispatch(method, args);
				}
				else
				{
					parentGenerator.Call(method, args);
				}

				return this;
			}
		}
	}