Exemplo n.º 1
0
        public void RawKind_ReturnsExpected(int rawKind, PaperSourceKind expectedKind)
        {
            PaperSource ps = new PaperSource();

            ps.RawKind = rawKind;
            Assert.Equal(expectedKind, ps.Kind);
            Assert.Equal(rawKind, ps.RawKind);
        }
Exemplo n.º 2
0
 // Constructor.
 internal PaperSource(PaperSourceKind kind, String name)
 {
     this.kind = kind;
     if (name == null)
     {
         this.name = kind.ToString();
     }
     else
     {
         this.name = name;
     }
 }
Exemplo n.º 3
0
        // Internal state.

        // Constructor.
        internal PaperSource(PaperSourceKind kind, string name)
        {
            Kind = kind;
            if(name == null)
            {
                SourceName = kind.ToString();
            }
            else
            {
                SourceName = name;
            }
        }
Exemplo n.º 4
0
	// Constructor.
	internal PaperSource(PaperSourceKind kind, String name)
			{
				this.kind = kind;
				if(name == null)
				{
					this.name = kind.ToString();
				}
				else
				{
					this.name = name;
				}
			}
Exemplo n.º 5
0
        public void RawKind_Set_GetReturnsExpected(int value, PaperSourceKind expectedKind)
        {
            var source = new PaperSource
            {
                RawKind = value
            };

            Assert.Equal(value, source.RawKind);
            Assert.Equal(expectedKind, source.Kind);

            // Set same.
            source.RawKind = value;
            Assert.Equal(value, source.RawKind);
            Assert.Equal(expectedKind, source.Kind);
        }
Exemplo n.º 6
0
		internal PaperSource(string sourceName, PaperSourceKind kind, bool isDefault)
		{
			this.source_name = sourceName;
			this.kind = kind;
			this.is_default = IsDefault;
		}
Exemplo n.º 7
0
		internal PaperSource(string sourceName, PaperSourceKind kind)
		{
			this.source_name = sourceName;
			this.kind = kind;
		}
Exemplo n.º 8
0
        private bool SetPaperSource(PrinterSettings pPrinterSettings, string pPaperSourceName, PaperSourceKind pKind, int pRawKind)
        {
            bool vPaperSourceFound = false;

            foreach (PaperSource vStockPaperSource in pPrinterSettings.PaperSources)
            {
                if ((vStockPaperSource.SourceName == pPaperSourceName) ||
                    (vStockPaperSource.Kind == pKind && vStockPaperSource.RawKind == pRawKind))
                {
                    vPaperSourceFound = true;
                    pPrinterSettings.DefaultPageSettings.PaperSource = vStockPaperSource;
                    break;
                }
            }
            return(vPaperSourceFound);
        }
	// Get a standard paper source object.
	public static PaperSource GetStandardPaperSource(PaperSourceKind kind)
			{
				return new PaperSource(kind, null);
			}
Exemplo n.º 10
0
 internal PaperSource(PaperSourceKind kind, string name)
 {
     this.kind = kind;
     this.name = name;
 }
Exemplo n.º 11
0
 internal PaperSource(string sourceName, PaperSourceKind kind)
 {
     this.source_name = sourceName;
     this.kind        = kind;
 }
Exemplo n.º 12
0
 internal PaperSource(PaperSourceKind kind, string name) {
     this.kind = kind;
     this.name = name;
 }
Exemplo n.º 13
0
 /// <include file='doc\PaperSource.uex' path='docs/doc[@for="PaperSource.PaperSource"]/*' />
 /// <devdoc>
 ///    <para>
 ///       Initializes a new instance of the <see cref='System.Drawing.Printing.PaperSource'/> class with default properties.
 ///       This constructor is required for the serialization of the <see cref='System.Drawing.Printing.PaperSource'/> class.
 ///    </para>
 /// </devdoc>
 public PaperSource()
 {
     this.kind = PaperSourceKind.Custom;
     this.name = String.Empty;
 }
Exemplo n.º 14
0
 // Get a standard paper source object.
 public static PaperSource GetStandardPaperSource(PaperSourceKind kind)
 {
     return(new PaperSource(kind, null));
 }
Exemplo n.º 15
0
 /// <include file='doc\PaperSource.uex' path='docs/doc[@for="PaperSource.PaperSource"]/*' />
 /// <devdoc>
 ///    <para>
 ///       Initializes a new instance of the <see cref='System.Drawing.Printing.PaperSource'/> class with default properties.
 ///       This constructor is required for the serialization of the <see cref='System.Drawing.Printing.PaperSource'/> class.
 ///    </para>
 /// </devdoc>
 public PaperSource()
 {
     this.kind = PaperSourceKind.Custom;
     this.name = String.Empty;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref='PaperSource'/> class with default properties.
 /// </summary>
 public PaperSource()
 {
     _kind = PaperSourceKind.Custom;
     _name = string.Empty;
 }
 internal PaperSource(PaperSourceKind kind, string name)
 {
     _kind = kind;
     _name = name;
 }
Exemplo n.º 18
0
 internal PaperSource(string sourceName, PaperSourceKind kind, bool isDefault)
 {
     this.source_name = sourceName;
     this.kind        = kind;
     this.is_default  = IsDefault;
 }