本文整理汇总了C#中System.Logger.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Logger.ToString方法的具体用法?C# Logger.ToString怎么用?C# Logger.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Logger
的用法示例。
在下文中一共展示了Logger.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleLogEntry
private static void HandleLogEntry(Logger.LogEntry entry)
{
if (Debugger.IsAttached)
{
Debug.WriteLine(entry.ToString());
}
}
示例2: Encode
//.........这里部分代码省略.........
// Try this
exePath = TestDirectory( "." );
// Try relative
if (null == exePath)
exePath = TestDirectory( @"..\..\External Tools" );
}
// Overwrite
CommandLineTool.PresetDirectory = exePath;
// Create the executer
using (YV122M2V pEncoder = new YV122M2V())
{
// Special HDTV correction
if (1080 == lHeight)
lHeight = 1088;
// Configure
pEncoder.VideoNorm = GetVideoNorm( eFormat );
pEncoder.AspectRatio = GetAspect( lAspect );
pEncoder.HiResMode = (lHeight >= 720);
pEncoder.FrameRateCode = dFrameRate;
pEncoder.OutputFile = sOutput;
pEncoder.InputFile = sInput;
pEncoder.Height = lHeight;
pEncoder.Width = lWidth;
// Use special path for high res mode
if (pEncoder.HiResMode)
{
// Test for diretory
DirectoryInfo hiRes = new DirectoryInfo( Path.Combine( CommandLineTool.PresetDirectory, "HDTV" ) );
// Use if it exists
if (hiRes.Exists)
CommandLineTool.PresetDirectory = hiRes.FullName;
}
// Check mode
if (bMEPG2)
{
// DVD/SVCD
pEncoder.Interlacing = bProgressive ? YV122M2V.InterlacingMode.None : (bTopFirst ? YV122M2V.InterlacingMode.TopFirst : YV122M2V.InterlacingMode.BottomFirst);
pEncoder.Format = MPEG2Enc.Formats.DVD;
pEncoder.BitRate = (int) (lBitRate / 1000);
pEncoder.BufferSize = (lVBVBuffer / 1024);
}
else
{
// VCD
pEncoder.Interlacing = YV122M2V.InterlacingMode.None;
pEncoder.Format = MPEG2Enc.Formats.VCD;
}
// Attach logger
pEncoder.OnError += pLog.ReportError;
// Start it
Stream pIn = pEncoder.Start();
// In erroror
if (null == pIn)
throw new Exception( StringResources.Strings.StartEncoding.Text );
// With cleanup
try
{
// Process it
if (!pEncoder.WaitForExit())
throw new Exception( StringResources.Strings.EncodingFailed.Text );
}
finally
{
// Done with input
pIn.Close();
}
}
// Report
if (configuration.DebugOutput)
if (!unattended)
EncodingError.Show( pLog.ToString() );
// Woo, we did it!
return 0;
}
catch (Exception e)
{
// Extend
pLog.AddString( e.ToString() );
// Create logger
if (!unattended)
EncodingError.Show( pLog.ToString() );
// Report error
return -1;
}
}