當前位置: 首頁>>代碼示例>>C#>>正文


C# Chunk.ToString方法代碼示例

本文整理匯總了C#中Chunk.ToString方法的典型用法代碼示例。如果您正苦於以下問題:C# Chunk.ToString方法的具體用法?C# Chunk.ToString怎麽用?C# Chunk.ToString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Chunk的用法示例。


在下文中一共展示了Chunk.ToString方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: StackFrame

        private StackFrame StackFrame(Chunk line)
        {
            line.Advance("  at ");
            var function = line.Advance(" in ").ToString();

            //exception message line format differences in .net and mono
            //On .net : at ConsoleApplication.Program.Main(String[] args) in D:\Program.cs:line 16
            //On Mono : at ConsoleApplication.Program.Main(String[] args) in d:\Program.cs:16
            var file = !IsMono ?
                line.Advance(":line ").ToString() :
                line.Advance(":").ToString();

            var lineNumber = line.ToInt32();

            if (string.IsNullOrEmpty(file))
            {
                return GetStackFrame(
                    // Handle stack trace lines like
                    // "--- End of stack trace from previous location where exception from thrown ---"
                    string.IsNullOrEmpty(function) ? line.ToString() : function,
                    file: string.Empty,
                    lineNumber: 0);
            }
            else
            {
                return GetStackFrame(function, file, lineNumber);
            }
        }
開發者ID:mike-kaufman,項目名稱:Glimpse.Prototype,代碼行數:28,代碼來源:ExceptionProcessor.cs

示例2: Write

        public long Write(ILogRecord record)
        {
            lock (_lockObj)
            {
                if (_isClosed)
                {
                    throw new ChunkWriteException(_currentChunk.ToString(), "Chunk writer is closed.");
                }

                //如果當前文件已經寫完,則需要新建文件
                if (_currentChunk.IsCompleted)
                {
                    _currentChunk = _chunkManager.AddNewChunk();
                }

                //先嘗試寫文件
                var result = _currentChunk.TryAppend(record);

                //如果當前文件已滿
                if (!result.Success)
                {
                    //結束當前文件
                    _currentChunk.Complete();

                    //新建新的文件
                    _currentChunk = _chunkManager.AddNewChunk();

                    //再嘗試寫入新的文件
                    result = _currentChunk.TryAppend(record);

                    //如果還是不成功,則報錯
                    if (!result.Success)
                    {
                        throw new ChunkWriteException(_currentChunk.ToString(), "Write record to chunk failed.");
                    }
                }

                //如果需要同步刷盤,則立即同步刷盤
                if (_chunkManager.Config.SyncFlush)
                {
                    _currentChunk.Flush();
                }

                //返回數據寫入位置
                return result.Position;
            }
        }
開發者ID:a407121393,項目名稱:equeue,代碼行數:47,代碼來源:ChunkWriter.cs

示例3: StackFrame

        static Frame StackFrame(Chunk line)
        {
            line.Advance("  at ");
            var function = line.Advance(" in ").ToString();
            var file = line.Advance(":line ").ToString();
            var lineNumber = line.ToInt32();

            return string.IsNullOrEmpty(file)
                ? LoadFrame(line.ToString(), "", 0)
                : LoadFrame(function, file, lineNumber);
            ;
        }
開發者ID:majimenezp,項目名稱:gate,代碼行數:12,代碼來源:ShowExceptions.cs

示例4: StackFrame

        private StackFrame StackFrame(Chunk line, bool showSource)
        {
            line.Advance("  at ");
            string function = line.Advance(" in ").ToString();
            string file = line.Advance(":line ").ToString();
            int lineNumber = line.ToInt32();

            return string.IsNullOrEmpty(file)
                ? LoadFrame(string.IsNullOrEmpty(function) ? line.ToString() : function, string.Empty, 0, showSource)
                : LoadFrame(function, file, lineNumber, showSource);
        }
開發者ID:Xamarui,項目名稱:Katana,代碼行數:11,代碼來源:ErrorPageMiddleware.cs

示例5: StackFrame

        private StackFrame StackFrame(Chunk line)
        {
            line.Advance("  at ");
            string function = line.Advance(" in ").ToString();

            //exception message line format differences in .net and mono
            //On .net : at ConsoleApplication.Program.Main(String[] args) in D:\Program.cs:line 16
            //On Mono : at ConsoleApplication.Program.Main(String[] args) in d:\Program.cs:16
            string file = !IsMono ?
                line.Advance(":line ").ToString() :
                line.Advance(":").ToString();

            int lineNumber = line.ToInt32();

            return string.IsNullOrEmpty(file)
                ? LoadFrame(string.IsNullOrEmpty(function) ? line.ToString() : function, string.Empty, 0)
                : LoadFrame(function, file, lineNumber);
        }
開發者ID:jgglg,項目名稱:Diagnostics,代碼行數:18,代碼來源:ErrorPageMiddleware.cs

示例6: CreatePrefabForChunk

 private void CreatePrefabForChunk(Chunk chunk)
 {
     Vector3 chunkGameObjectPosition =
         new Vector3(chunk.Position.X, chunk.Position.Z, chunk.Position.Y);
     Transform chunkGameObject =
         Instantiate(Chunk_Prefab, chunkGameObjectPosition, Quaternion.identity) as Transform;
     chunkGameObject.parent = m_ChunksParent;
     chunkGameObject.name = chunk.ToString();
     //m_ChunkGameObjects[x, y, z] = chunkGameObject;
     ChunkGameObjectScript chunkGameObjectScriptScript = chunkGameObject.GetComponent<ChunkGameObjectScript>();
     chunkGameObjectScriptScript.Texture = WorldTextureAtlas;
     chunk.ChunkTransform = chunkGameObject;
 }
開發者ID:scorpion44,項目名稱:BlockPackage,代碼行數:13,代碼來源:WorldGameObject.cs


注:本文中的Chunk.ToString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。