public static IDictionary GetAttributesDictionaryFrom(string attributes) { IDictionary attributesDictionary = new DictHelper.MonoRailDictionary(); var matches = Internal.RegularExpressions.Attributes.Matches(attributes); DoSomethingWithAttributes(matches, delegate(string name, string value) { attributesDictionary.Add(name, value); }); return(attributesDictionary); }
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); }