public void RefreshSize(UIPreference m_Preference) { UIJob job = (UIJob)this.Tag; int IndexOfSize = m_Preference.IndexOf(JobListColumnHeader.Size); this.SubItems[IndexOfSize].Text = GetJobSize((float)job.ResolutionX, (float)job.ResolutionY, job.Dimension, m_Preference); this.ToolTipText = GetTooltipString(job, m_Preference); }
//public string ToolTipString = string.Empty; public string GetTooltipString(UIJob job, UIPreference options) { string newtip = string.Empty; bool bPrinted = job.Status == JobStatus.Printed; int colLen = options.JobListHeaderList.Length; for (int i = 0; i < colLen; i++) { JobListColumnHeader cur = (JobListColumnHeader)options.JobListHeaderList[i]; string cmode = ResString.GetEnumDisplayName(typeof(JobListColumnHeader), cur) + " : "; int index = options.IndexOf(cur); cmode += this.SubItems[index].Text; newtip += cmode + Environment.NewLine; } return(newtip); }
public void OnPrintStart(UIPreference m_Preference) { m_StartTime = DateTime.Now; SPrtFileInfo jobInfo = new SPrtFileInfo(); if (CoreInterface.Printer_GetJobInfo(ref jobInfo) > 0) { string passDispName = ResString.GetDisplayPass(); int IndexOfPass = m_Preference.IndexOf(JobListColumnHeader.PrintedPasses); if (IndexOfPass > 0) { this.SubItems[IndexOfPass].Text = jobInfo.sFreSetting.nPass.ToString() + " " + passDispName; } } //更新ToolTip ToolTipText = GetTooltipString(this.Tag as UIJob, m_Preference); }
public void RefreshDis(UIJob job, UIPreference m_Preference, string strCopies) { JobStatus jobStatus = job.Status; int IndexOfStatus = m_Preference.IndexOf(JobListColumnHeader.Status); if (jobStatus == JobStatus.Printed) { if (IndexOfStatus > 0) { this.SubItems[IndexOfStatus].Text = ResString.GetEnumDisplayName(typeof(JobStatus), jobStatus); } job.PrintedDate = DateTime.Now; int IndexOfDate = m_Preference.IndexOf(JobListColumnHeader.PrintedDate); if (IndexOfDate > 0) { string timeInfo = job.PrintedDate.ToString("u", DateTimeFormatInfo.InvariantInfo); int len = timeInfo.Length; if (len > 0 && !char.IsDigit(timeInfo, len - 1)) { timeInfo = timeInfo.Substring(0, len - 1); } this.SubItems[IndexOfDate].Text = timeInfo; } int IndexOfTime = m_Preference.IndexOf(JobListColumnHeader.PrintTime); if (IndexOfTime > 0) { TimeSpan time = DateTime.Now - m_StartTime; m_AllCopesTime += time; string strTime = string.Empty; strTime = m_AllCopesTime.Hours.ToString() + ":" + m_AllCopesTime.Minutes.ToString() + ":" + m_AllCopesTime.Seconds.ToString(); this.SubItems[IndexOfTime].Text = strTime; // string strCopies = m_PrintJobTask.GetCopiesString(); if (strCopies != "") { string[] sss = strCopies.Split(new char[] { '/' }); if (sss.Length == 2 && int.Parse(sss[0]) == int.Parse(sss[1])) { m_AllCopesTime = TimeSpan.Zero; } } } #if false string passDispName = ResString.GetDisplayPass(); int IndexOfPass = m_Preference.IndexOf(JobListColumnHeader.PrintedPasses); this.SubItems[i].Text = job.PassNumber.ToString() + " " + passDispName; #endif // this.ForeColor = Color.LightGray; this.Font = new Font(this.Font.FontFamily, this.Font.Size, FontStyle.Bold); } else { //if(job != m_PrintJobTask.GetPrintingJob()) // { if (IndexOfStatus > 0) { if (jobStatus == JobStatus.Printing) { this.SubItems[(int)IndexOfStatus].Text = ResString.GetEnumDisplayName(typeof(JobStatus), jobStatus) + strCopies; } else { this.SubItems[(int)IndexOfStatus].Text = ResString.GetEnumDisplayName(typeof(JobStatus), jobStatus); } } // } } int copyIndex = m_Preference.IndexOf(JobListColumnHeader.Copies); if (copyIndex > 0) { this.SubItems[copyIndex].Text = job.Copies.ToString(); } int sizeIndex = m_Preference.IndexOf(JobListColumnHeader.Size); if (sizeIndex > 0) { this.SubItems[sizeIndex].Text = GetJobSize((float)job.ResolutionX, (float)job.ResolutionY, job.Dimension, m_Preference); } //更新ToolTip this.ToolTipText = GetTooltipString(job, m_Preference); }