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


C# IndentedTextWriter.Write方法代码示例

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


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

示例1: WriteRttiPointerClassInfo

 /// <summary>
 /// </summary>
 /// <param name="type">
 /// </param>
 /// <param name="writer">
 /// </param>
 public static void WriteRttiPointerClassInfo(this IType type, IndentedTextWriter writer)
 {
     writer.Write("@\"{0}\" = linkonce_odr unnamed_addr constant ", type.GetRttiPointerInfoName());
     type.WriteRttiPointerClassInfoDeclaration(writer);
     writer.Write(' ');
     type.WriteRttiPointerClassInfoDefinition(writer);
 }
开发者ID:SperoSophia,项目名称:il2bc,代码行数:13,代码来源:RttiPointerGen.cs

示例2: AppendDDL

        public override void AppendDDL(IndentedTextWriter textWriter)
        {
            if (!string.IsNullOrEmpty(Note))
            {
                textWriter.WriteLine("/*");
                textWriter.Write("  ");
                textWriter.WriteLine(Note);
                textWriter.WriteLine("*/");
            }

            textWriter.WriteLine($"IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'{ForeignKey.QuotedForeignKeyName}'))");

            textWriter.Indent++;
            textWriter.WriteLine($"ALTER TABLE {ForeignKey.ParentObjectIdentifier}");
            textWriter.Indent++;
            textWriter.Write("ADD ");
            textWriter.Indent++;
            ForeignKey.AppendDDL(textWriter);
            textWriter.WriteLine(";");
            textWriter.Indent--;
            textWriter.Indent--;
            textWriter.Indent--;

            textWriter.WriteLine("GO");
        }
开发者ID:jdaigle,项目名称:Horton,代码行数:25,代码来源:AddForeignKey.cs

示例3: WriteCallIfElse

    private void WriteCallIfElse(IndentedTextWriter writer, MethodBase[] methods)
    {
      for (int i = 0; i < methods.Length; i++)
      {
        ParameterInfo[] parameters = methods[i].GetParameters();

        if (i > 0)
          writer.Write("else ");

        writer.Write("if (");
        if (parameters.Length > 0)
        {
          writer.Write("OnlyContains(arguments");
          foreach (ParameterInfo parameter in parameters)
          {
            writer.Write(", \"");
            writer.Write(parameter.Name);
            writer.Write("\"");
          }
          writer.Write(")");
        }
        else
        {
          writer.Write("arguments.Count == 0");
        }

        writer.WriteLine(")");
        writer.Indent++;
        WriteHashtableCall(writer, methods[i], parameters);
        writer.Indent--;
      }
    }
开发者ID:levesque,项目名称:Magick.NET,代码行数:32,代码来源:CodeGenerator.cs

示例4: WriteCase

 protected override void WriteCase(IndentedTextWriter writer, string name)
 {
   writer.Write("return Create");
   writer.Write(name[0].ToString().ToUpperInvariant());
   writer.Write(name.Substring(1));
   writer.WriteLine("(element);");
 }
开发者ID:levesque,项目名称:Magick.NET,代码行数:7,代码来源:InterfaceCodeGenerator.cs

示例5: WriteProductions

        private static void WriteProductions(Grammar grammar, IndentedTextWriter output)
        {
            output.WriteLine("// Production rules:");
            output.WriteLine();

            foreach (var prod in grammar.Productions)
            {
                output.WriteLine("// {0}:", prod.Index);
                output.Write("{0} :", prod.Outcome.Name);
                if (prod.Pattern.Length == 0)
                {
                    output.Write(" /*empty*/");
                }
                else
                {
                    foreach (var symb in prod.Pattern)
                    {
                        output.Write(' ');
                        output.Write(symb.Name);
                    }
                }

                output.WriteLine(";");
                output.WriteLine();
            }
        }
开发者ID:bkushnir,项目名称:IronTextLibrary,代码行数:26,代码来源:DefaultGrammarTextWriter.cs

示例6: Dump

 public void Dump(IndentedTextWriter w)
 {
     w.Write("Bitmap Fill id_" + this.CharacterId + " type: ");
     w.Write(Enum.GetName(typeof(FillType), this.FillType));
     w.Write(" ");
     Matrix.Dump(w);
 }
开发者ID:Hamsand,项目名称:Swf2XNA,代码行数:7,代码来源:BitmapFill.cs

