Click here to Skip to main content
15,895,011 members
Articles / Mobile Apps / Windows Mobile

MobileLPR - An LPR Client for .NET Compact Framework 2.0

Rate me:
Please Sign up or sign in to vote.
5.00/5 (4 votes)
15 Dec 2010CPOL20 min read 38K   1.7K   22  
Windows CE/Mobile printing client for LPR, LPRng, and Socket API.
////////////////////////////////////////////////////////////////////////////////
// File:    LprTransferState.cs
// Purpose: Class containing file transfer information.
// Notice:  Copyright 2010 SunCat Services
// Author:  Edward F Eaglehouse
// 
// THIS WORK IS PROVIDED "AS IS" WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES
// OR CONDITIONS OR GUARANTEES.
//
// This product is licensed under the terms of The Code Project Open
// License (CPOL) 1.02. You are free to use this code in any application,
// private, public, or commercial, subject to this license agreement. A
// copy of this license may be found on the web at
// http://www.codeproject.com/info/cpol10.aspx.
////////////////////////////////////////////////////////////////////////////////
// Revision    Contributor
// 12/08/2010  Edward F Eaglehouse
//      Initial revision.
////////////////////////////////////////////////////////////////////////////////

using System;

using System.Collections.Generic;
using System.Text;
using System.IO;

namespace MobileLPR
{
    public class LprTransferState
    {

        #region Private Members

        /// <summary>
        /// Open stream used to access print data.
        /// </summary>
        public Stream stream;

        /// <summary>
        /// Pathname of file being transferred.
        /// </summary>
        public String pathname;

        /// <summary>
        /// Server name of file being transferred.
        /// </summary>
        public String serverFilename;

        /// <summary>
        /// Indicator for binary (not text) file contents.
        /// </summary>
        public Boolean isBinary = false;

        /// <summary>
        /// Total number of local bytes to transfer.
        /// </summary>
        public Int64 sizeTotal = 0;

        /// <summary>
        /// Current number of local bytes transferred.
        /// </summary>
        public Int64 sizeUsed = 0;

        /// <summary>
        /// File I/O buffer.
        /// </summary>
        public byte[] buffer;

        #endregion

        #region Constructors

        /// <summary>
        /// Initialize a new instance of the LprTransferState class.
        /// </summary>
        public LprTransferState() { }

        /// <summary>
        /// Initialize a new instance of the LprTransferState class.
        /// </summary>
        /// <param name="pathname">Local pathname of file being transferred.</param>
        public LprTransferState(String pathname) :
            this()
        {
            this.pathname = pathname;
            FileInfo f = new FileInfo(pathname);
            this.sizeTotal = f.Length;
        }

        #endregion

    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect SunCat Services
United States United States
Ed is a veteran programmer of over 30 years. He designs and builds myriad enterprise applications improving the service quality of numerous international, national, and local manufacturers and distributors. He also brought the first publicly-available commercial Internet service to Akron, Ohio - not for profit but to provide the community with a desired service. Ed continually strives to learn the most effective skills and techniques in order to provide the greatest benefits to his customers.

Comments and Discussions