Sdílet prostřednictvím


StylusPointCollection Konstruktory

Definice

Inicializuje novou instanci StylusPointCollection třídy.

Přetížení

StylusPointCollection()

Inicializuje novou instanci StylusPointCollection třídy.

StylusPointCollection(IEnumerable<StylusPoint>)

Inicializuje novou instanci StylusPointCollection třídy se zadanými StylusPoint objekty.

StylusPointCollection(IEnumerable<Point>)

Inicializuje novou instanci StylusPointCollection třídy se zadanými body.

StylusPointCollection(Int32)

Inicializuje novou instanci StylusPointCollection třídy, která může zpočátku obsahovat zadaný počet StylusPoint objektů.

StylusPointCollection(StylusPointDescription)

Inicializuje novou instanci StylusPointCollection třídy, která obsahuje vlastnosti zadané v StylusPointDescription.

StylusPointCollection(StylusPointDescription, Int32)

Inicializuje novou instanci StylusPointCollection třídy, která má zadanou velikost a obsahuje vlastnosti zadané v objektu StylusPointDescription.

StylusPointCollection()

Inicializuje novou instanci StylusPointCollection třídy.

public:
 StylusPointCollection();
public StylusPointCollection ();
Public Sub New ()

Příklady

Následující příklad shromažďuje StylusPoint objekty v OnStylusDown metodě vlastního ovládacího prvku. V příkladu se StylusPointCollection vytvoří zadáním StylusPointDescription počáteční velikosti StylusPointCollectiona .

StylusPointCollection stylusPoints;

protected override void OnStylusDown(StylusDownEventArgs e)
{
    base.OnStylusDown(e);

    StylusPointCollection eventPoints = e.GetStylusPoints(this);

    // Create a new StylusPointCollection using the StylusPointDescription
    // from the stylus points in the StylusDownEventArgs.
    stylusPoints = new StylusPointCollection(eventPoints.Description, eventPoints.Count);
    stylusPoints.Add(eventPoints);
}
Private stylusPoints As StylusPointCollection


Protected Overrides Sub OnStylusDown(ByVal e As StylusDownEventArgs) 
    MyBase.OnStylusDown(e)
    
    Dim eventPoints As StylusPointCollection = e.GetStylusPoints(Me)
    
    ' Create a new StylusPointCollection using the StylusPointDescription
    ' from the stylus points in the StylusDownEventArgs.
    stylusPoints = New StylusPointCollection(eventPoints.Description, eventPoints.Count)
    stylusPoints.Add(eventPoints)

End Sub

Platí pro

StylusPointCollection(IEnumerable<StylusPoint>)

Inicializuje novou instanci StylusPointCollection třídy se zadanými StylusPoint objekty.

public:
 StylusPointCollection(System::Collections::Generic::IEnumerable<System::Windows::Input::StylusPoint> ^ stylusPoints);
public StylusPointCollection (System.Collections.Generic.IEnumerable<System.Windows.Input.StylusPoint> stylusPoints);
new System.Windows.Input.StylusPointCollection : seq<System.Windows.Input.StylusPoint> -> System.Windows.Input.StylusPointCollection
Public Sub New (stylusPoints As IEnumerable(Of StylusPoint))

Parametry

stylusPoints
IEnumerable<StylusPoint>

Obecný typ IEnumerable StylusPoint , který se má přidat do StylusPointCollection.

Výjimky

stylusPoints je null.

Délka points je 0.

-nebo-

Objekty StylusPoint v souboru stylusPoints mají nekompatibilní StylusPointDescription objekty.

Příklady

Následující příklad vytvoří .StylusPointCollection

StylusPoint stylusPoint1 =  new StylusPoint(100, 100, .5f);
StylusPoint stylusPoint2 = new StylusPoint(200, 200, .35f);

StylusPointCollection points = new StylusPointCollection(
    new StylusPoint[] { stylusPoint1, stylusPoint2 });
Dim stylusPoint1 As New StylusPoint(100, 100, 0.5F)
Dim stylusPoint2 As New StylusPoint(200, 200, 0.35F)

Dim points As New StylusPointCollection(New StylusPoint() {stylusPoint1, stylusPoint2})

