PrinterSettings.PaperSourceCollection Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Contains a collection of PaperSource objects.
public: ref class PrinterSettings::PaperSourceCollection : System::Collections::ICollection
public class PrinterSettings.PaperSourceCollection : System.Collections.ICollection
type PrinterSettings.PaperSourceCollection = class
interface ICollection
interface IEnumerable
Public Class PrinterSettings.PaperSourceCollection
Implements ICollection
- Inheritance
-
PrinterSettings.PaperSourceCollection
- Implements
Examples
The following code example populates the comboPaperSource
combo box with the printer's supported paper sources. The SourceName is identified as the property that provides the display string for the item being added through the DisplayMember property of the combo box. The example requires that a PrintDocument variable named printDoc
exists and that the specific combo box exists.
// Add list of paper sources found on the printer to the combo box.
// The DisplayMember property is used to identify the property that will provide the display String*.
comboPaperSource->DisplayMember = "SourceName";
PaperSource^ pkSource;
for ( int i = 0; i < printDoc->PrinterSettings->PaperSources->Count; i++ )
{
pkSource = printDoc->PrinterSettings->PaperSources[ i ];
comboPaperSource->Items->Add( pkSource );
}
// Add list of paper sources found on the printer to the combo box.
// The DisplayMember property is used to identify the property that will provide the display string.
comboPaperSource.DisplayMember="SourceName";
PaperSource pkSource;
for (int i = 0; i < printDoc.PrinterSettings.PaperSources.Count; i++){
pkSource = printDoc.PrinterSettings.PaperSources[i];
comboPaperSource.Items.Add(pkSource);
}
' Add list of paper sources found on the printer to the combo box.
' The DisplayMember property is used to identify the property that will provide the display string.
comboPaperSource.DisplayMember = "SourceName"
Dim pkSource As PaperSource
For i = 0 to printDoc.PrinterSettings.PaperSources.Count - 1
pkSource = printDoc.PrinterSettings.PaperSources.Item(i)
comboPaperSource.Items.Add(pkSource)
Next
Remarks
The PrinterSettings.PaperSourceCollection contains PaperSource instances that represents the paper source trays through the PaperSource.Kind property, which contains one of the PaperSourceKind values.
Typically, you set a page's paper source through the PageSettings.PaperSource property to a valid PaperSource instance available through the PaperSources collection.
Constructors
PrinterSettings.PaperSourceCollection(PaperSource[]) |
Initializes a new instance of the PrinterSettings.PaperSourceCollection class. |
Properties
Count |
Gets the number of different paper sources in the collection. |
Item[Int32] |
Gets the PaperSource at a specified index. |
Methods
Add(PaperSource) |
Adds the specified PaperSource to end of the PrinterSettings.PaperSourceCollection. |
CopyTo(PaperSource[], Int32) |
Copies the contents of the current PrinterSettings.PaperSourceCollection to the specified array, starting at the specified index. |
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
GetEnumerator() |
Returns an enumerator that can iterate through the collection. |
GetHashCode() |
Serves as the default hash function. (Inherited from Object) |
GetType() |
Gets the Type of the current instance. (Inherited from Object) |
MemberwiseClone() |
Creates a shallow copy of the current Object. (Inherited from Object) |
ToString() |
Returns a string that represents the current object. (Inherited from Object) |
Explicit Interface Implementations
ICollection.CopyTo(Array, Int32) |
For a description of this member, see CopyTo(Array, Int32). |
ICollection.Count |
For a description of this member, see Count. |
ICollection.IsSynchronized |
For a description of this member, see IsSynchronized. |
ICollection.SyncRoot |
For a description of this member, see SyncRoot. |
IEnumerable.GetEnumerator() |
This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see GetEnumerator(). |
Extension Methods
Cast<TResult>(IEnumerable) |
Casts the elements of an IEnumerable to the specified type. |
OfType<TResult>(IEnumerable) |
Filters the elements of an IEnumerable based on a specified type. |
AsParallel(IEnumerable) |
Enables parallelization of a query. |
AsQueryable(IEnumerable) |
Converts an IEnumerable to an IQueryable. |