public LogicalMethodInfo (LogicalTypeInfo typeInfo, MethodInfo method) {
				_typeInfo = typeInfo;
				_methodInfo = method;

				_wma = (WebMethodAttribute) Attribute.GetCustomAttribute (method, typeof (WebMethodAttribute));

				_sma = (ScriptMethodAttribute) Attribute.GetCustomAttribute (method, typeof (ScriptMethodAttribute));
				if (_sma == null)
					_sma = ScriptMethodAttribute.Default;

				_params = MethodInfo.GetParameters ();

				if (HasParameters) {
					_paramMap = new Dictionary<string, int> (_params.Length, StringComparer.Ordinal);
					for (int i = 0; i < _params.Length; i++)
						_paramMap.Add(_params[i].Name, i);
				}

				if (ScriptMethod.ResponseFormat == ResponseFormat.Xml
					&& MethodInfo.ReturnType != typeof (void)) {
					Type retType = MethodInfo.ReturnType;
					if (Type.GetTypeCode (retType) != TypeCode.String || ScriptMethod.XmlSerializeString)
						_xmlSer = new XmlSerializer (retType);
				}
			}
Пример #2
0
            public LogicalMethodInfo(LogicalTypeInfo typeInfo, MethodInfo method)
            {
                _typeInfo   = typeInfo;
                _methodInfo = method;

                _wma = (WebMethodAttribute)Attribute.GetCustomAttribute(method, typeof(WebMethodAttribute));

                _sma = (ScriptMethodAttribute)Attribute.GetCustomAttribute(method, typeof(ScriptMethodAttribute));
                if (_sma == null)
                {
                    _sma = ScriptMethodAttribute.Default;
                }

                _params = MethodInfo.GetParameters();

                if (HasParameters)
                {
                    _paramMap = new Dictionary <string, int> (_params.Length, StringComparer.Ordinal);
                    for (int i = 0; i < _params.Length; i++)
                    {
                        _paramMap.Add(_params[i].Name, i);
                    }
                }

                if (ScriptMethod.ResponseFormat == ResponseFormat.Xml &&
                    MethodInfo.ReturnType != typeof(void))
                {
                    Type retType = MethodInfo.ReturnType;
                    if (Type.GetTypeCode(retType) != TypeCode.String || ScriptMethod.XmlSerializeString)
                    {
                        _xmlSer = new XmlSerializer(retType);
                    }
                }
            }
Пример #3
0
			protected LogicalMethodInfo (LogicalTypeInfo typeInfo, MethodInfo method)
			{
				_methodInfo = method;
				_params = MethodInfo.GetParameters ();

				if (HasParameters) {
					_paramMap = new Dictionary<string, int> (_params.Length, StringComparer.Ordinal);
					for (int i = 0; i < _params.Length; i++)
						_paramMap.Add(_params[i].Name, i);
				}

			}
Пример #4
0
            protected LogicalMethodInfo(LogicalTypeInfo typeInfo, MethodInfo method)
            {
                _methodInfo = method;
                _params     = MethodInfo.GetParameters();
                _typeInfo   = typeInfo;

                if (HasParameters)
                {
                    _paramMap = new Dictionary <string, int> (_params.Length, StringComparer.Ordinal);
                    for (int i = 0; i < _params.Length; i++)
                    {
                        _paramMap.Add(_params[i].Name, i);
                    }
                }
            }
Пример #5
0
        static internal LogicalTypeInfo GetLogicalTypeInfo(Type t, string filePath)
        {
            Hashtable       type_to_manager = _type_to_logical_type;
            LogicalTypeInfo tm = (LogicalTypeInfo)type_to_manager [t];

            if (tm != null)
            {
                return(tm);
            }

            tm = CreateTypeInfo(t, filePath);
            type_to_manager [t] = tm;

            return(tm);
        }
