GetNamespaceAndServiceName() protected method

protected GetNamespaceAndServiceName ( Type type, bool isPage, string &ns, string &service ) : void
type System.Type
isPage bool
ns string
service string
return void
Example #1
0
            public void GenerateMethod(StringBuilder proxy, bool isPrototype, bool isPage)
            {
                string ns;
                string service;                // = isPage ? "PageMethods" : MethodInfo.DeclaringType.FullName;

                _typeInfo.GetNamespaceAndServiceName(MethodInfo.DeclaringType, isPage, out ns, out service);
                string useHttpGet = UseHttpGet ? "true" : "false";
                string paramMap   = GenerateParameters(true);
                string paramList  = GenerateParameters(false);

                if (isPrototype)
                {
                    proxy.AppendFormat(
                        @"
{1}:function({4}succeededCallback, failedCallback, userContext) {{
return this._invoke({0}.get_path(), '{1}',{2},{{{3}}},succeededCallback,failedCallback,userContext); }}",
                        service, MethodName, useHttpGet, paramMap, paramList);
                }
                else
                {
                    proxy.AppendFormat(
                        @"
{0}.{1}= function({2}onSuccess,onFailed,userContext) {{{0}._staticInstance.{1}({2}onSuccess,onFailed,userContext); }}",
                        service, MethodName, paramList);
                }
            }