StylusPointCollection 類別

定義

包含 StylusPoint 物件的集合。Contains a collection of StylusPoint objects.

public ref class StylusPointCollection : System::Collections::ObjectModel::Collection<System::Windows::Input::StylusPoint>
public class StylusPointCollection : System.Collections.ObjectModel.Collection<System.Windows.Input.StylusPoint>
type StylusPointCollection = class
    inherit Collection<StylusPoint>
Public Class StylusPointCollection
Inherits Collection(Of StylusPoint)
繼承
StylusPointCollection

範例

下列範例會覆寫Stroke.DrawCore方法,以便在每個StylusPoint組成的Stroke上繪製一個圓圈。The following example overrides the Stroke.DrawCore method to draw a circle at each StylusPoint comprising a Stroke. 如果屬性設定為true,則GetBezierStylusPoints方法會傳回手寫筆點。 FitToCurveIf the FitToCurve property is set to true, the GetBezierStylusPoints method returns the stylus points. 否則, StylusPoints屬性會傳回手寫筆的點。Otherwise, the StylusPoints property returns the stylus points.

protected override void DrawCore(DrawingContext context, DrawingAttributes overrides)
{
    // Draw the stroke. Calling base.DrawCore accomplishes the same thing.
    Geometry geometry = GetGeometry(overrides);
    context.DrawGeometry(new SolidColorBrush(overrides.Color), null, geometry);

    StylusPointCollection points;

    // Get the stylus points used to draw the stroke.  The points used depends on
    // the value of FitToCurve.
    if (this.DrawingAttributes.FitToCurve)
    {
        points = this.GetBezierStylusPoints();
    }
    else
    {
        points = this.StylusPoints;
    }

    // Draw a circle at each stylus point.
    foreach (StylusPoint p in points)
    {
        context.DrawEllipse(null, new Pen(Brushes.Black, 1), (Point)p, 5, 5);
    }
  
}
Protected Overrides Sub DrawCore(ByVal context As DrawingContext, _
        ByVal overridedAttributes As DrawingAttributes)

    ' Draw the stroke. Calling base.DrawCore accomplishes the same thing.
    Dim geometry As Geometry = GetGeometry(overridedAttributes)
    context.DrawGeometry(New SolidColorBrush(overridedAttributes.Color), Nothing, geometry)

    Dim points As StylusPointCollection

    ' Get the stylus points used to draw the stroke.  The points used depends on
    ' the value of FitToCurve.
    If Me.DrawingAttributes.FitToCurve Then
        points = Me.GetBezierStylusPoints()
    Else
        points = Me.StylusPoints
    End If

    ' Draw a circle at each stylus point.
    Dim p As StylusPoint
    For Each p In points
        context.DrawEllipse(Nothing, New Pen(Brushes.Black, 1), CType(p, Point), 5, 5)
    Next p

End Sub

備註

具有,其中包含StylusPoint從手寫筆和數位板收集的物件。 StylusPointCollection StrokeA Stroke has a StylusPointCollection that contains StylusPoint objects collected from a stylus and digitizer. 您可以使用StylusPointCollection Stroke自訂。You can use the StylusPointCollection to customize the Stroke.

建構函式

StylusPointCollection()

初始化 StylusPointCollection 類別的新執行個體。Initializes a new instance of the StylusPointCollection class.

StylusPointCollection(IEnumerable<Point>)

使用指定的點來初始化 StylusPointCollection 類別的新執行個體。Initializes a new instance of the StylusPointCollection class with specified points.

StylusPointCollection(IEnumerable<StylusPoint>)

使用指定的 StylusPointCollection 物件,初始化 StylusPoint 類別的新執行個體。Initializes a new instance of the StylusPointCollection class with the specified StylusPoint objects.

StylusPointCollection(Int32)

初始化 StylusPointCollection 類別的新執行個體,這個執行個體最初可能含有指定數目的 StylusPoint 物件。Initializes a new instance of the StylusPointCollection class that may initially contain the specified number of StylusPoint objects.

StylusPointCollection(StylusPointDescription)

初始化 StylusPointCollection 類別的新執行個體,這個執行個體包含在 StylusPointDescription 中指定的屬性。Initializes a new instance of the StylusPointCollection class that contains the properties specified in the StylusPointDescription.

StylusPointCollection(StylusPointDescription, Int32)

初始化 StylusPointCollection 類別的新執行個體,這個執行個體是所指定的大小且包含在 StylusPointDescription 中指定的屬性。Initializes a new instance of the StylusPointCollection class that is the specified size and contains the properties specified in the StylusPointDescription.

屬性

Count

取得 Collection<T> 中實際包含的項目數目。Gets the number of elements actually contained in the Collection<T>.

(繼承來源 Collection<T>)
Description

