<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>C# : Great Debug Information using the StackFrame</Title>
      <Shortcut>C#:GreatDebugInformationusingtheStackFrame</Shortcut>
      <Description>C# : Great Debug Information using the StackFrame [C#]</Description>
      <Author>Damon Carr</Author>
      <HelpUrl>/PreviewSnippet.aspx?SnippetID=7639d725-c70f-4fed-bac3-bd5452402a59</HelpUrl>
      <SnippetTypes>
        <SnippetType>SurroundsWith</SnippetType>
      </SnippetTypes>
    </Header>
    <Snippet>
      <Code Language="csharp"><![CDATA[		public string CallingMethod
		{
			get
			{
				StackFrame sf;
				StackTrace st = new StackTrace(true);
				StringBuilder oString = new StringBuilder();
				for (int i = 1 ; i < st.FrameCount ; i++)
				{
					// Note that high up the call stack, there is only
					// one stack frame.
					sf = st.GetFrame(i);
					oString.Append("METHOD: " + sf.GetMethod());
					oString.Append(" Line Number: " + sf.GetFileLineNumber() + AppUtils.StringSeperator);
				}
				return oString.ToString();
			}
		}]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>