PrinterSettings.PrinterResolutionCollection PrinterSettings.PrinterResolutionCollection PrinterSettings.PrinterResolutionCollection PrinterSettings.PrinterResolutionCollection Class

定义

包含 PrinterResolution 对象的集合。Contains a collection of PrinterResolution objects.

public: ref class PrinterSettings::PrinterResolutionCollection : System::Collections::ICollection
public class PrinterSettings.PrinterResolutionCollection : System.Collections.ICollection
type PrinterSettings.PrinterResolutionCollection = class
    interface ICollection
    interface IEnumerable
Public Class PrinterSettings.PrinterResolutionCollection
Implements ICollection
继承
PrinterSettings.PrinterResolutionCollectionPrinterSettings.PrinterResolutionCollectionPrinterSettings.PrinterResolutionCollectionPrinterSettings.PrinterResolutionCollection
实现

示例

下面的代码示例用支持comboPrintResolution的分辨率填充组合框。The following code example populates the comboPrintResolution combo box with the supported resolutions. 该示例要求名为PrintDocument printDoc的变量存在并且存在特定的组合框。The example requires that a PrintDocument variable named printDoc exists and that the specific combo box exists.

// Add list of printer resolutions found on the printer to the combobox.
// The PrinterResolution's ToString() method will be used to provide the display String.
PrinterResolution^ pkResolution;
for ( int i = 0; i < printDoc->PrinterSettings->PrinterResolutions->Count; i++ )
{
   pkResolution = printDoc->PrinterSettings->PrinterResolutions[ i ];
   comboPrintResolution->Items->Add( pkResolution );
}
// Add list of printer resolutions found on the printer to the combobox.
// The PrinterResolution's ToString() method will be used to provide the display string.

PrinterResolution pkResolution;
for (int i = 0; i < printDoc.PrinterSettings.PrinterResolutions.Count; i++){
    pkResolution = printDoc.PrinterSettings.PrinterResolutions[i];
    comboPrintResolution.Items.Add(pkResolution);
}
' Add list of printer resolutions found on the printer to the combobox.
' The PrinterResolution's ToString() method will be used to provide the display string.
Dim pkResolution As PrinterResolution
For i = 0 to printDoc.PrinterSettings.PrinterResolutions.Count - 1
    pkResolution = printDoc.PrinterSettings.PrinterResolutions.Item(i)
    comboPrintResolution.Items.Add(pkResolution)
Next

注解

包含表示通过PrinterResolution.Kind属性支持的打印机分辨率的实例, 该属性包含一个PrinterResolutionKind值。 PrinterResolution PrinterSettings.PrinterResolutionCollectionThe PrinterSettings.PrinterResolutionCollection contains PrinterResolution instances that represents the printer resolutions supported through the PrinterResolution.Kind property, which contains one of the PrinterResolutionKind values.

通常情况下, 通过PageSettings.PrinterResolution属性将打印机的分辨率设置为有效PrinterResolution实例 (可通过PrinterResolutions集合获取)。Typically, you set the printer's resolution through the PageSettings.PrinterResolution property to a valid PrinterResolution instance available through the PrinterResolutions collection.

如果PrinterResolutionKind XCustom, 则使用和Y属性分别确定水平和垂直方向的自定义打印机分辨率。If PrinterResolutionKind is Custom, then use the X and Y properties to determine the custom printer resolution in the horizontal and vertical directions, respectively.

构造函数

PrinterSettings.PrinterResolutionCollection(PrinterResolution[]) PrinterSettings.PrinterResolutionCollection(PrinterResolution[]) PrinterSettings.PrinterResolutionCollection(PrinterResolution[]) PrinterSettings.PrinterResolutionCollection(PrinterResolution[])

初始化 PrinterSettings.PrinterResolutionCollection 类的新实例。Initializes a new instance of the PrinterSettings.PrinterResolutionCollection class.

属性

Count Count Count Count

获取集合中可用打印机分辨率的数目。Gets the number of available printer resolutions in the collection.

Item[Int32] Item[Int32] Item[Int32] Item[Int32]

获取指定索引处的 PrinterResolutionGets the PrinterResolution at a specified index.

方法

Add(PrinterResolution) Add(PrinterResolution) Add(PrinterResolution) Add(PrinterResolution)

向集合的末尾添加一个 PrinterResolutionAdds a PrinterResolution to the end of the collection.

CopyTo(PrinterResolution[], Int32) CopyTo(PrinterResolution[], Int32) CopyTo(PrinterResolution[], Int32) CopyTo(PrinterResolution[], Int32)

将当前 PrinterSettings.PrinterResolutionCollection 的内容复制到指定数组,从指定索引处开始。Copies the contents of the current PrinterSettings.PrinterResolutionCollection to the specified array, starting at the specified index.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

返回可循环访问集合的枚举数。Returns an enumerator that can iterate through the collection.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

显式界面实现

ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32)

有关此成员的说明,请参见 CopyTo(Array, Int32)For a description of this member, see CopyTo(Array, Int32).

ICollection.Count ICollection.Count ICollection.Count ICollection.Count

有关此成员的说明,请参见 CountFor a description of this member, see Count.

ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized

有关此成员的说明,请参见 IsSynchronizedFor a description of this member, see IsSynchronized.

ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot

有关此成员的说明,请参见 SyncRootFor a description of this member, see SyncRoot.

IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator()

有关此成员的说明,请参见 GetEnumerator()For a description of this member, see GetEnumerator().

扩展方法

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

IEnumerable 的元素强制转换为指定的类型。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

根据指定类型筛选 IEnumerable 的元素。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

启用查询的并行化。Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryableConverts an IEnumerable to an IQueryable.

适用于

另请参阅