This documentation is archived and is not being maintained.

Breakpoint.FunctionName Property

Gets the name of the function where the breakpoint is set.

Namespace: EnvDTE
Assembly: EnvDTE (in envdte.dll)

string FunctionName { get; }
/** @property */
String get_FunctionName ()

function get FunctionName () : String

Property Value

A string that represents the name of the function.

The following example demonstrates how to use the FunctionName property.

To test this property:

  1. Set a breakpoint in the target application.

  2. Run the add-in.

public static void FunctionName(DTE dte)
{
    // Setup debug Output window.
    Window w = (Window)dte.Windows.Item(EnvDTE.Constants.vsWindowKindOutput);
    w.Visible = true;
    OutputWindow ow = (OutputWindow)w.Object;
    OutputWindowPane owp = ow.OutputWindowPanes.Add("FunctionName property: ");
    owp.Activate();

    // dte is a reference to the DTE object passed to you by the
    // OnConnection method that you implement when you create an add-in.
    EnvDTE.Debugger debugger = (EnvDTE.Debugger)dte.Debugger;
    owp.OutputString("Breakpoint in the file " + debugger.Breakpoints.Item(1).File);
    owp.OutputString(" on line " + 
                     debugger.Breakpoints.Item(1).FileLine.ToString() + " column ");
    owp.OutputString(debugger.Breakpoints.Item(1).FileColumn.ToString() + " is ");
    owp.OutputString(debugger.Breakpoints.Item(1).Enabled ? "enabled." : "disabled.");
    owp.OutputString("\nThis breakpoint is in the function: " + 
                     debugger.Breakpoints.Item(1).FunctionName);
}
Show: