Breakpoints.Add أسلوب

ينشئ و تمكن من نقطة توقف جديدة.

مساحة الاسم:  EnvDTE
التجميع:  EnvDTE (في EnvDTE.dll)

بناء الجملة

'إقرار
Function Add ( _
    Function As String, _
    File As String, _
    Line As Integer, _
    Column As Integer, _
    Condition As String, _
    ConditionType As dbgBreakpointConditionType, _
    Language As String, _
    Data As String, _
    DataCount As Integer, _
    Address As String, _
    HitCount As Integer, _
    HitCountType As dbgHitCountType _
) As Breakpoints
Breakpoints Add(
    string Function,
    string File,
    int Line,
    int Column,
    string Condition,
    dbgBreakpointConditionType ConditionType,
    string Language,
    string Data,
    int DataCount,
    string Address,
    int HitCount,
    dbgHitCountType HitCountType
)
Breakpoints^ Add(
    [InAttribute] String^ Function, 
    [InAttribute] String^ File, 
    [InAttribute] int Line, 
    [InAttribute] int Column, 
    [InAttribute] String^ Condition, 
    [InAttribute] dbgBreakpointConditionType ConditionType, 
    [InAttribute] String^ Language, 
    [InAttribute] String^ Data, 
    [InAttribute] int DataCount, 
    [InAttribute] String^ Address, 
    [InAttribute] int HitCount, 
    [InAttribute] dbgHitCountType HitCountType
)
abstract Add : 
        Function:string * 
        File:string * 
        Line:int * 
        Column:int * 
        Condition:string * 
        ConditionType:dbgBreakpointConditionType * 
        Language:string * 
        Data:string * 
        DataCount:int * 
        Address:string * 
        HitCount:int * 
        HitCountType:dbgHitCountType -> Breakpoints 
function Add(
    Function : String, 
    File : String, 
    Line : int, 
    Column : int, 
    Condition : String, 
    ConditionType : dbgBreakpointConditionType, 
    Language : String, 
    Data : String, 
    DataCount : int, 
    Address : String, 
    HitCount : int, 
    HitCountType : dbgHitCountType
) : Breakpoints

المعلمات

  • Function
    النوع: System.String
    اختياري.نقطة توقف دالة.اسم دالة التي نقطة الإيقاف هو تعيين.
  • File
    النوع: System.String
    اختياري.نقطة توقف ملف.اسم ومسار الاختيارية ملف بحيث يتم تعيين نقطة الإيقاف.
  • Line
    النوع: System.Int32
    اختياري.نقطة توقف ملف.قياس رقم سطر تعليمات برمجية المصدر، من يبدأ دالة، تعيين نقطة الإيقاف.إذا كانت هذه القيمة 1، يتم تعيين نقطة الإيقاف تلك في يبدأ دالة.
  • Column
    النوع: System.Int32
    اختياري.نقطة توقف ملف.الحرف الذي نقطة الإيقاف هو تعيين.في معظم الحالات، يمكنك المغادرة هذه القيمة التعيين إلى 1، الذي التعيين s نقطة الإيقاف تلك في بداية السطر.
  • Condition
    النوع: System.String
    اختياري.نقطة توقف Condition.استخدم مع ConditionType.
  • Language
    النوع: System.String
    اختياري.لغة البرمجة التي دالة هو مكتوبة.
  • Data
    النوع: System.String
    اختياري.نقطة توقف بيانات.إذا كانت نقطة الإيقاف هو معينة على متغير ما، يمكنك تحديد اسم المتغير.يمكنك استخدام سياق العامل (C/C++ تعبيرات اللغة)إلى تعيين متغير خارج نطاق الحالي.
  • DataCount
    النوع: System.Int32
    اختياري.نقطة توقف بيانات.إذا تم تعيين نقطة الإيقاف تلك في متغير، وإذا كان المتغير هو الصفيف أو المؤشر dereferenced، تحدد هذه القيمة عدد العناصر إلى ساعة.
  • Address
    النوع: System.String
    اختياري.العنوان نقطة توقف.العنوان ذاكرة مكان نقطة الإيقاف هو معينة، بالتنسيق الست عشري أو عشري.
  • HitCount
    النوع: System.Int32
    اختياري.Hit Countخاصية نقطة توقف.إذا قمت بتحديد العدد الوصول لا يقطع تنفيذ البرنامج في كل مرة تقوم نقطة الإيقاف هو إصابة.إذا قمت بتحديد العدد الوصول تنفيذ برنامج فواصل في الفرعي رقم لالعدد الدخول.

