This commit is contained in:
2010-07-14 16:17:39 +00:00
parent 2bf01da344
commit ebd566dcb2
11 changed files with 1058 additions and 468 deletions

View File

@@ -8,6 +8,7 @@ using System.Windows.Forms;
using VEPROMS.CSLA.Library;
using System.IO;
using Volian.Svg.Library;
using Volian.Print.Library;
namespace PrintMSWord
{
@@ -22,30 +23,6 @@ namespace PrintMSWord
get { return tsslStatus.Text; }
set { tsslStatus.Text = value; Application.DoEvents(); }
}
private frmAnalyze _MyAnalyze;
public frmAnalyze MyAnalyze
{
get
{
if (_MyAnalyze == null)
_MyAnalyze = new frmAnalyze();
return _MyAnalyze;
}
set { _MyAnalyze = value; }
}
private void analyzeToolStripMenuItem_Click(object sender, EventArgs e)
{
MyAnalyze.Show();
}
private void frmPrintMSWord_Load(object sender, EventArgs e)
{
FileInfo xmlFile = new FileInfo("Proms2010Print.xml");
if (xmlFile.Exists)
_MyProms2010Print = SvgSerializer<Proms2010Print>.ReadFile(xmlFile.FullName);
DocVersionInfo docVersion = GetDocVersionWithContent();
lbProcs.DataSource = docVersion.Procedures;
}
Proms2010Print _MyProms2010Print;
private DocVersionInfo GetDocVersionWithContent()
{
DocVersionInfoList dvList = DocVersionInfoList.Get();
@@ -63,18 +40,18 @@ namespace PrintMSWord
{
CreatePDF();
}
private void CreatePDF()
{
Volian.Print.Library.Rtf2Pdf.PdfDebug = true;
tbTimings.Text = "";
Cursor saveCursor = this.Cursor;
this.Cursor = Cursors.WaitCursor;
Proms2010Procedure prProc = _MyProms2010Print.GetProcedure(MyProcedure);
PromsPrinter pp = new PromsPrinter(MyProcedure, prProc.Rev, prProc.RevDate, cbWatermark.Text);
ProcedureConfig.PrintWatermark pw = MyProcedure.ProcedureConfig.Print_Watermark;
PromsPrinter pp = new PromsPrinter(MyProcedure, tbRev.Text, tbRevDate.Text, pw.ToString(),cbDebugOutput.Checked, @"C:\TEMP\16Bit");
pp.StatusChanged += new PromsPrinterStatusEvent(pp_StatusChanged);
_ElapsedTime = new Dictionary<PromsPrinterStatusType, TimeSpan>();
DateTime tStart = DateTime.Now;
string pdfFile = pp.Print(@"C:\TEMP\32Bit", _MyProms2010Print, null, this);
string pdfFile = pp.Print(@"C:\TEMP\32Bit");
DateTime tEnd = DateTime.Now;
_ElapsedTime.Add(PromsPrinterStatusType.Total, DateTime.Now - tStart);
MyStatus = pdfFile + " created.";
@@ -103,21 +80,14 @@ namespace PrintMSWord
//tbTimings.Text += string.Format("{0},{1},'{2}','{3}'", TimeSpan.FromTicks(args.When.Ticks -_StartTime.Ticks).TotalSeconds, delta.TotalMilliseconds, args.Type, args.MyStatus);
_LastTime = args.When;
}
private void lbProcs_SelectedValueChanged(object sender, EventArgs e)
{
//ProcedureInfo proc = lbProcs.SelectedValue as ProcedureInfo;
if (MyProcedure == null) return;
if (_MyProms2010Print == null) return;
Proms2010Procedure prProc = _MyProms2010Print.GetProcedure(MyProcedure);
tbRev.Text = prProc == null ? "" : prProc.Rev;
tbRevDate.Text = prProc == null ? "" : prProc.RevDate;
tbPageCount.Text = prProc == null ? "" : prProc.PageCount.ToString();
}
private void pDFToolStripMenuItem_Click(object sender, EventArgs e)
{
CreatePDF();
}
private void frmPrintMSWord_Load(object sender, EventArgs e)
{
DocVersionInfo dvi = GetDocVersionWithContent();
lbProcs.DataSource = dvi.Procedures;
}
}
}