コード例 #1
0
        public void RunCreatePdf(bool argument)
        {
            ProgressBarLoad progress = new ProgressBarLoad();

            progress.ShowDialog();
            bool controlForPhoto = pdfController.PdfIntro(doc, sec, reportNote.Text, profilePic.ImageLocation, reportNote.Lines.Length, argument);

            if (controlForPhoto)
            {
                pdfController.CreatePdf(doc, sec, keywordsGrid, 1, "Keyword History");
                pdfController.CreatePdf(doc, sec, urlHistoryGrid, 6, "Url History");
                pdfController.CreatePdf(doc, sec, downloadsHistoryGrid, 6, "Download History");
                pdfController.CreatePdf(doc, sec, autofillGrid, 5, "Autofill");
                pdfController.CreatePdf(doc, sec, cookiesGrid, 6, "Cookies");
                pdfController.CreatePdf(doc, sec, topsitesGrid, 3, "Top Sites");
                int check = setPdf.SavePdf(doc, reportName.Text);
                if (check == 1)
                {
                    Exception.ThrowExc.Instance.InformationMessage(Const.Constants.REPORT_CREATED);
                    reportNote.Text = "";
                    reportName.Text = "";
                    this.Close();
                }
                else if (check == -1)
                {
                    Exception.ThrowExc.Instance.ErrorMessage(Const.Constants.REPORT_COULDNT_SAVED);
                }
            }
            else
            {
                Exception.ThrowExc.Instance.ErrorMessage(Const.Constants.PICTURE_SIZE_ERROR);
                doc = null;
                doc = pdfController.Create();
            }
        }