@@ -81,28 +81,26 @@ public SourceText ToSourceText()
8181 public override string ToString ( )
8282 {
8383 var builder = new StringBuilder ( ) ;
84+ builder . AppendLine ( "#pragma warning disable" ) ;
8485 builder . AppendLine ( "using System;" ) ;
85- builder . AppendLine ( "using System.ComponentModel;" ) ;
86- builder . AppendLine ( "using System.Diagnostics;" ) ;
87-
88- builder . AppendLine ( "#pragma warning disable" ) ;
8986 builder . AppendLine ( $ "namespace { this . Namespace } ") ;
9087 builder . AppendLine ( "{" ) ;
9188
92- builder . AppendLine ( $ "\t [EditorBrowsable(EditorBrowsableState.Never)]") ;
93- builder . AppendLine ( $ "\t [DebuggerTypeProxy(typeof({ this . httpApiFullName } ))]") ;
94- builder . AppendLine ( $ "\t [HttpApiProxyClass(typeof({ this . httpApiFullName } ))]") ;
95- builder . AppendLine ( $ "\t public class { this . ClassName } :{ this . httpApiFullName } ") ;
89+ builder . AppendLine ( $ "\t [global::System.ComponentModel. EditorBrowsable(global::System.ComponentModel. EditorBrowsableState.Never)]") ;
90+ builder . AppendLine ( $ "\t [global::System.Diagnostics. DebuggerTypeProxy(typeof({ this . httpApiFullName } ))]") ;
91+ builder . AppendLine ( $ "\t [global::WebApiClientCore. HttpApiProxyClass(typeof({ this . httpApiFullName } ))]") ;
92+ builder . AppendLine ( $ "\t partial class { this . ClassName } :{ this . httpApiFullName } ") ;
9693 builder . AppendLine ( "\t {" ) ;
9794
98- builder . AppendLine ( $ "\t \t private readonly IHttpApiInterceptor { this . apiInterceptorFieldName } ;") ;
99- builder . AppendLine ( $ "\t \t private readonly ApiActionInvoker[] { this . actionInvokersFieldName } ;") ;
95+ builder . AppendLine ( $ "\t \t private readonly global::WebApiClientCore. IHttpApiInterceptor { this . apiInterceptorFieldName } ;") ;
96+ builder . AppendLine ( $ "\t \t private readonly global::WebApiClientCore. ApiActionInvoker[] { this . actionInvokersFieldName } ;") ;
10097
101- builder . AppendLine ( $ "\t \t public { this . httpApi . Name } (IHttpApiInterceptor apiInterceptor,ApiActionInvoker[] actionInvokers)") ;
98+ builder . AppendLine ( $ "\t \t public { this . httpApi . Name } (global::WebApiClientCore. IHttpApiInterceptor apiInterceptor, global::WebApiClientCore. ApiActionInvoker[] actionInvokers)") ;
10299 builder . AppendLine ( "\t \t {" ) ;
103100 builder . AppendLine ( $ "\t \t \t this.{ this . apiInterceptorFieldName } = apiInterceptor;") ;
104101 builder . AppendLine ( $ "\t \t \t this.{ this . actionInvokersFieldName } = actionInvokers;") ;
105102 builder . AppendLine ( "\t \t }" ) ;
103+ builder . AppendLine ( ) ;
106104
107105 var index = 0 ;
108106 foreach ( var method in this . FindApiMethods ( ) )
@@ -145,11 +143,11 @@ private string BuildMethod(IMethodSymbol method, int index)
145143 var parametersString = string . Join ( "," , method . Parameters . Select ( item => $ "{ GetFullName ( item . Type ) } { item . Name } ") ) ;
146144 var parameterNamesString = string . Join ( "," , method . Parameters . Select ( item => item . Name ) ) ;
147145 var paremterArrayString = string . IsNullOrEmpty ( parameterNamesString )
148- ? "Array.Empty<object >()"
149- : $ "new object [] {{ { parameterNamesString } }}";
146+ ? "global::System. Array.Empty<global::System.Object >()"
147+ : $ "new global::System.Object [] {{ { parameterNamesString } }}";
150148
151149 var returnTypeString = GetFullName ( method . ReturnType ) ;
152- builder . AppendLine ( $ "\t \t [HttpApiProxyMethod({ index } )]") ;
150+ builder . AppendLine ( $ "\t \t [global::WebApiClientCore. HttpApiProxyMethod({ index } )]") ;
153151 builder . AppendLine ( $ "\t \t public { returnTypeString } { method . Name } ( { parametersString } )") ;
154152 builder . AppendLine ( "\t \t {" ) ;
155153 builder . AppendLine ( $ "\t \t \t return ({ returnTypeString } )this.{ this . apiInterceptorFieldName } .Intercept(this.{ this . actionInvokersFieldName } [{ index } ], { paremterArrayString } );") ;
0 commit comments