StylusPointCollection Konstruktorer
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Initierar en ny instans av StylusPointCollection klassen.
Överlagringar
| Name | Description |
|---|---|
| StylusPointCollection() |
Initierar en ny instans av StylusPointCollection klassen. |
| StylusPointCollection(IEnumerable<StylusPoint>) |
Initierar en ny instans av StylusPointCollection klassen med de angivna StylusPoint objekten. |
| StylusPointCollection(IEnumerable<Point>) |
Initierar en ny instans av StylusPointCollection klassen med angivna punkter. |
| StylusPointCollection(Int32) |
Initierar en ny instans av StylusPointCollection klassen som ursprungligen kan innehålla det angivna antalet StylusPoint objekt. |
| StylusPointCollection(StylusPointDescription) |
Initierar en ny instans av StylusPointCollection klassen som innehåller egenskaperna som anges i StylusPointDescription. |
| StylusPointCollection(StylusPointDescription, Int32) |
Initierar en ny instans av StylusPointCollection klassen som är den angivna storleken och innehåller de egenskaper som anges i StylusPointDescription. |
StylusPointCollection()
Initierar en ny instans av StylusPointCollection klassen.
public:
StylusPointCollection();
public StylusPointCollection();
Public Sub New ()
Exempel
I följande exempel samlas StylusPoint objekt in i OnStylusDown metoden för en anpassad kontroll. Exemplet skapar en StylusPointCollection genom att StylusPointDescription ange och den ursprungliga storleken på StylusPointCollection.
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
Gäller för
StylusPointCollection(IEnumerable<StylusPoint>)
Initierar en ny instans av StylusPointCollection klassen med de angivna StylusPoint objekten.
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))
Parametrar
- stylusPoints
- IEnumerable<StylusPoint>
En allmän IEnumerable av typen StylusPoint som ska läggas till i StylusPointCollection.
Undantag
stylusPoints är null.
Längden points på är 0.
-eller-
Objekten StylusPoint i stylusPoints har inkompatibla StylusPointDescription objekt.
Exempel
I följande exempel skapas en 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})
Gäller för
StylusPointCollection(IEnumerable<Point>)
Initierar en ny instans av StylusPointCollection klassen med angivna punkter.
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))
Parametrar
- points
- IEnumerable<Point>
En allmän IEnumerable av typen Point som anger vilka objekt som StylusPoint ska läggas till i StylusPointCollection.
Undantag
points är null.
Längden points på är 0.
Exempel
I följande exempel skapas en 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)})
Gäller för
StylusPointCollection(Int32)
Initierar en ny instans av StylusPointCollection klassen som ursprungligen kan innehålla det angivna antalet 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)
Parametrar
- initialCapacity
- Int32
Antalet StylusPoint objekt som StylusPointCollection kan innehålla.
Undantag
initialCapacity är negativ.
Exempel
I följande exempel samlas StylusPoint objekt in i OnStylusDown metoden för en anpassad kontroll. Exemplet skapar en StylusPointCollection genom att ange både och StylusPointDescription den ursprungliga storleken på StylusPointCollection.
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
Kommentarer
När du använder StylusPointCollection konstruktorn för att skapa en ny StylusPointCollectionanger du att den är initialCapacity. Du kan dock lägga till fler StylusPoint objekt genom att anropa Add metoden.
Gäller för
StylusPointCollection(StylusPointDescription)
Initierar en ny instans av StylusPointCollection klassen som innehåller egenskaperna som anges i 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)
Parametrar
- stylusPointDescription
- StylusPointDescription
A StylusPointDescription som anger de ytterligare egenskaper som lagras i varje StylusPoint.
Undantag
stylusPointDescription är null.
Exempel
I följande exempel samlas StylusPoint objekt in i OnStylusDown metoden för en anpassad kontroll. Exemplet skapar en StylusPointCollection genom att StylusPointDescription ange och den ursprungliga storleken på StylusPointCollection.
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
Kommentarer
Alla StylusPoint objekt som StylusPointCollection läggs till i måste ha en StylusPointDescription som är kompatibel med stylusPointDescription.
Gäller för
StylusPointCollection(StylusPointDescription, Int32)
Initierar en ny instans av StylusPointCollection klassen som är den angivna storleken och innehåller de egenskaper som anges i 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)
Parametrar
- stylusPointDescription
- StylusPointDescription
A StylusPointDescription som anger de ytterligare egenskaper som lagras i varje StylusPoint.
- initialCapacity
- Int32
Antalet StylusPoint objekt som StylusPointCollection kan innehålla.
Undantag
initialCapacity är negativ.
stylusPointDescription är null.
Exempel
I följande exempel samlas StylusPoint objekt in i OnStylusDown metoden för en anpassad kontroll. Exemplet skapar en StylusPointCollection genom att StylusPointDescription ange och den ursprungliga storleken på StylusPointCollection.
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
Kommentarer
När du använder StylusPointCollection konstruktorn för att skapa en ny StylusPointCollectionStylusPointCollectionskapas den med kapaciteten för att lagra det angivna antalet StylusPoint objekt. Du kan lägga till fler StylusPoint objekt än initialCapacity genom att anropa Add metoden.