本文整理汇总了C#中Statistics.Print方法的典型用法代码示例。如果您正苦于以下问题:C# Statistics.Print方法的具体用法?C# Statistics.Print怎么用?C# Statistics.Print使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Statistics
的用法示例。
在下文中一共展示了Statistics.Print方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Fixup
private void Fixup(string srcPath, string dstPath)
{
Message message;
var stats = new Statistics();
var classifier = new MessageClassifier();
var translator = new LiveMessageTranslator();
using(var input = File.OpenRead(srcPath))
using(var reader = new DecoratedObjectReader(input))
using(var output = File.Create(dstPath))
using(var writer = new DecoratedObjectWriter(output))
{
while(true)
{
if((message = reader.Read<Message>()) == null)
{
break;
}
++stats.Read;
if(classifier.IsTranslated(message))
{
++stats.OrgTranslated;
continue;
}
writer.Write(message);
++stats.Written;
if((message = translator.Translate(message)) != null)
{
if(message is CompositeMessage)
{
foreach(var component in ((CompositeMessage)message).Messages)
{
writer.Write(component);
++stats.Written;
++stats.NewTranslated;
}
}
else
{
writer.Write(message);
++stats.Written;
++stats.NewTranslated;
}
}
}
writer.Write(null);
}
stats.Print();
}
示例2: ShowExportDialog
private void ShowExportDialog()
{
if ((Directory.Exists(mPath) && !string.IsNullOrEmpty(mPath)) == false)
{
return;
}
if (GUILayout.Button("Export"))
{
if (mPath[mPath.Length - 1] != '/' && mPath[mPath.Length - 1] != '\\')
{
mPath = mPath + '/';
}
mMeshAssetsProcessed = new List<string>();
mMeshAssetNameToMeshName = new Dictionary<string, string>();
mMeshNameToCount = new Dictionary<string, int>();
mTextureToName = new Dictionary<Texture2D, string>();
mTextureNameToCount = new Dictionary<string, int>();
mMaterialAssetsProcessed = new List<string>();
mMaterialAssetNameToMaterialName = new Dictionary<string, string>();
mMaterialNameToCount = new Dictionary<string, int>();
mLightToName = new Dictionary<Light, string>();
mLightNameToCount = new Dictionary<string, int>();
mStatistics = new Statistics();
Dictionary<MeshFilter, Mesh> backupMeshFilterToMesh = null;
if (mCombineStaticMeshes)
{
CombineStaticMeshes(out backupMeshFilterToMesh);
}
Export();
if (mCombineStaticMeshes)
{
UncombineStaticMeshes(backupMeshFilterToMesh);
}
if (!mExportXmlOnly)
{
mStatistics.Print();
}
}
}