当前位置: 首页>>代码示例>>C#>>正文


C# ClassBase.Finish方法代码示例

本文整理汇总了C#中GtkSharp.Generation.ClassBase.Finish方法的典型用法代码示例。如果您正苦于以下问题:C# ClassBase.Finish方法的具体用法?C# ClassBase.Finish怎么用?C# ClassBase.Finish使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GtkSharp.Generation.ClassBase的用法示例。


在下文中一共展示了ClassBase.Finish方法的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}");
        }
开发者ID:Yetangitu,项目名称:f-spot,代码行数:32,代码来源:Method.cs

示例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}");
		}
开发者ID:ystk,项目名称:debian-gtk-sharp2,代码行数:51,代码来源:Method.cs


注:本文中的GtkSharp.Generation.ClassBase.Finish方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。