本文整理汇总了C#中GtkSharp.Generation.ClassBase.Prepare方法的典型用法代码示例。如果您正苦于以下问题:C# ClassBase.Prepare方法的具体用法?C# ClassBase.Prepare怎么用?C# ClassBase.Prepare使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GtkSharp.Generation.ClassBase
的用法示例。
在下文中一共展示了ClassBase.Prepare方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateBody
public void GenerateBody(GenerationInfo gen_info, ClassBase implementor, string indent)
{
StreamWriter sw = gen_info.Writer;
sw.WriteLine(" {");
if (!IsStatic && implementor != null)
implementor.Prepare (sw, indent + "\t\t\t");
if (IsAccessor)
Body.InitAccessor (sw, Signature, indent);
Body.Initialize(gen_info, is_get, is_set, indent);
sw.Write(indent + "\t\t\t");
if (retval.IsVoid)
sw.WriteLine(CName + call + ";");
else {
sw.WriteLine(retval.MarshalType + " raw_ret = " + CName + call + ";");
sw.WriteLine(indent + "\t\t\t" + retval.CSType + " ret = " + retval.FromNative ("raw_ret") + ";");
}
if (!IsStatic && implementor != null)
implementor.Finish (sw, indent + "\t\t\t");
Body.Finish (sw, indent);
Body.HandleException (sw, indent);
if (is_get && Parameters.Count > 0)
sw.WriteLine (indent + "\t\t\treturn " + Parameters.AccessorName + ";");
else if (!retval.IsVoid)
sw.WriteLine (indent + "\t\t\treturn ret;");
else if (IsAccessor)
Body.FinishAccessor (sw, Signature, indent);
sw.Write(indent + "\t\t}");
}
示例2: GenerateBody
public void GenerateBody (GenerationInfo gen_info, ClassBase implementor, string indent)
{
StreamWriter sw = gen_info.Writer;
sw.WriteLine(" {");
if (!IsStatic && implementor != null)
implementor.Prepare (sw, indent + "\t\t\t");
if (IsAccessor)
Body.InitAccessor (sw, Signature, indent);
Body.Initialize(gen_info, is_get, is_set, indent);
if (HasWin32Utf8Variant) {
if (!retval.IsVoid)
sw.WriteLine(indent + "\t\t\t" + retval.MarshalType + " raw_ret;");
sw.WriteLine(indent + "\t\t\t" + "if (Environment.OSVersion.Platform == PlatformID.Win32NT ||");
sw.WriteLine(indent + "\t\t\t" + " Environment.OSVersion.Platform == PlatformID.Win32S ||");
sw.WriteLine(indent + "\t\t\t" + " Environment.OSVersion.Platform == PlatformID.Win32Windows ||");
sw.WriteLine(indent + "\t\t\t" + " Environment.OSVersion.Platform == PlatformID.WinCE)");
if (retval.IsVoid) {
sw.WriteLine(indent + "\t\t\t\t" + CName + "_utf8" + call + ";");
sw.WriteLine(indent + "\t\t\t" + "else");
sw.WriteLine(indent + "\t\t\t\t" + CName + call + ";");
} else {
sw.WriteLine(indent + "\t\t\t\traw_ret = " + CName + "_utf8" + call + ";");
sw.WriteLine(indent + "\t\t\t" + "else");
sw.WriteLine(indent + "\t\t\t\traw_ret = " + CName + call + ";");
sw.WriteLine(indent + "\t\t\t" + retval.CSType + " ret = " + retval.FromNative ("raw_ret") + ";");
}
} else {
sw.Write(indent + "\t\t\t");
if (retval.IsVoid)
sw.WriteLine(CName + call + ";");
else {
sw.WriteLine(retval.MarshalType + " raw_ret = " + CName + call + ";");
sw.WriteLine(indent + "\t\t\t" + retval.CSType + " ret = " + retval.FromNative ("raw_ret") + ";");
}
}
if (!IsStatic && implementor != null)
implementor.Finish (sw, indent + "\t\t\t");
Body.Finish (sw, indent);
Body.HandleException (sw, indent);
if (is_get && Parameters.Count > 0)
sw.WriteLine (indent + "\t\t\treturn " + Parameters.AccessorName + ";");
else if (!retval.IsVoid)
sw.WriteLine (indent + "\t\t\treturn ret;");
else if (IsAccessor)
Body.FinishAccessor (sw, Signature, indent);
sw.Write(indent + "\t\t}");
}