当前位置: 首页>>代码示例>>C#>>正文


C# Statistics.Print方法代码示例

本文整理汇总了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();
        }
开发者ID:simoneb,项目名称:ak-f1-timing,代码行数:50,代码来源:FixupOperation.cs

示例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();
            }
        }
    }
开发者ID:cbalderrama,项目名称:wire3d,代码行数:49,代码来源:Unity3DExporter.cs


注:本文中的Statistics.Print方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。