Пример #1
0
        private void OnBrowse(object arg)
        {
            DialogHelperResult result = DialogHelper.OpenFile(DialogFilter.JPG, string.Empty);

            if (result.Result == true)
            {
                try
                {
                    SignatureImage = ImageHelper.LoadImageSafely(result.FileName);

                    try
                    {
                        string path = Imaging.Signature.Transform(new Bitmap(SignatureImage));
                        SignatureImage = ImageHelper.LoadImageSafely(path);
                    }
                    catch (Exception ex)
                    {
                        MessageBoxHelper.ShowError($"{Resources.ERR_UNABLE_TO_APPLY_TRANSFORMATIONS}\n\n{ExceptionPolicy.HandleException(ContainerBootstrapper.Container, ex)}");
                    }
                }
                catch
                {
                    MessageBoxHelper.ShowError(Resources.ERR_UNABLE_TO_LOAD_THE_SPECIFIED_FILE);
                }
            }
        }
Пример #2
0
        private static void OnBrowse(InputTextField textField)
        {
            DialogHelperResult result = DialogHelper.OpenFile(DialogFilter.All, string.Empty);

            if (result.Result == true)
            {
                textField.Text = result.FileName;
            }
        }
Пример #3
0
        private void OnExport(object obj)
        {
            if (SelectedStoredFile == null)
            {
                return;
            }

            DialogHelperResult dialogResult = DialogHelper.SaveFile(DialogFilter.All, SelectedStoredFile.FileName);

            if (dialogResult.Result == true)
            {
                File.WriteAllBytes(dialogResult.FileName, SelectedStoredFile.SerializedFile);
            }
        }
Пример #4
0
        public static PDFDocumentResult ToPDF(this Report report)
        {
            DialogHelperResult result = Save(true);

            if (result.Result == true)
            {
                using (var pdfDocument = new PDFDocument(result.FileName))
                {
                    CustomReport.Create(pdfDocument, report);
                    return(new PDFDocumentResult {
                        FilePath = result.FileName
                    });
                }
            }
            return(new PDFDocumentResult());
        }
Пример #5
0
        private void OnExport(object obj)
        {
            if (!Exceptions.IsNullOrEmpty())
            {
                DialogHelperResult result = DialogHelper.SaveFile(DialogFilter.Data, string.Format("{0}\\Technical Information.dat", Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)));
                if (result.Result == true)
                {
                    ExceptionPolicy.Serialize(Exceptions.Select(t => new DiscreteException
                    {
                        ExceptionDetails = t.ExceptionDetails,
                        Occurred         = t.Occurred.ToString("dd-MMM-yyyy HH:mm")
                    })
                                              .ToList(),
                                              result.FileName);
                }

                MessageBoxHelper.ShowMessage(Resources.TXT_EXPORT_COMPLETE, Window);
            }
            else
            {
                MessageBoxHelper.ShowMessage(Resources.TXT_NOTHING_TO_EXPORT, Window);
            }
        }