示例7: Generate

        public void Generate(Context context, IndentedTextWriter writer)
        {
            foreach (Contract contract in context.Contracts)
            {
                writer.WriteLine();
                writer.WriteLine("[GeneratedCode(\"MessagesGenerator\", \"1.0.0.0\")]");
                writer.Write("public sealed class {0}", contract.Name);
                var interfaces = new List<string>();

                if ((contract.Modifier & ContractModifier.CommandInterface) == ContractModifier.CommandInterface)
                {
                    interfaces.Add(String.Format(CultureInfo.InvariantCulture, _commandBaseType, contract.Members.First().Type));
                }

                if ((contract.Modifier & ContractModifier.EventInterface) == ContractModifier.EventInterface)
                {
                    interfaces.Add(String.Format(CultureInfo.InvariantCulture, _eventBaseType, contract.Members.First().Type));
                }

                if (interfaces.Any())
                {
                    writer.Write(" : {0}", string.Join(", ", interfaces.ToArray()));
                }
                writer.WriteLine();
                writer.WriteLine("{");
                writer.Indent++;

                WriteConstructor(writer, contract);
                writer.WriteLine();
                WriteMembers(contract, writer);

                writer.Indent--;
                writer.WriteLine("}");
            }
        }
开发者ID:alreva,项目名称:CQRS_Example,代码行数:35,代码来源:MessagesGenerator.cs

示例8: WriteDiffs

        internal override IndentedTextWriter WriteDiffs(IndentedTextWriter writer, HashSet<ValueDiff> written)
        {
            if (!written.Add(this.ValueDiff))
            {
                writer.Write("...");
                return writer;
            }

            if (this.Diffs.Count == 0)
            {
                writer.Write($"[{this.Index}] x: {this.X.ToInvariantOrNullString()} y: {this.Y.ToInvariantOrNullString()}");
                return writer;
            }

            writer.Write($"[{this.Index}]");
            writer.Indent++;
            foreach (var diff in this.Diffs)
            {
                writer.WriteLine();
                diff.WriteDiffs(writer, written);
            }

            writer.Indent--;
            return writer;
        }
开发者ID:JohanLarsson,项目名称:Gu.State,代码行数:25,代码来源:IndexDiff.cs

示例9: WriteSet

		//===========================================================================================
		protected override void WriteSet(IndentedTextWriter writer, PropertyInfo property)
		{
			writer.Write("image->");
			writer.Write(property.Name);
			writer.Write(" = ");
			WriteGetValue(writer, property);
		}
开发者ID:dlemstra,项目名称:GraphicsMagick.NET,代码行数:8,代码来源:MagickImageGenerator.cs

示例10: WriteHashtableCall

		//===========================================================================================
		protected override void WriteHashtableCall(IndentedTextWriter writer, MethodBase method, ParameterInfo[] parameters)
		{
			writer.Write("image->");
			writer.Write(method.Name);
			writer.Write("(");
			WriteHashtableParameters(writer, parameters);
			writer.WriteLine(");");
		}
开发者ID:dlemstra,项目名称:GraphicsMagick.NET,代码行数:9,代码来源:MagickImageGenerator.cs

示例11: WriteHeader

		//===========================================================================================
		public override void WriteHeader(IndentedTextWriter writer)
		{
			writer.Write("static ");
			writer.Write(TypeName);
			writer.Write(" Create");
			writer.Write(ClassName);
			writer.WriteLine("(XmlElement^ element);");
		}
开发者ID:dlemstra,项目名称:GraphicsMagick.NET,代码行数:9,代码来源:ColorProfileGenerator.cs

示例12: WriteCall

 protected override void WriteCall(IndentedTextWriter writer, MethodBase method, ParameterInfo[] parameters)
 {
   writer.Write("drawables.Add(new ");
   writer.Write(method.DeclaringType.Name);
   writer.Write("(");
   WriteParameters(writer, parameters);
   writer.WriteLine("));");
 }
开发者ID:levesque,项目名称:Magick.NET,代码行数:8,代码来源:DrawableGenerator.cs

示例13: WriteMember

		//===========================================================================================
		private static void WriteMember(IndentedTextWriter writer, Type type, string suffix)
		{
			writer.Write("private static Type _");
			if (!string.IsNullOrEmpty(suffix))
				writer.Write(suffix);
			WriteType(writer, type);
			writer.WriteLine(";");
		}
开发者ID:dlemstra,项目名称:GraphicsMagick.NET,代码行数:9,代码来源:TypesGenerator.cs

示例14: WriteHashtableCall

		//===========================================================================================
		protected override void WriteHashtableCall(IndentedTextWriter writer, MethodBase method, ParameterInfo[] parameters)
		{
			writer.Write("return ");
			writer.Write(method.DeclaringType.Name);
			writer.Write("(");
			WriteHashtableParameters(writer, parameters);
			writer.WriteLine(");");
		}
开发者ID:dlemstra,项目名称:GraphicsMagick.NET,代码行数:9,代码来源:CoordinateGenerator.cs

示例15: AppendDDL

 public void AppendDDL(IndentedTextWriter textWriter)
 {
     if (!IsSystemNamed)
     {
         textWriter.Write($"CONSTRAINT [{ConstraintName}] ");
     }
     textWriter.Write($"UNIQUE {(IsNonClustered ? "NONCLUSTERED" : "CLUSTERED")} ({string.Join(",", Columns)})");
 }
开发者ID:jdaigle,项目名称:Horton,代码行数:8,代码来源:UniqueConstraintInfo.cs


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