本文整理匯總了C#中System.Logger.AddString方法的典型用法代碼示例。如果您正苦於以下問題:C# Logger.AddString方法的具體用法?C# Logger.AddString怎麽用?C# Logger.AddString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Logger
的用法示例。
在下文中一共展示了Logger.AddString方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: 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;
}
}