本文整理汇总了C#中Service.TypeName方法的典型用法代码示例。如果您正苦于以下问题:C# Service.TypeName方法的具体用法?C# Service.TypeName怎么用?C# Service.TypeName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Service
的用法示例。
在下文中一共展示了Service.TypeName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateClientCall
//public string[] ToCommonSpec(ServiceSpec spec, string dir)
//{
// return FromAllSpecToSources(
// Path.Combine(spec.Directory, spec.MainSpecFile),
// spec.ReferencedSpecFiles.Select(rs => Path.Combine(spec.Directory, rs)).ToArray(),
// dir,
// new GeneratedFileType[] { GeneratedFileType.IDL },
// new GeneratedFileType[] { GeneratedFileType.IDL_NoSerivce }
// );
//}
public void GenerateClientCall(
CodeBuilder builder,
MethodCallExpression call,
Service svc,
Dictionary<Type, string> reWrittenTypes
)
{
var proxyName = svc.TypeName() + "_Proxy";
builder.AppendLine("return " + (call.Object as MemberExpression).Member.Name + "." + call.Method.Name + "(req);");
}
示例2: GenerateClientDeclaration
public void GenerateClientDeclaration(CodeBuilder builder, MemberExpression exp, Service svc)
{
var proxyName = svc.TypeName() + "_Proxy";
builder.AppendLine("private " + proxyName + " " + exp.Member.Name + " = new " + proxyName + "((new NetlibTransport(new BinaryProtocolFactory())).Connect(" + svc.Url +"));");
}
示例3: GenerateClientCall
//public string[] ToCommonSpec(ServiceSpec spec, string dir)
//{
// return FromAllSpecToSources(
// Path.Combine(spec.Directory, spec.MainSpecFile),
// spec.ReferencedSpecFiles.Select(rs => Path.Combine(spec.Directory, rs)).ToArray(),
// dir,
// new GeneratedFileType[] { GeneratedFileType.IDL },
// new GeneratedFileType[] { GeneratedFileType.IDL_NoSerivce }
// );
//}
public void GenerateClientCall(
CodeBuilder builder,
MethodCallExpression call,
Service svc,
Dictionary<Type, string> reWrittenTypes
)
{
var argTypeName = call.Method.GetParameters()[0].Name;
builder.AppendLine(svc.TypeName() + "." + argTypeName + "_result resp;");
builder.AppendLine((call.Object as MemberExpression).Member.Name + "." + call.Method.Name + "(new " + svc.TypeName() + "." + call.Method.Name + "_args(){" + argTypeName + "= req}, out resp);");
builder.AppendLine("return resp.Success;");
}