PrintStringProperty 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
String 인쇄 시스템 하드웨어 또는 소프트웨어 구성 요소의 속성(및 해당 값)을 나타냅니다.
public ref class PrintStringProperty sealed : System::Printing::IndexedProperties::PrintProperty
[System.Serializable]
public sealed class PrintStringProperty : System.Printing.IndexedProperties.PrintProperty
public sealed class PrintStringProperty : System.Printing.IndexedProperties.PrintProperty
[<System.Serializable>]
type PrintStringProperty = class
inherit PrintProperty
type PrintStringProperty = class
inherit PrintProperty
Public NotInheritable Class PrintStringProperty
Inherits PrintProperty
- 상속
- 특성
예제
다음 예제에서는 위치, 포트 및 공유 상태에만 기존 프린터와 속성이 다른 두 번째 프린터를 설치 하려면이 클래스를 사용 하는 방법을 보여 줍니다.
LocalPrintServer myLocalPrintServer = new LocalPrintServer(PrintSystemDesiredAccess.AdministrateServer);
PrintQueue sourcePrintQueue = myLocalPrintServer.DefaultPrintQueue;
PrintPropertyDictionary myPrintProperties = sourcePrintQueue.PropertiesCollection;
// Share the new printer using Remove/Add methods
PrintBooleanProperty shared = new PrintBooleanProperty("IsShared", true);
myPrintProperties.Remove("IsShared");
myPrintProperties.Add("IsShared", shared);
// Give the new printer its share name using SetProperty method
PrintStringProperty theShareName = new PrintStringProperty("ShareName", "\"Son of " + sourcePrintQueue.Name +"\"");
myPrintProperties.SetProperty("ShareName", theShareName);
// Specify the physical location of the new printer using Remove/Add methods
PrintStringProperty theLocation = new PrintStringProperty("Location", "the supply room");
myPrintProperties.Remove("Location");
myPrintProperties.Add("Location", theLocation);
// Specify the port for the new printer
String[] port = new String[] { "COM1:" };
// Install the new printer on the local print server
PrintQueue clonedPrinter = myLocalPrintServer.InstallPrintQueue("My clone of " + sourcePrintQueue.Name, "Xerox WCP 35 PS", port, "WinPrint", myPrintProperties);
myLocalPrintServer.Commit();
// Report outcome
Console.WriteLine("{0} in {1} has been installed and shared as {2}", clonedPrinter.Name, clonedPrinter.Location, clonedPrinter.ShareName);
Console.WriteLine("Press Return to continue ...");
Console.ReadLine();
Dim myLocalPrintServer As New LocalPrintServer(PrintSystemDesiredAccess.AdministrateServer)
Dim sourcePrintQueue As PrintQueue = myLocalPrintServer.DefaultPrintQueue
Dim myPrintProperties As PrintPropertyDictionary = sourcePrintQueue.PropertiesCollection
' Share the new printer using Remove/Add methods
Dim [shared] As New PrintBooleanProperty("IsShared", True)
myPrintProperties.Remove("IsShared")
myPrintProperties.Add("IsShared", [shared])
' Give the new printer its share name using SetProperty method
Dim theShareName As New PrintStringProperty("ShareName", """Son of " & sourcePrintQueue.Name & """")
myPrintProperties.SetProperty("ShareName", theShareName)
' Specify the physical location of the new printer using Remove/Add methods
Dim theLocation As New PrintStringProperty("Location", "the supply room")
myPrintProperties.Remove("Location")
myPrintProperties.Add("Location", theLocation)
' Specify the port for the new printer
Dim port() As String = { "COM1:" }
' Install the new printer on the local print server
Dim clonedPrinter As PrintQueue = myLocalPrintServer.InstallPrintQueue("My clone of " & sourcePrintQueue.Name, "Xerox WCP 35 PS", port, "WinPrint", myPrintProperties)
myLocalPrintServer.Commit()
' Report outcome
Console.WriteLine("{0} in {1} has been installed and shared as {2}", clonedPrinter.Name, clonedPrinter.Location, clonedPrinter.ShareName)
Console.WriteLine("Press Return to continue ...")
Console.ReadLine()
생성자
| Name | Description |
|---|---|
| PrintStringProperty(String, Object) |
지정된 속성에 PrintStringProperty 대해 지정된 값을 가진 클래스의 새 인스턴스를 초기화합니다. |
| PrintStringProperty(String) |
지정된 속성에 대한 클래스의 PrintStringProperty 새 인스턴스를 초기화합니다. |
속성
| Name | Description |
|---|---|
| IsDisposed |
개체가 삭제되었는지 여부를 나타내는 값을 가져오거나 설정합니다. (다음에서 상속됨 PrintProperty) |
| IsInitialized |
개체가 초기화되었는지 여부를 나타내는 값을 가져오거나 설정합니다. (다음에서 상속됨 PrintProperty) |
| Name |
파생 클래스에서 재정의되는 경우 개체가 나타내는 속성의 이름을 가져옵니다. (다음에서 상속됨 PrintProperty) |
| Value |
나타내는 속성 PrintStringProperty 의 값을 가져오거나 설정합니다. |
메서드
| Name | Description |
|---|---|
| Dispose() |
에서 사용 중인 모든 리소스를 PrintProperty해제합니다. (다음에서 상속됨 PrintProperty) |
| Dispose(Boolean) |
사용 중인 PrintProperty 관리되지 않는 리소스를 해제하고 관리되는 리소스를 선택적으로 해제합니다. (다음에서 상속됨 PrintProperty) |
| Equals(Object) |
지정된 개체가 현재 개체와 같은지 여부를 확인합니다. (다음에서 상속됨 Object) |
| GetHashCode() |
기본 해시 함수로 사용됩니다. (다음에서 상속됨 Object) |
| GetType() |
현재 인스턴스의 Type 가져옵니다. (다음에서 상속됨 Object) |
| InternalDispose(Boolean) |
사용 중인 PrintProperty 관리되지 않는 리소스를 해제하고 관리되는 리소스를 선택적으로 해제합니다. (다음에서 상속됨 PrintProperty) |
| MemberwiseClone() |
현재 Object단순 복사본을 만듭니다. (다음에서 상속됨 Object) |
| OnDeserialization(Object) |
파생 클래스에서 재정의되는 경우 역직렬화가 완료되면 인터페이스를 구현 ISerializable 하고 역직렬화 이벤트를 발생합니다. (다음에서 상속됨 PrintProperty) |
| ToString() |
현재 개체를 나타내는 문자열을 반환합니다. (다음에서 상속됨 Object) |
연산자
| Name | Description |
|---|---|
| Implicit(PrintStringProperty to String) |
포인터String에서 값으로 PrintStringProperty 의 암시적 변환을 제공합니다. |