本文整理汇总了C#中Udbus.HandleStruct方法的典型用法代码示例。如果您正苦于以下问题:C# Udbus.HandleStruct方法的具体用法?C# Udbus.HandleStruct怎么用?C# Udbus.HandleStruct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Udbus
的用法示例。
在下文中一共展示了Udbus.HandleStruct方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EndStruct
public override void EndStruct(Udbus.Parsing.BuildContext context, Udbus.Parsing.IParamCodeTypeHandler paramtypeHandler)
{
base.EndStruct(context, paramtypeHandler);
//CodeStatement
if (this.methodStatements.Count > 0) // If got field statements
{
this.method.Statements.Add(new CodeVariableDeclarationStatement(CodeBuilderCommon.typerefResult, CodeBuilderCommon.nameResult));
// Got all the field assignment statements. Now put them in the method with result tests.
CodeExpression exprTest = new CodeBinaryOperatorExpression(new CodeVariableReferenceExpression(CodeBuilderCommon.nameResult)
, CodeBinaryOperatorType.IdentityEquality, CodeBuilderCommon.exprReadResultSuccessValue
);
CodeStatement[] assignFields = CodeBuilderCommon.NestedExpression(exprTest, this.methodStatements).ToArray();
this.method.Statements.AddRange(assignFields);
this.method.Statements.Add(new CodeMethodReturnStatement(CodeBuilderCommon.varrefResult));
} // Ends if got field statements
else // Else no fields
{
// No statements ? No implementation.
// return 0;
this.method.Statements.Add(new CodeMethodReturnStatement(CodeBuilderCommon.exprBuildResultSuccessValue));
} // Ends else no fields
// Marshalling code needs the name, nothing else.
paramtypeHandler.HandleStruct(new Udbus.Parsing.CodeParamType(new CodeTypeReference(this.fullname)),
this.name,
CodeBuilderCommon.GetScopedName(CodeBuilderCommon.nsDbusMarshalCustom, context.declarationHolder.Name)
);
System.Diagnostics.Trace.WriteLine(string.Format("InParam Ending Struct {0}", this.name));
context.declarationHolder.Add(this.method);
}
示例2: EndStruct
public override void EndStruct(Udbus.Parsing.BuildContext context, Udbus.Parsing.IParamCodeTypeHandler paramtypeHandler)
{
base.EndStruct(context, paramtypeHandler);
context.declarationHolder.Add(this.declaration);
paramtypeHandler.HandleStruct(new Udbus.Parsing.CodeParamDeclaredType(this.declaration), this.name,
CodeBuilderCommon.GetScopedName(CodeBuilderCommon.nsDbusMarshalCustom, context.declarationHolder.Name)
);
}