本文整理汇总了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);
}
示例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");
}
示例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--;
}
}
示例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);");
}
示例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();
}
}
示例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);
}
示例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("}");
}
}
示例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;
}
示例9: WriteSet
//===========================================================================================
protected override void WriteSet(IndentedTextWriter writer, PropertyInfo property)
{
writer.Write("image->");
writer.Write(property.Name);
writer.Write(" = ");
WriteGetValue(writer, property);
}
示例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(");");
}
示例11: WriteHeader
//===========================================================================================
public override void WriteHeader(IndentedTextWriter writer)
{
writer.Write("static ");
writer.Write(TypeName);
writer.Write(" Create");
writer.Write(ClassName);
writer.WriteLine("(XmlElement^ element);");
}
示例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("));");
}
示例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(";");
}
示例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(");");
}
示例15: AppendDDL
public void AppendDDL(IndentedTextWriter textWriter)
{
if (!IsSystemNamed)
{
textWriter.Write($"CONSTRAINT [{ConstraintName}] ");
}
textWriter.Write($"UNIQUE {(IsNonClustered ? "NONCLUSTERED" : "CLUSTERED")} ({string.Join(",", Columns)})");
}