PrinterSettings.PaperSourceCollection Class

PrinterSettings.PaperSourceCollection Class

 

Contains a collection of PaperSource objects.

Namespace:   System.Drawing.Printing
Assembly:  System.Drawing (in System.Drawing.dll)

System.Object
  System.Drawing.Printing.PrinterSettings.PaperSourceCollection

public class PaperSourceCollection : ICollection, IEnumerable

NameDescription
System_CAPS_pubmethodPrinterSettings.PaperSourceCollection(PaperSource[])

Initializes a new instance of the PrinterSettings.PaperSourceCollection class.

NameDescription
System_CAPS_pubpropertyCount

Gets the number of different paper sources in the collection.

System_CAPS_pubpropertyItem[Int32]

Gets the PaperSource at a specified index.

NameDescription
System_CAPS_pubmethodAdd(PaperSource)

This API supports the product infrastructure and is not intended to be used directly from your code. Adds the specified PaperSource to end of the PrinterSettings.PaperSourceCollection.

System_CAPS_pubmethodCopyTo(PaperSource[], Int32)

Copies the contents of the current PrinterSettings.PaperSourceCollection to the specified array, starting at the specified index.

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetEnumerator()

Returns an enumerator that can iterate through the collection.

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodICollection.CopyTo(Array, Int32)

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see CopyTo.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIEnumerable.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.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyICollection.Count

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see Count.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyICollection.IsSynchronized

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see IsSynchronized.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyICollection.SyncRoot

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see SyncRoot.

NameDescription
System_CAPS_pubmethodAsParallel()

Overloaded. Enables parallelization of a query.(Defined by ParallelEnumerable.)

System_CAPS_pubmethodAsQueryable()

Overloaded. Converts an IEnumerable to an IQueryable.(Defined by Queryable.)

System_CAPS_pubmethodCast<TResult>()

Casts the elements of an IEnumerable to the specified type.(Defined by Enumerable.)

System_CAPS_pubmethodOfType<TResult>()

Filters the elements of an IEnumerable based on a specified type.(Defined by Enumerable.)

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.

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);
}

.NET Framework
Available since 1.1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft