本文整理汇总了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);
}
}
示例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;
}
}
示例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);
;
}
示例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);
}
示例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);
}
示例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;
}