PaperSource
Specifies the paper tray from which the printer gets paper.
using System.Runtime.CompilerServices;
namespace System.Drawing.Printing
{
[NullableContext(1)]
[Nullable(0)]
public class PaperSource
{
private string _name;
private PaperSourceKind _kind;
public PaperSourceKind Kind {
get {
if ((long)_kind < 256)
return _kind;
return PaperSourceKind.Custom;
}
}
public int RawKind {
get {
return (int)_kind;
}
set {
_kind = (PaperSourceKind)value;
}
}
public string SourceName {
get {
return _name;
}
set {
_name = value;
}
}
public PaperSource()
{
_kind = PaperSourceKind.Custom;
_name = string.Empty;
}
internal PaperSource(PaperSourceKind kind, string name)
{
_kind = kind;
_name = name;
}
public override string ToString()
{
DefaultInterpolatedStringHandler defaultInterpolatedStringHandler = new DefaultInterpolatedStringHandler(20, 2);
defaultInterpolatedStringHandler.AppendLiteral("[PaperSource ");
defaultInterpolatedStringHandler.AppendFormatted(SourceName);
defaultInterpolatedStringHandler.AppendLiteral(" Kind=");
defaultInterpolatedStringHandler.AppendFormatted(Kind);
defaultInterpolatedStringHandler.AppendLiteral("]");
return defaultInterpolatedStringHandler.ToStringAndClear();
}
}
}