PrinterSettings.PrinterResolutionCollection Classe

Definição

Contém uma coleção de PrinterResolution objetos.

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
Herança
PrinterSettings.PrinterResolutionCollection
Implementações

Exemplos

O exemplo de código seguinte preenche a comboPrintResolution caixa de combo com as resoluções suportadas. O exemplo exige que exista uma PrintDocument variável nomeada printDoc e que exista a caixa de combo específica.

// 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

Observações

Contém PrinterSettings.PrinterResolutionCollectionPrinterResolution instâncias que representam as resoluções da impressora suportadas pela PrinterResolution.Kind propriedade, que contém um dos PrinterResolutionKind valores.

Normalmente, define a resolução da impressora através da PageSettings.PrinterResolution propriedade para uma instância válida PrinterResolution disponível na PrinterResolutions coleção.

Se PrinterResolutionKind for Custom, então use as X propriedades e Y para determinar a resolução personalizada da impressora nas direções horizontal e vertical, respetivamente.

Construtores

Name Description
PrinterSettings.PrinterResolutionCollection(PrinterResolution[])

Inicializa uma nova instância da PrinterSettings.PrinterResolutionCollection classe.

Propriedades

Name Description
Count

Obtém o número de resoluções de impressora disponíveis na coleção.

Item[Int32]

Obtém-nos PrinterResolution num índice especificado.

Métodos

Name Description
Add(PrinterResolution)

Acrescenta um a PrinterResolution ao final da coleção.

CopyTo(PrinterResolution[], Int32)

Copia o conteúdo da corrente PrinterSettings.PrinterResolutionCollection para o array especificado, começando no índice especificado.

Equals(Object)

Determina se o objeto especificado é igual ao objeto atual.

(Herdado de Object)
GetEnumerator()

Devolve um enumerador que pode iterar pela coleção.

GetHashCode()

Serve como função de hash predefinida.

(Herdado de Object)
GetType()

Obtém o Type da instância atual.

(Herdado de Object)
MemberwiseClone()

Cria uma cópia superficial do atual Object.

(Herdado de Object)
ToString()

Devolve uma cadeia que representa o objeto atual.

(Herdado de Object)

Implementações de Interface Explícita

Name Description
ICollection.CopyTo(Array, Int32)

Para uma descrição deste elemento, veja CopyTo(Array, Int32).

ICollection.Count

Para uma descrição deste elemento, veja Count.

ICollection.IsSynchronized

Para uma descrição deste elemento, veja IsSynchronized.

ICollection.SyncRoot

Para uma descrição deste elemento, veja SyncRoot.

IEnumerable.GetEnumerator()

Para uma descrição deste elemento, veja GetEnumerator().

Métodos da Extensão

Name Description
AsParallel(IEnumerable)

Permite a paralelização de uma consulta.

AsQueryable(IEnumerable)

Converte um IEnumerable para um IQueryable.

Cast<TResult>(IEnumerable)

Conjura os elementos de an IEnumerable para o tipo especificado.

OfType<TResult>(IEnumerable)

Filtra os elementos de um IEnumerable com base num tipo especificado.

Aplica-se a

Ver também