取得與 StylusPointDescriptionStylusPoint 物件相關的 StylusPointCollectionGets the StylusPointDescription that is associated with the StylusPoint objects in the StylusPointCollection.

Item[Int32]

在指定的索引位置上取得或設定項目。Gets or sets the element at the specified index.

(繼承來源 Collection<T>)
Items

取得 IList<T> 周圍的 Collection<T> 包裝函式。Gets a IList<T> wrapper around the Collection<T>.

(繼承來源 Collection<T>)

方法

Add(StylusPointCollection)

將指定的 StylusPointCollection 加入至目前的 StylusPointCollectionAdds the specified StylusPointCollection to the current StylusPointCollection.

Add(T)

將物件加入至 Collection<T> 的末端。Adds an object to the end of the Collection<T>.

(繼承來源 Collection<T>)
Clear()

移除 Collection<T> 中的所有項目。Removes all elements from the Collection<T>.

(繼承來源 Collection<T>)
ClearItems()

StylusPoint 移除所有 StylusPointCollection 物件。Removes all StylusPoint objects from the StylusPointCollection.

Clone()

複製 StylusPointCollectionCopies the StylusPointCollection.

Contains(T)

判斷某項目是否在 Collection<T> 中。Determines whether an element is in the Collection<T>.

(繼承來源 Collection<T>)
CopyTo(T[], Int32)

從目標陣列的指定索引開始,將整個 Collection<T> 複製到相容的一維 ArrayCopies the entire Collection<T> to a compatible one-dimensional Array, starting at the specified index of the target array.

(繼承來源 Collection<T>)
Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetEnumerator()

傳回在 Collection<T> 中逐一查看的列舉值。Returns an enumerator that iterates through the Collection<T>.

(繼承來源 Collection<T>)
GetHashCode()

作為預設雜湊函數。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
IndexOf(T)

搜尋指定的物件,並傳回整個 Collection<T> 中第一個相符項目之以零起始的索引。Searches for the specified object and returns the zero-based index of the first occurrence within the entire Collection<T>.

(繼承來源 Collection<T>)
Insert(Int32, T)

將項目插入至 Collection<T> 中指定的索引位置。Inserts an element into the Collection<T> at the specified index.

(繼承來源 Collection<T>)
InsertItem(Int32, StylusPoint)

將指定的 StylusPoint 插入指定位置上的 StylusPointCollectionInserts the specified StylusPoint into the StylusPointCollection at the specified position.

InsertItem(Int32, T)

將項目插入至 Collection<T> 中指定的索引位置。Inserts an element into the Collection<T> at the specified index.

(繼承來源 Collection<T>)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
OnChanged(EventArgs)

引發 Changed 事件。Raises the Changed event.

Reformat(StylusPointDescription)

尋找指定的 StylusPointDescriptionDescription 屬性的交集。Finds the intersection of the specified StylusPointDescription and the Description property.

Remove(T)

Collection<T> 移除特定物件之第一個符合的元素。Removes the first occurrence of a specific object from the Collection<T>.

(繼承來源 Collection<T>)
RemoveAt(Int32)

移除 Collection<T> 之指定索引處的項目。Removes the element at the specified index of the Collection<T>.

(繼承來源 Collection<T>)
RemoveItem(Int32)

StylusPoint 中移除指定位置上的 StylusPointCollectionRemoves the StylusPoint at the specified position from the StylusPointCollection.

SetItem(Int32, StylusPoint)

在指定的位置上,設定指定的 StylusPointSets the specified StylusPoint at the specified position.

SetItem(Int32, T)

取代指定之索引處的項目。Replaces the element at the specified index.

(繼承來源 Collection<T>)
ToHiMetricArray()

StylusPoint 物件的屬性值轉換成 32 位元帶正負號的整數陣列。Converts the property values of the StylusPoint objects into a 32-bit signed integer array.

ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

運算子

Explicit(StylusPointCollection to Point[])

StylusPointCollection 轉換成點陣列。Converts a StylusPointCollection into a point array.

事件

Changed

發生於 StylusPointCollection 變更時。Occurs when the StylusPointCollection changes.

明確介面實作

ICollection.CopyTo(Array, Int32)

從特定的 ICollection 索引開始,將 Array 的項目複製到 ArrayCopies the elements of the ICollection to an Array, starting at a particular Array index.

(繼承來源 Collection<T>)
ICollection.IsSynchronized

取得值,這個值表示對 ICollection 的存取是否同步 (安全執行緒)。Gets a value indicating whether access to the ICollection is synchronized (thread safe).

(繼承來源 Collection<T>)
ICollection.SyncRoot

取得可用以同步存取 ICollection 的物件。Gets an object that can be used to synchronize access to the ICollection.

(繼承來源 Collection<T>)
ICollection<T>.IsReadOnly

取得值,指出 ICollection<T> 是否唯讀。Gets a value indicating whether the ICollection<T> is read-only.