القيمة المُرجعة

النوع: EnvDTE.Breakpoints
Breakpointsمجموعة.

ملاحظات

إنشاء ويقوم بتمكين نقطة توقف جديدة و إرجاع Breakpointsمجموعة.

All parameters for this method are optional; however you can specify only one of four location أنواع, كـ described below.

إلى التعيين نقطة توقف في هذا النوع من الموقع

استخدام معلمة (معلمات)

داخل دالة.

Function

ضمن ملف. يمكنك اختيارياً بتحديد الموقع السطر والعمود داخل ملف.

File و Line و Column

في بيانات. يمكن تعيين بشكل اختياري للمتغيرات والعدد من المتغيرات إلى ساعة.

Data و DataCount

في العنوان محدد.

Address

لأي من هذه الأنواع من الموقع، يمكنك اختيارياً توفير Conditionو ConditionTypeفصل فقط عند شرطا معيناً هو صواب. يمكنك اختيارياً توفير HitCountو HitCountTypeإلى القطع عند المحدد العدد الوصول.

أمثلة

يوضح المثال التالي كيفية إلى تستخدم في Addالأسلوب.

إلى اختبار هذه الطريقة:

  1. فتح مشروع الهدف وتشغيلها إضافة-في.
public static void Add(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("Add Method Test: ");
    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;
    debugger.Breakpoints.Add("","Target001.cs", 13, 1, "", 
                             EnvDTE.dbgBreakpointConditionType.dbgBreakpointConditionTypeWhenTrue, 
                             "C#","", 0, "", 0, EnvDTE.dbgHitCountType.dbgHitCountTypeNone);
    debugger.Breakpoints.Add("","Target001.cs", 15, 1, "", 
                             EnvDTE.dbgBreakpointConditionType.dbgBreakpointConditionTypeWhenTrue, 
                             "C#","", 0, "", 0, EnvDTE.dbgHitCountType.dbgHitCountTypeNone);

    owp.OutputString("\nNumber of Breakpoints: " + debugger.Breakpoints.Count);
    owp.OutputString("\nEdition of the environment: " + 
                     debugger.Breakpoints.DTE.Edition);
    owp.OutputString("\nParent's Current Mode: " + 
                     debugger.Breakpoints.Parent.CurrentMode);
    owp.OutputString("\nFirst breakpoint is on line " + 
                     debugger.Breakpoints.Item(1).FileLine + ".");
    owp.OutputString("\nSecond breakpoint is on line " + 
                     debugger.Breakpoints.Item(2).FileLine + ".");
}
Shared Sub AddBreakpoint(ByRef dte As EnvDTE.DTE)
    dte.Debugger.StepInto(True)
    dte.Debugger.Breakpoints.Add("", "Target001.cs", 13, 1, "", _
                                 EnvDTE.dbgBreakpointConditionType.dbgBreakpointConditionTypeWhenTrue, _
                                 "C#", "", 0, "", 0, EnvDTE.dbgHitCountType.dbgHitCountTypeNone)
    dte.Debugger.Breakpoints.Add("", "Target001.cs", 15, 1, "", _
                                 EnvDTE.dbgBreakpointConditionType.dbgBreakpointConditionTypeWhenTrue, _
                                 "C#", "", 0, "", 0, EnvDTE.dbgHitCountType.dbgHitCountTypeNone)
End Sub

أمن NET Framework.

راجع أيضًَا

المرجع

Breakpoints واجهة

Breakpoints الأعضاء

EnvDTE مساحة الاسم