void BuildInitializers(FormatterKind formatter)
        {
            Hashtable types = new Hashtable();

            foreach (HttpSimpleMethodStubInfo met in Methods)
            {
                AddType(types, met.GetFormatterInfo(formatter).Type, met);
            }

            foreach (DictionaryEntry ent in types)
            {
                Type                t    = (Type)ent.Key;
                ArrayList           list = (ArrayList)ent.Value;
                LogicalMethodInfo[] mets = new LogicalMethodInfo [list.Count];
                for (int n = 0; n < list.Count; n++)
                {
                    mets[n] = ((MethodStubInfo)list[n]).MethodInfo;
                }

                object[] inits = MimeFormatter.GetInitializers(t, mets);

                for (int n = 0; n < list.Count; n++)
                {
                    ((HttpSimpleMethodStubInfo)list[n]).GetFormatterInfo(formatter).Initializer = inits[n];
                }
            }
        }
Beispiel #2
0
		public MimeFormatterInfo GetFormatterInfo (FormatterKind kind)
		{
			switch (kind)
			{
				case FormatterKind.ParameterWriter: return ParameterWriterType;
				case FormatterKind.ParameterReader: return ParameterReaderType;
				case FormatterKind.ReturnReader: return ReturnReaderType;
				case FormatterKind.ReturnWriter: return ReturnWriterType;
			}
			return null;
		}
Beispiel #3
0
        public MimeFormatterInfo GetFormatterInfo(FormatterKind kind)
        {
            switch (kind)
            {
            case FormatterKind.ParameterWriter: return(ParameterWriterType);

            case FormatterKind.ParameterReader: return(ParameterReaderType);

            case FormatterKind.ReturnReader: return(ReturnReaderType);

            case FormatterKind.ReturnWriter: return(ReturnWriterType);
            }
            return(null);
        }
Beispiel #4
0
		void BuildInitializers (FormatterKind formatter)
		{
			Hashtable types = new Hashtable ();

			foreach (HttpSimpleMethodStubInfo met in Methods)
				AddType (types, met.GetFormatterInfo (formatter).Type, met);
			
			foreach (DictionaryEntry ent in types)
			{
				Type t = (Type)ent.Key;
				ArrayList list = (ArrayList)ent.Value;
				LogicalMethodInfo[] mets = new LogicalMethodInfo [list.Count];
				for (int n=0; n<list.Count; n++) 
					mets[n] = ((MethodStubInfo)list[n]).MethodInfo;

				object[] inits = MimeFormatter.GetInitializers (t, mets);

				for (int n=0; n<list.Count; n++)
					((HttpSimpleMethodStubInfo)list[n]).GetFormatterInfo (formatter).Initializer = inits[n];
			}
		}