Freigeben über


IXRPointCollection (Compact 2013)

3/28/2014

This collection represents a collection of XRPoint values that can be accessed individually by index.

Syntax

class IXRPointCollection : public IXRDependencyObject

Inheritance Hierarchy

IXRDependencyObject

    IXRPointCollection

Methods

Method

Description

IXRPointCollection::Add

Adds an item to the end of this collection and retrieves the index of where it was added.

IXRPointCollection::Clear

Removes all items from this collection.

IXRPointCollection::Contains

Determines whether an item is in this collection.

IXRPointCollection::GetCount

Retrieves the number of items in this collection.

IXRPointCollection::GetItem

Retrieves the item at the specified index in this collection.

IXRPointCollection::IndexOf

Searches for the specified item and retrieves the zero-based index of its first occurrence within this collection.

IXRPointCollection::Insert

Inserts an item into this collection at the location that has the specified index value.

IXRPointCollection::Remove

Removes the last occurrence of a specific item from this collection.

IXRPointCollection::RemoveAt

Removes the item at the specified index from this collection.

Thread Safety

Members of this class are thread safe if you previously called IXRApplication::CreateHostFromXaml and supplied it with an XRWindowCreateParams structure that has AllowsMultipleThreadAccess set to true. Allowing multiple-thread access can have a significant impact on application performance because this option serializes data for all objects in the collection across threads. If you have control over the lifetimes of these objects, it is recommended that you serialize only what is needed to achieve optimal performance.

Remarks

To use this class for manipulating the x,y coordinates that define a shape or path object, you can use this collection class together with the methods IXRPolyLineSegment::GetPoints, IXRPolyLineSegment::SetPoints, IXRPolyBezierSegment::GetPoints, IXRPolyBezierSegment::SetPoints, IXRPolyQuadraticBezierSegment::GetPoints, IXRPolyQuadraticBezierSegment::SetPoints, IXRPolygon::GetPoints, IXRPolygon::SetPoints, IXRPolyline::GetPoints, and IXRPolyline::SetPoints.

You can obtain a pointer to this collection for an object by calling its method GetPoints, listed above. Then, use the methods of this class to add, remove, or retrieve items. To clear the complete collection, call the IXRPointCollection::Clear method.

You can also create a new collection. To do this, use the IXRApplication::CreateObject(IID,Object) method to create an empty IXRPointCollection object. Then, use CreateObject to create multiple XRPoint values that each indicate the pattern of dashes and gaps used to outline a shape object. Next, add each XRPoint value to the IXRPointCollection collection by calling the IXRPointCollection::Add method. And finally, set the new collection for an object by calling its method SetPoints. Possible objects are IXRPolyLineSegment, IXRPolyBezierSegment, IXRPolyQuadraticBezierSegment, IXRPolygon, and IXRPolyline.

When you create a class instance, use an IXRPointCollectionPtr smart pointer instead of a raw interface pointer. For more information, see XRPtr<Interface>.

You can also define a point collection in Microsoft Silverlight 3 XAML. For information about the differences between XAML in XAML for Windows Embedded and Silverlight 3, see Differences Between Microsoft Silverlight 3 and XAML for Windows Embedded. For more information about how to define this collection in the source XAML for your application, see the PointCollection Class on MSDN.

.NET Framework Equivalent

System.Windows.Media.PointCollection

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

Classes for Collection Management
IXRPolyLineSegment::GetPoints
IXRPolyLineSegment::SetPoints
IXRPolyBezierSegment::GetPoints
IXRPolyBezierSegment::SetPoints
IXRPolyQuadraticBezierSegment::GetPoints
IXRPolyQuadraticBezierSegment::SetPoints
IXRPolygon::GetPoints
IXRPolygon::SetPoints
IXRPolyline::GetPoints
IXRPolyline::SetPoints