Microsoft.Azure.Amqp.AmqpDebug.AmqpDebugImpl.DumpInternal C# (CSharp) Method

DumpInternal() private method

private DumpInternal ( string file ) : void
file string
return void
            void DumpInternal(string file)
            {
                using (var fs = System.IO.File.OpenWrite(file))
                {
                    // Truncate any existing data
                    fs.SetLength(0);

                    using (var sw = new System.IO.StreamWriter(fs))
                    {
                        sw.WriteLine(string.Format(CultureInfo.InvariantCulture, "ticks({0})\tdirection\top\tp1\tp2", System.TimeSpan.FromMilliseconds(1).Ticks));
                        int p = this.index;
                        for (int i = 0; i < this.entries.Length; ++i)
                        {
                            var t = this.entries[++p % this.entries.Length];
                            if (t.Ticks > 0)
                            {
                                sw.WriteLine(
                                    string.Format(
                                        CultureInfo.InvariantCulture,
                                        "{0}\t{1}\t{2}\t{3}\t{4}\t{5}",
                                        t.Ticks,
                                        t.ThreadId,
                                        t.Send ? "SEND" : "RECV",
                                        t.Code,
                                        t.Param1,
                                        t.Param2));
                            }
                        }
                    }
                }
            }
        }