using System; using System.Diagnostics; using System.Reflection; namespace Unity.Cloud { /// /// Represents a serializable stack frame. /// public class SerializableStackFrame { #region Constructors /// /// Creates a new instance of the class. /// public SerializableStackFrame() { // Empty } /// /// Creates a new instance of the class. /// /// The stack frame. public SerializableStackFrame(StackFrame stackFrame) { MethodBase method = stackFrame.GetMethod(); Type declaringType = method.DeclaringType; this.DeclaringType = declaringType != null ? declaringType.FullName : null; this.Method = method.ToString(); this.MethodName = method.Name; this.FileName = stackFrame.GetFileName(); this.FileLine = stackFrame.GetFileLineNumber(); this.FileColumn = stackFrame.GetFileColumnNumber(); } #endregion #region Properties /// /// Gets or sets the declaring type. /// public string DeclaringType { get; set; } /// /// Gets or sets the file column. /// public int FileColumn { get; set; } /// /// Gets or sets the file line. /// public int FileLine { get; set; } /// /// Gets or sets the file name. /// public string FileName { get; set; } /// /// Gets or sets the method. /// public string Method { get; set; } /// /// Gets or sets the method name. /// public string MethodName { get; set; } #endregion } }