ValidationResult ValidationResult ValidationResult ValidationResult Struct

定義

マージを表すPrintTicket実行可能なように変更されたすべての設定のレポートで、実行可能なことが保証されています。Represents a merged PrintTicket that is guaranteed to be viable, with a report of any settings that were changed to make it viable.

public value class ValidationResult
[System.Runtime.InteropServices.ComVisible(false)]
public struct ValidationResult
type ValidationResult = struct
Public Structure ValidationResult
継承
ValidationResultValidationResultValidationResultValidationResult
属性

次の例では、2 つの印刷チケットをマージするときにこの型の値を使用する方法を示します。The following example shows how to use the values of this type while merging two print tickets.

/// <summary>
/// Changes the user-default PrintTicket setting of the specified print queue.
/// </summary>
/// <param name="queue">the printer whose user-default PrintTicket setting needs to be changed</param>
static private void ChangePrintTicketSetting(PrintQueue queue)
{
    //
    // Obtain the printer's PrintCapabilities so we can determine whether or not
    // duplexing printing is supported by the printer.
    //
    PrintCapabilities printcap = queue.GetPrintCapabilities();

    //
    // The printer's duplexing capability is returned as a read-only collection of duplexing options
    // that can be supported by the printer. If the collection returned contains the duplexing
    // option we want to set, it means the duplexing option we want to set is supported by the printer,
    // so we can make the user-default PrintTicket setting change.
    //
    if (printcap.DuplexingCapability.Contains(Duplexing.TwoSidedLongEdge))
    {
        //
        // To change the user-default PrintTicket, we can first create a delta PrintTicket with
        // the new duplexing setting.
        //
        PrintTicket deltaTicket = new PrintTicket();
        deltaTicket.Duplexing = Duplexing.TwoSidedLongEdge;

        //
        // Then merge the delta PrintTicket onto the printer's current user-default PrintTicket,
        // and validate the merged PrintTicket to get the new PrintTicket we want to set as the
        // printer's new user-default PrintTicket.
        //
        ValidationResult result = queue.MergeAndValidatePrintTicket(queue.UserPrintTicket, deltaTicket);

        //
        // The duplexing option we want to set could be constrained by other PrintTicket settings
        // or device settings. We can check the validated merged PrintTicket to see whether the
        // the validation process has kept the duplexing option we want to set unchanged.
        //
        if (result.ValidatedPrintTicket.Duplexing == Duplexing.TwoSidedLongEdge)
        {
            //
            // Set the printer's user-default PrintTicket and commit the set operation.
            //
            queue.UserPrintTicket = result.ValidatedPrintTicket;
            queue.Commit();
            Console.WriteLine("PrintTicket new duplexing setting is set on '{0}'.", queue.FullName);
        }
        else
        {
            //
            // The duplexing option we want to set has been changed by the validation process
            // when it was resolving setting constraints.
            //
            Console.WriteLine("PrintTicket new duplexing setting is constrained on '{0}'.", queue.FullName);
        }
    }
    else
    {
        //
        // If the printer doesn't support the duplexing option we want to set, skip it.
        //
        Console.WriteLine("PrintTicket new duplexing setting is not supported on '{0}'.", queue.FullName);
    }
}
''' <summary>
''' Changes the user-default PrintTicket setting of the specified print queue.
''' </summary>
''' <param name="queue">the printer whose user-default PrintTicket setting needs to be changed</param>
Private Shared Sub ChangePrintTicketSetting(ByVal queue As PrintQueue)
	'
	' Obtain the printer's PrintCapabilities so we can determine whether or not
	' duplexing printing is supported by the printer.
	'
	Dim printcap As PrintCapabilities = queue.GetPrintCapabilities()

	'
	' The printer's duplexing capability is returned as a read-only collection of duplexing options
	' that can be supported by the printer. If the collection returned contains the duplexing
	' option we want to set, it means the duplexing option we want to set is supported by the printer,
	' so we can make the user-default PrintTicket setting change.
	'
	If printcap.DuplexingCapability.Contains(Duplexing.TwoSidedLongEdge) Then
		'
		' To change the user-default PrintTicket, we can first create a delta PrintTicket with
		' the new duplexing setting.
		'
		Dim deltaTicket As New PrintTicket()
		deltaTicket.Duplexing = Duplexing.TwoSidedLongEdge

		'
		' Then merge the delta PrintTicket onto the printer's current user-default PrintTicket,
		' and validate the merged PrintTicket to get the new PrintTicket we want to set as the
		' printer's new user-default PrintTicket.
		'
		Dim result As ValidationResult = queue.MergeAndValidatePrintTicket(queue.UserPrintTicket, deltaTicket)

		'
		' The duplexing option we want to set could be constrained by other PrintTicket settings
		' or device settings. We can check the validated merged PrintTicket to see whether the
		' the validation process has kept the duplexing option we want to set unchanged.
		'
		If result.ValidatedPrintTicket.Duplexing = Duplexing.TwoSidedLongEdge Then
			'
			' Set the printer's user-default PrintTicket and commit the set operation.
			'
			queue.UserPrintTicket = result.ValidatedPrintTicket
			queue.Commit()
			Console.WriteLine("PrintTicket new duplexing setting is set on '{0}'.", queue.FullName)
		Else
			'
			' The duplexing option we want to set has been changed by the validation process
			' when it was resolving setting constraints.
			'
			Console.WriteLine("PrintTicket new duplexing setting is constrained on '{0}'.", queue.FullName)
		End If
	Else
		'
		' If the printer doesn't support the duplexing option we want to set, skip it.
		'
		Console.WriteLine("PrintTicket new duplexing setting is not supported on '{0}'.", queue.FullName)
	End If
