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


C# CodeWriter.BeginLine方法代码示例

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


在下文中一共展示了CodeWriter.BeginLine方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PrintCode

		public override void PrintCode (CodeWriter cp)
		{
			foreach (CodeItem item in statements) {
				cp.BeginLine ();
				item.PrintCode (cp);
				cp.Write (";");
				cp.EndLine ();
			}
		}
开发者ID:nlhepler,项目名称:mono,代码行数:9,代码来源:CodeBlock.cs

示例2: PrintCode

		public override void PrintCode (CodeWriter cp)
		{
			cp.Write ("while (");
			condition.PrintCode (cp);
			cp.Write (") {");
			cp.EndLine ();
			cp.Indent ();
			whileBlock.PrintCode (cp);
			cp.Unindent ();
			cp.BeginLine ().Write ("}");
		}
开发者ID:nickchal,项目名称:pash,代码行数:11,代码来源:CodeWhile.cs

示例3: PrintCode

		public override void PrintCode (CodeWriter cp)
		{
			for (int n=0; n<blocks.Count; n++) {
				if (n == 0)
					cp.Write ("if (");
				else
					cp.Write ("else if (");
				
				((CodeExpression)conditions[n]).PrintCode (cp);
				cp.Write (") {");
				cp.EndLine ();
				cp.Indent ();
				((CodeBlock) blocks[n]).PrintCode (cp);
				cp.Unindent ();
				cp.BeginLine ().Write ("}");
				if (n < blocks.Count - 1) {
					cp.EndLine ();
					cp.BeginLine ();
				}
			}
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:21,代码来源:CodeSelect.cs

示例4: PrintCode

		public override void PrintCode (CodeWriter cp)
		{
			cp.Write ("for (");
			initExp.PrintCode (cp);
			cp.Write (";");
			conditionExp.PrintCode (cp);
			cp.Write (";");
			nextExp.PrintCode (cp);
			cp.Write (") {");
			cp.EndLine ();
			cp.Indent ();
			forBlock.PrintCode (cp);
			cp.Unindent ();
			cp.BeginLine ().Write ("}");
		}
开发者ID:nlhepler,项目名称:mono,代码行数:15,代码来源:CodeFor.cs

示例5: PrintCode

		public virtual void PrintCode (CodeWriter cp)
		{
			cp.BeginLine ();
			foreach (CodeCustomAttribute a in customAttributes)
				a.PrintCode (cp);
			if ((methodBase.Attributes & MethodAttributes.Static) != 0)
				cp.Write ("static ");
			if ((methodBase.Attributes & MethodAttributes.Public) != 0)
				cp.Write ("public ");
			if (returnType != null) cp.Write (returnType + " ");
			cp.Write (name + " (");
			for (int n=0; n<parameterTypes.Length; n++) {
				if (n > 0) cp.Write (", ");
				cp.Write (parameterTypes[n] + " arg" + n);
			}
			cp.Write (")");
			cp.EndLine ();
			cp.WriteLineInd ("{");
			
			builder.PrintCode (cp);
			
			cp.WriteLineUnind ("}");
		}
开发者ID:nlhepler,项目名称:mono,代码行数:23,代码来源:CodeMethod.cs

示例6: PrintCode

		public void PrintCode (CodeWriter cp)
		{
			cp.BeginLine ();
			foreach (CodeCustomAttribute a in customAttributes)
				a.PrintCode (cp);
			cp.BeginLine ();
			if (IsStatic)
				cp.Write ("static ");
			if (IsPublic)
				cp.Write ("public ");
			if (returnType != null) cp.Write (returnType + " ");
			cp.Write (name);
			if (parameterTypes.Length > 0) {
				cp.Write (name + " [");
				for (int n=0; n<parameterTypes.Length; n++) {
					if (n > 0) cp.Write (", ");
					cp.Write (parameterTypes[n] + " arg" + n);
				}
				cp.Write ("]");
			}
			cp.Write (" {");
			cp.EndLine ();
			cp.Indent ();
			cp.WriteLineInd ("get {");
			get_builder.PrintCode (cp);
			cp.WriteLineUnind ("}");
			cp.WriteLine ("set {");
			set_builder.PrintCode (cp);
			cp.WriteLine ("}");
			cp.WriteLineUnind ("}");
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:31,代码来源:CodeProperty.cs

示例7: PrintCode

		public override void PrintCode (CodeWriter cp)
		{
			if (trueBlock == null) return;
			
			cp.Write ("if (");
			condition.PrintCode (cp);
			cp.Write (") {");
			cp.EndLine ();
			cp.Indent ();
			trueBlock.PrintCode (cp);
			cp.Unindent ();
			cp.BeginLine ().Write ("}");
			if (falseBlock != null) {
				cp.EndLine ();
				cp.WriteLineInd ("else {");
				falseBlock.PrintCode (cp);
				cp.Unindent ();
				cp.BeginLine ().Write ("}");
			}
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:20,代码来源:CodeIf.cs

示例8: PrintCode

		public void PrintCode (CodeWriter cw)
		{
			for (int n=0; n<customAttributes.Count; n++) {
				CodeCustomAttribute cca = customAttributes [n] as CodeCustomAttribute;
				if (n > 0) cw.WriteLine ("");
				cca.PrintCode (cw);
			}

/*			if ((typeBuilder.Attributes & TypeAttributes.Abstract) != 0) cw.Write ("abstract ");
			if ((typeBuilder.Attributes & TypeAttributes.NestedAssembly) != 0) cw.Write ("internal ");
			if ((typeBuilder.Attributes & TypeAttributes.NestedPrivate) != 0) cw.Write ("private ");
*/			if ((typeBuilder.Attributes & TypeAttributes.Public) != 0) cw.Write ("public ");
			cw.Write ("class ").Write (typeBuilder.Name);
			
			bool dots = false;
			if (baseType != null && baseType != typeof(object)) {
				cw.Write (" : " + baseType);
				dots = true;
			}
			
			if (interfaces != null && interfaces.Length > 0) {
				if (!dots) cw.Write (" : ");
				else cw.Write (", ");
				for (int n=0; n<interfaces.Length; n++) {
					if (n > 0) cw.Write (", ");
					cw.Write (interfaces[n].ToString ());
				}
			}
			
			cw.EndLine ().WriteLineInd ("{");
			
			foreach (FieldInfo f in fields) {
				cw.BeginLine ();
				ArrayList atts = (ArrayList) fieldAttributes [f];
				foreach (CodeCustomAttribute a in atts)
					a.PrintCode (cw);
				if ((f.Attributes & FieldAttributes.Static) != 0)
					cw.Write ("static ");
				cw.Write (f.FieldType.Name + " ");
				cw.Write (f.Name + ";");
				cw.EndLine ();
				cw.WriteLine (""); 
			}
			
			for (int n=0; n<properties.Count; n++) {
				CodeProperty prop = properties [n] as CodeProperty;
				if (n > 0) cw.WriteLine ("");
				prop.PrintCode (cw);
			}

			for (int n=0; n<methods.Count; n++) {
				CodeMethod met = methods[n] as CodeMethod;
				if (n > 0) cw.WriteLine ("");
				met.PrintCode (cw);
			}
			cw.WriteLineUnind ("}");
		}
开发者ID:nlhepler,项目名称:mono,代码行数:57,代码来源:CodeClass.cs

示例9: PrintCode

		public override void PrintCode (CodeWriter cp)
		{
			cp.Write ("foreach (" + itemType + " item in ");
			array.PrintCode (cp);
			cp.Write (") {");
			cp.EndLine ();
			cp.Indent ();
			forBlock.PrintCode (cp);
			cp.Unindent ();
			cp.BeginLine ().Write ("}");
		}
开发者ID:nlhepler,项目名称:mono,代码行数:11,代码来源:CodeForeach.cs


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