Esempio n. 1
0
        private static PrintJobInfo Parse(ManagementObject data)
        {
            PrintJobInfo info1 = new PrintJobInfo();

            info1.Document      = (string)data.Properties["Document"].Value;
            info1.JobId         = (uint)data.Properties["JobId"].Value;
            info1.JobStatus     = (string)data.Properties["JobStatus"].Value;
            info1.PagesPrinted  = (uint)data.Properties["PagesPrinted"].Value;
            info1.PaperSize     = (string)data.Properties["PaperSize"].Value;
            info1.Priority      = (uint)data.Properties["Priority"].Value;
            info1.TotalPages    = (uint)data.Properties["TotalPages"].Value;
            info1.TimeSubmitted = (string)data.Properties["TimeSubmitted"].Value;
            info1.Status        = (string)data.Properties["Status"].Value;
            info1.StatusMask    = (uint)data.Properties["StatusMask"].Value;
            return(info1);
        }
Esempio n. 2
0
        public void Refresh()
        {
            PrintJobInfo info = Get((int)this.JobId);

            if (info == null)
            {
                this.JobStatus  = string.Empty;
                this.TotalPages = 0;
                this.Status     = string.Empty;
                this.StatusMask = 0;
            }
            else
            {
                this.JobStatus  = info.JobStatus;
                this.TotalPages = info.TotalPages;
                this.Status     = info.Status;
                this.StatusMask = info.StatusMask;
            }
        }