Platí pro

StylusPointCollection(IEnumerable<Point>)

Inicializuje novou instanci StylusPointCollection třídy se zadanými body.

public:
 StylusPointCollection(System::Collections::Generic::IEnumerable<System::Windows::Point> ^ points);
public StylusPointCollection (System.Collections.Generic.IEnumerable<System.Windows.Point> points);
new System.Windows.Input.StylusPointCollection : seq<System.Windows.Point> -> System.Windows.Input.StylusPointCollection
Public Sub New (points As IEnumerable(Of Point))

Parametry

points
IEnumerable<Point>

Obecný IEnumerable typu Point , který určuje StylusPoint objekty, které se mají přidat do objektu StylusPointCollection.

Výjimky

points je null.

Délka points je 0.

Příklady

Následující příklad vytvoří .StylusPointCollection

StylusPointCollection points = new StylusPointCollection(new Point[]
    {
        new Point(100, 100),
        new Point(100, 200),
        new Point(200, 250),
        new Point(300, 300)
    });
Dim points As New StylusPointCollection(New Point() _
                        {New Point(100, 100), _
                         New Point(100, 200), _
                         New Point(200, 250), _
                         New Point(300, 300)})

Platí pro

StylusPointCollection(Int32)

Inicializuje novou instanci StylusPointCollection třídy, která může zpočátku obsahovat zadaný počet StylusPoint objektů.

public:
 StylusPointCollection(int initialCapacity);
public StylusPointCollection (int initialCapacity);
new System.Windows.Input.StylusPointCollection : int -> System.Windows.Input.StylusPointCollection
Public Sub New (initialCapacity As Integer)

Parametry

initialCapacity
Int32

Počet StylusPoint objektů, které StylusPointCollection může zpočátku obsahovat.

Výjimky

initialCapacity je negativní.

Příklady

Následující příklad shromažďuje StylusPoint objekty v OnStylusDown metodě vlastního ovládacího prvku. V příkladu se StylusPointCollection vytvoří zadáním počáteční velikosti StylusPointCollectioni StylusPointDescription velikosti .

StylusPointCollection stylusPoints;

protected override void OnStylusDown(StylusDownEventArgs e)
{
    base.OnStylusDown(e);

    StylusPointCollection eventPoints = e.GetStylusPoints(this);

    // Create a new StylusPointCollection using the StylusPointDescription
    // from the stylus points in the StylusDownEventArgs.
    stylusPoints = new StylusPointCollection(eventPoints.Description, eventPoints.Count);
    stylusPoints.Add(eventPoints);
}
Private stylusPoints As StylusPointCollection


Protected Overrides Sub OnStylusDown(ByVal e As StylusDownEventArgs) 
    MyBase.OnStylusDown(e)
    
    Dim eventPoints As StylusPointCollection = e.GetStylusPoints(Me)
    
    ' Create a new StylusPointCollection using the StylusPointDescription
    ' from the stylus points in the StylusDownEventArgs.
    stylusPoints = New StylusPointCollection(eventPoints.Description, eventPoints.Count)
    stylusPoints.Add(eventPoints)

End Sub

Poznámky

Když použijete StylusPointCollection konstruktor k vytvoření nového StylusPointCollection, určíte, že je initialCapacity. Můžete však přidat další StylusPoint objekty voláním Add metody.

Platí pro

StylusPointCollection(StylusPointDescription)

Inicializuje novou instanci StylusPointCollection třídy, která obsahuje vlastnosti zadané v StylusPointDescription.

public:
 StylusPointCollection(System::Windows::Input::StylusPointDescription ^ stylusPointDescription);
public StylusPointCollection (System.Windows.Input.StylusPointDescription stylusPointDescription);
new System.Windows.Input.StylusPointCollection : System.Windows.Input.StylusPointDescription -> System.Windows.Input.StylusPointCollection
Public Sub New (stylusPointDescription As StylusPointDescription)

Parametry

stylusPointDescription
StylusPointDescription

A StylusPointDescription , který určuje další vlastnosti uložené v každé StylusPoint.

Výjimky