Пример #6
0
        private RestHandler(HttpContext context, Type type, string filePath)
        {
            LogicalTypeInfo logicalTypeInfo = LogicalTypeInfo.GetLogicalTypeInfo(type, filePath);
            HttpRequest     request         = context.Request;
            string          methodName      = request.PathInfo.Substring(1);

            if (logicalTypeInfo == null || String.IsNullOrEmpty(methodName))
            {
                ThrowInvalidOperationException(methodName);
            }

            _logicalMethodInfo = logicalTypeInfo [methodName];
            if (_logicalMethodInfo == null)
            {
                ThrowInvalidOperationException(methodName);
            }
        }
Пример #7
0
            public AsmxLogicalMethodInfo(LogicalTypeInfo typeInfo, MethodInfo method)
                : base(typeInfo, method)
            {
                _typeInfo = typeInfo;

                _wma = (WebMethodAttribute)Attribute.GetCustomAttribute(method, typeof(WebMethodAttribute));

                _sma = (ScriptMethodAttribute)Attribute.GetCustomAttribute(method, typeof(ScriptMethodAttribute));
                if (_sma == null)
                {
                    _sma = ScriptMethodAttribute.Default;
                }

                if (ScriptMethod.ResponseFormat == ResponseFormat.Xml &&
                    MethodInfo.ReturnType != typeof(void))
                {
                    Type retType = MethodInfo.ReturnType;
                    if (Type.GetTypeCode(retType) != TypeCode.String || ScriptMethod.XmlSerializeString)
                    {
                        _xmlSer = new XmlSerializer(retType);
                    }
                }
            }
Пример #8
0
			public WcfLogicalMethodInfo (LogicalTypeInfo typeInfo, OperationDescription od)
				: base (typeInfo, od.SyncMethod)
			{
				this.od = od;
			}
Пример #9
0
			public AsmxLogicalMethodInfo (LogicalTypeInfo typeInfo, MethodInfo method)
				: base (typeInfo, method)
			{
				_typeInfo = typeInfo;

				_wma = (WebMethodAttribute) Attribute.GetCustomAttribute (method, typeof (WebMethodAttribute));

				_sma = (ScriptMethodAttribute) Attribute.GetCustomAttribute (method, typeof (ScriptMethodAttribute));
				if (_sma == null)
					_sma = ScriptMethodAttribute.Default;

				if (ScriptMethod.ResponseFormat == ResponseFormat.Xml
					&& MethodInfo.ReturnType != typeof (void)) {
					Type retType = MethodInfo.ReturnType;
					if (Type.GetTypeCode (retType) != TypeCode.String || ScriptMethod.XmlSerializeString)
						_xmlSer = new XmlSerializer (retType);
				}
			}
Пример #10
0
 public WcfLogicalMethodInfo(LogicalTypeInfo typeInfo, OperationDescription od)
     : base(typeInfo, od.SyncMethod)
 {
     this.od = od;
 }
Пример #11
0
 public static string GetClientProxyScript(Type type, string path, bool debug)
 {
     return(LogicalTypeInfo.GetLogicalTypeInfo(type, path).Proxy);
 }
Пример #12
0
		public ClientProxyHandler (Type type, string filePath)
		{
			_type = type;
			_logicalTypeInfo = LogicalTypeInfo.GetLogicalTypeInfo (type, filePath);
		}
Пример #13
0
 public ClientProxyHandler(Type type, string filePath)
 {
     _type            = type;
     _logicalTypeInfo = LogicalTypeInfo.GetLogicalTypeInfo(type, filePath);
 }
		static internal LogicalTypeInfo GetLogicalTypeInfo (Type t, string filePath) {
			Hashtable type_to_manager = _type_to_logical_type;
			LogicalTypeInfo tm = (LogicalTypeInfo) type_to_manager [t];

			if (tm != null)
				return tm;

			tm = new LogicalTypeInfo (t, filePath);
			type_to_manager [t] = tm;

			return tm;
		}