End Sub

注釈

場合、初期PrintTicket印刷、プリンターがサポートされていない機能の確認、プリンター ドライバーは、実行可能なチケットを生成するためにすべての競合を解決します。If the initial PrintTicket asks for printing functionality that the printer does not support, the printer driver resolves all conflicts in order to produce a viable ticket.

プロパティ

ConflictStatus ConflictStatus ConflictStatus ConflictStatus

プリンターでサポートされる機能と 2 つのソースの初期マージで要求された機能の間の競合が発生したかどうかを示す値を取得しますPrintTicket秒。Gets a value indicating whether a conflict occurred between the functionality supported by the printer and the functionality requested in the initial merger of two source PrintTickets.

ValidatedPrintTicket ValidatedPrintTicket ValidatedPrintTicket ValidatedPrintTicket

取得、 PrintTicket 2 つの結合された結果、オブジェクトPrintTicketオブジェクトで、保証するに調整されている場合があります。Gets a PrintTicket object that results from the merging of two PrintTicket objects, which might have been adjusted to ensure its viability.

メソッド

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

指定した ValidationResult が現在の ValidationResult と等しいかどうかを示します。Determines whether the specified ValidationResult is equal to the current ValidationResult.

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

関連付けられたハッシュ コードを取得、ValidationResultとそのPrintTicket呼び出し力ストリーム。Gets the hash code associated with the ValidationResult and its PrintTicket and print stream.

演算子

Equality(ValidationResult, ValidationResult) Equality(ValidationResult, ValidationResult) Equality(ValidationResult, ValidationResult) Equality(ValidationResult, ValidationResult)

かどうかを指定したValidationResultオブジェクトが等しい。Determines if the specified ValidationResult objects are equal.

Inequality(ValidationResult, ValidationResult) Inequality(ValidationResult, ValidationResult) Inequality(ValidationResult, ValidationResult) Inequality(ValidationResult, ValidationResult)

かどうかを指定したValidationResultオブジェクトが等しくないです。Determines if the specified ValidationResult objects are not equal.

適用対象