本文整理汇总了C#中System.IO.WriteLine方法的典型用法代码示例。如果您正苦于以下问题:C# IO.WriteLine方法的具体用法?C# IO.WriteLine怎么用?C# IO.WriteLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.IO
的用法示例。
在下文中一共展示了IO.WriteLine方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteShape
public override void WriteShape(ShapeBase Shape, IO.TextWriter Writer)
{
var Dic = new Dictionary<PointF, Int32>();
var Sz = 0;
ShapeWalker.Instance.TypedWalk<LinesShape>(Shape, S => { Sz++; });
Writer.WriteLine(Sz);
ShapeWalker.Instance.TypedWalk<LinesShape>(Shape, S => { Writer.WriteLine(S.Lines.Count); });
Sz = 0;
ShapeWalker.Instance.TypedWalk<LinesShape>(Shape,
S =>
{
foreach (var L in S.Lines)
{
if (!Dic.ContainsKey(L.P1))
{
Dic.Add(L.P1, Sz++);
}
if (!Dic.ContainsKey(L.P2))
{
Dic.Add(L.P2, Sz++);
}
}
});
Writer.WriteLine(Sz);
foreach (var KV in Dic.OrderBy(KV => KV.Value))
{
Writer.Write(KV.Key.X);
Writer.Write(" ");
Writer.Write(KV.Key.Y);
Writer.WriteLine();
}
ShapeWalker.Instance.TypedWalk<LinesShape>(Shape,
S =>
{
Writer.WriteLine();
foreach (var l in S.Lines)
{
Writer.Write(Dic[l.P1]);
Writer.Write(" ");
Writer.Write(Dic[l.P2]);
Writer.WriteLine();
}
});
}
示例2: WriteShape
public override void WriteShape(ShapeBase Shape, IO.TextWriter Writer)
{
ShapeWalker.Instance.TypedWalk<LinesShape>(Shape,
S =>
{
foreach (var l in S.Lines)
{
Writer.WriteLine(" zone");
Writer.Write(l.P1.X);
Writer.Write(" ");
Writer.Write(l.P1.Y);
Writer.WriteLine();
Writer.Write(l.P2.X);
Writer.Write(" ");
Writer.Write(l.P2.Y);
Writer.WriteLine();
}
});
}
示例3: WriteFunctionBody
static void WriteFunctionBody(IO.StreamWriter sourceFile, MethodInfo theMethod)
{
sourceFile.WriteLine("{");
sourceFile.WriteLine("DOT_NET_EXCEL_BEGIN");
string castString = "";
if (!Primitives.Contains(theMethod.ReturnType))
castString = "*(" + WriteCType(theMethod.ReturnType, false) +
"*)(xlwTypes::" + WriteCType(theMethod.ReturnType, false) + "::getInner(";
if (theMethod.ReturnType == typeof(String))
castString = "(CLR2WCPP(";
const string tabString = " ";
sourceFile.WriteLine(tabString + "return " + castString + cppify(theMethod.DeclaringType.FullName + "." + theMethod.Name) + "(");
ParameterInfo[] paramInfo = theMethod.GetParameters();
for (int index = 0; index < paramInfo.Length; ++index)
{
ParameterInfo param = paramInfo[index];
sourceFile.Write(tabString + tabString);
Type parameterType = param.ParameterType;
bool isCustomType = false;
if (CustomTypes.Contains(parameterType))
{
int j = CustomTypes.IndexOf(parameterType);
parameterType = CustomInputTypes[j]; // substitute the parameterType for its custom conversion
isCustomType = true;
sourceFile.Write(CustomConversionMethodNames[j] + "(");
}
/////// Primitive Type
if (Primitives.Contains(parameterType))
sourceFile.Write(param.Name);
else
{
/////// A String
if (param.ParameterType == typeof (String))
sourceFile.Write("gcnew String(" + param.Name + ".c_str())");
else
sourceFile.Write("gcnew xlwTypes::" + WriteCType(parameterType, false) + "(IntPtr((void*)& " + param.Name + "))");
}
if (isCustomType) sourceFile.Write(")");
if (index + 1 != paramInfo.Length) sourceFile.Write(",");
sourceFile.WriteLine();
}
sourceFile.Write(tabString + ")");
if (!Primitives.Contains(theMethod.ReturnType))
sourceFile.Write("))");
sourceFile.WriteLine(";");
sourceFile.WriteLine("DOT_NET_EXCEL_END");
sourceFile.WriteLine("}");
}