public static CompressedStack Capture () { CompressedStack cs = new CompressedStack (0); cs._list = SecurityFrame.GetStack (1); // include any current CompressedStack inside the new Capture CompressedStack currentCs = Thread.CurrentThread.GetCompressedStack (); if (currentCs != null) { for (int i=0; i < currentCs._list.Count; i++) cs._list.Add (currentCs._list [i]); } return cs; }
/// <summary>Captures the compressed stack from the current thread.</summary> /// <returns>A <see cref="T:System.Threading.CompressedStack" /> object.</returns> /// <filterpriority>1</filterpriority> public static CompressedStack Capture() { CompressedStack compressedStack = new CompressedStack(0); compressedStack._list = SecurityFrame.GetStack(1); CompressedStack compressedStack2 = Thread.CurrentThread.GetCompressedStack(); if (compressedStack2 != null) { for (int i = 0; i < compressedStack2._list.Count; i++) { compressedStack._list.Add(compressedStack2._list[i]); } } return(compressedStack); }