本文整理汇总了C#中ILog.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# ILog.GetType方法的具体用法?C# ILog.GetType怎么用?C# ILog.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ILog
的用法示例。
在下文中一共展示了ILog.GetType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Logging
private static void Logging(ILog logger)
{
string message = string.Empty;
var counter = 0;
Console.WriteLine("the process start : {0} of: {1}", DateTime.Now.ToString(dateFormat), logger.GetType().ToString());
System.Threading.Thread.Sleep(50);
for (counter = 0; counter < MAX_COUNTER; counter++)
{
message = string.Format("The Flow number: {0} of {1}", counter, logger.GetType().ToString());
logger.Write(message);
}
System.Threading.Thread.Sleep(50);
Console.WriteLine("the process end : {0} of: {1}", DateTime.Now.ToString(dateFormat), logger.GetType().ToString());
}
示例2: LoggerIsSerializable
public void LoggerIsSerializable(ILog logger)
{
//TODO assign some non-default state to the logger...?
if (logger.GetType().IsSerializable)
{
SerializationTestUtils.TrySerialization(logger);
Assert.IsTrue(SerializationTestUtils.IsSerializable(logger));
ILog logger2 = (ILog)SerializationTestUtils.SerializeAndDeserialize(logger);
Assert.IsTrue(logger != logger2);
}
}