(繼承來源 Collection<T>)
IEnumerable.GetEnumerator()

傳回逐一查看集合的列舉值。Returns an enumerator that iterates through a collection.

(繼承來源 Collection<T>)
IList.Add(Object)

將項目加入至 IListAdds an item to the IList.

(繼承來源 Collection<T>)
IList.Contains(Object)

判斷 IList 是否包含特定值。Determines whether the IList contains a specific value.

(繼承來源 Collection<T>)
IList.IndexOf(Object)

判斷 IList 中指定項目的索引。Determines the index of a specific item in the IList.

(繼承來源 Collection<T>)
IList.Insert(Int32, Object)

將項目插入 IList 中指定的索引處。Inserts an item into the IList at the specified index.

(繼承來源 Collection<T>)
IList.IsFixedSize

取得值,指出 IList 是否有固定的大小。Gets a value indicating whether the IList has a fixed size.

(繼承來源 Collection<T>)
IList.IsReadOnly

取得值,指出 IList 是否唯讀。Gets a value indicating whether the IList is read-only.

(繼承來源 Collection<T>)
IList.Item[Int32]

在指定的索引位置上取得或設定項目。Gets or sets the element at the specified index.

(繼承來源 Collection<T>)
IList.Remove(Object)

IList 移除特定物件之第一個符合的元素。Removes the first occurrence of a specific object from the IList.

(繼承來源 Collection<T>)

擴充方法

CopyToDataTable<T>(IEnumerable<T>)

根據輸入 DataTable 物件 (其中泛型參數 TDataRow) 傳回包含 IEnumerable<T> 物件複本的 DataRowReturns a DataTable that contains copies of the DataRow objects, given an input IEnumerable<T> object where the generic parameter T is DataRow.

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption)

根據輸入 DataRow 物件 (其中泛型參數 TDataTable),將 IEnumerable<T> 物件複製到指定的 DataRowCopies DataRow objects to the specified DataTable, given an input IEnumerable<T> object where the generic parameter T is DataRow.

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler)

根據輸入 DataRow 物件 (其中泛型參數 TDataTable),將 IEnumerable<T> 物件複製到指定的 DataRowCopies DataRow objects to the specified DataTable, given an input IEnumerable<T> object where the generic parameter T is DataRow.

Cast<TResult>(IEnumerable)

IEnumerable 的項目轉換成指定的型別。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

根據指定的型別來篩選 IEnumerable 的項目。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

啟用查詢的平行化作業。Enables parallelization of a query.

AsQueryable(IEnumerable)

IEnumerable 轉換成 IQueryableConverts an IEnumerable to an IQueryable.

Ancestors<T>(IEnumerable<T>)

傳回包含來源集合中每個節點祖系的項目集合。Returns a collection of elements that contains the ancestors of every node in the source collection.

Ancestors<T>(IEnumerable<T>, XName)

傳回包含來源集合中每個節點祖系的已篩選項目集合。Returns a filtered collection of elements that contains the ancestors of every node in the source collection. 集合中只會包含具有相符之 XName 的項目。Only elements that have a matching XName are included in the collection.

DescendantNodes<T>(IEnumerable<T>)

傳回來源集合中每個文件和項目之子代節點的集合。Returns a collection of the descendant nodes of every document and element in the source collection.

Descendants<T>(IEnumerable<T>)

傳回包含來源集合中每個項目和文件之子代項目的項目集合。Returns a collection of elements that contains the descendant elements of every element and document in the source collection.

Descendants<T>(IEnumerable<T>, XName)

傳回已篩選的項目集合,其中包含來源集合中每個項目和文件的子代項目。Returns a filtered collection of elements that contains the descendant elements of every element and document in the source collection. 集合中只會包含具有相符之 XName 的項目。Only elements that have a matching XName are included in the collection.

Elements<T>(IEnumerable<T>)

傳回來源集合中每個項目和文件的子項目集合。Returns a collection of the child elements of every element and document in the source collection.

Elements<T>(IEnumerable<T>, XName)

傳回來源集合中每個項目和文件的已篩選子項目集合。Returns a filtered collection of the child elements of every element and document in the source collection. 集合中只會包含具有相符之 XName 的項目。Only elements that have a matching XName are included in the collection.

InDocumentOrder<T>(IEnumerable<T>)

傳回包含來源集合中所有節點的節點集合,依據文件順序來排序。Returns a collection of nodes that contains all nodes in the source collection, sorted in document order.

Nodes<T>(IEnumerable<T>)

傳回來源集合中每個文件和項目的子節點集合。Returns a collection of the child nodes of every document and element in the source collection.

Remove<T>(IEnumerable<T>)

在來源集合中,從每一個節點的父節點移除這些節點。Removes every node in the source collection from its parent node.

適用於