stylusPointDescription je null.

Příklady

Následující příklad shromažďuje StylusPoint objekty v OnStylusDown metodě vlastního ovládacího prvku. V příkladu se StylusPointCollection vytvoří zadáním StylusPointDescription počáteční velikosti StylusPointCollectiona .

StylusPointCollection stylusPoints;

protected override void OnStylusDown(StylusDownEventArgs e)
{
    base.OnStylusDown(e);

    StylusPointCollection eventPoints = e.GetStylusPoints(this);

    // Create a new StylusPointCollection using the StylusPointDescription
    // from the stylus points in the StylusDownEventArgs.
    stylusPoints = new StylusPointCollection(eventPoints.Description, eventPoints.Count);
    stylusPoints.Add(eventPoints);
}
Private stylusPoints As StylusPointCollection


Protected Overrides Sub OnStylusDown(ByVal e As StylusDownEventArgs) 
    MyBase.OnStylusDown(e)
    
    Dim eventPoints As StylusPointCollection = e.GetStylusPoints(Me)
    
    ' Create a new StylusPointCollection using the StylusPointDescription
    ' from the stylus points in the StylusDownEventArgs.
    stylusPoints = New StylusPointCollection(eventPoints.Description, eventPoints.Count)
    stylusPoints.Add(eventPoints)

End Sub

Poznámky

Všechny StylusPoint objekty přidané do StylusPointCollection musí mít StylusPointDescription objekt, který je kompatibilní s stylusPointDescription.

Platí pro

StylusPointCollection(StylusPointDescription, Int32)

Inicializuje novou instanci StylusPointCollection třídy, která má zadanou velikost a obsahuje vlastnosti zadané v objektu StylusPointDescription.

public:
 StylusPointCollection(System::Windows::Input::StylusPointDescription ^ stylusPointDescription, int initialCapacity);
public StylusPointCollection (System.Windows.Input.StylusPointDescription stylusPointDescription, int initialCapacity);
new System.Windows.Input.StylusPointCollection : System.Windows.Input.StylusPointDescription * int -> System.Windows.Input.StylusPointCollection
Public Sub New (stylusPointDescription As StylusPointDescription, initialCapacity As Integer)

Parametry

stylusPointDescription
StylusPointDescription

A StylusPointDescription , který určuje další vlastnosti uložené v každé StylusPoint.

initialCapacity
Int32

Počet StylusPoint objektů, které StylusPointCollection může zpočátku obsahovat.

Výjimky

initialCapacity je negativní.

stylusPointDescription je null.

Příklady

Následující příklad shromažďuje StylusPoint objekty v OnStylusDown metodě vlastního ovládacího prvku. V příkladu se StylusPointCollection vytvoří zadáním StylusPointDescription počáteční velikosti StylusPointCollectiona .

StylusPointCollection stylusPoints;

protected override void OnStylusDown(StylusDownEventArgs e)
{
    base.OnStylusDown(e);

    StylusPointCollection eventPoints = e.GetStylusPoints(this);

    // Create a new StylusPointCollection using the StylusPointDescription
    // from the stylus points in the StylusDownEventArgs.
    stylusPoints = new StylusPointCollection(eventPoints.Description, eventPoints.Count);
    stylusPoints.Add(eventPoints);
}
Private stylusPoints As StylusPointCollection


Protected Overrides Sub OnStylusDown(ByVal e As StylusDownEventArgs) 
    MyBase.OnStylusDown(e)
    
    Dim eventPoints As StylusPointCollection = e.GetStylusPoints(Me)
    
    ' Create a new StylusPointCollection using the StylusPointDescription
    ' from the stylus points in the StylusDownEventArgs.
    stylusPoints = New StylusPointCollection(eventPoints.Description, eventPoints.Count)
    stylusPoints.Add(eventPoints)

End Sub

Poznámky

Když použijete StylusPointCollection konstruktor k vytvoření nového StylusPointCollectionobjektu StylusPointCollection , vytvoří se s kapacitou pro uložení zadaného počtu StylusPoint objektů. Můžete přidat více StylusPoint objektů než initialCapacity voláním Add metody.

Platí pro