Ejemplo n.º 1
0
		public static IDictionary GetAttributesDictionaryFrom(string attributes)
		{
			IDictionary attributesDictionary = new DictHelper.MonoRailDictionary();
			MatchCollection matches = Internal.RegularExpressions.Attributes.Matches(attributes);
			DoSomethingWithAttributes(matches,
				delegate (string name, string value)
				{
					attributesDictionary.Add(name, value);
				});
			return attributesDictionary;
		}
Ejemplo n.º 2
0
		internal static IDictionary ConvertArgumentsToParameters(object[] arguments)
		{
			if (arguments.Length % 2 != 0)
				throw new AspViewException("Parameters should be arranged as key and value pairs");
			int i = 0;
			IDictionary parameters = new DictHelper.MonoRailDictionary();
			while (i < arguments.Length)
			{
				string name = arguments[i] as string;
				if (name == null)
					throw new AspViewException("Parameters should be arranged as key and value pairs");
				object key = arguments[i + 1];
				parameters.Add(name, key);
				i += 2;
			}
			return parameters;
		}