Exemple #1
0
        private void snippetToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                if (!SnippingTool.Snip())
                {
                    return;
                }
            }
            catch
            {
                MessageBox.Show("Unable to use snipping tool. Try closing some tabs. If this continues, restart OSIRT.", "Unable to use snippet tool", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            using (Previewer imagePreviewer = new ImagePreviewer(Enums.Actions.Snippet, uiTabbedBrowserControl.CurrentTab.Browser.URL))
            {
                imagePreviewer.ShowDialog();
            }
            ImageDiskCache.RemoveItemsInCache();
        }
        private void snippetToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                if (!SnippingTool.Snip())
                    return;
            }
            catch
            {
                MessageBox.Show("Unable to use snipping tool. Try closing some tabs. If this continues, restart OSIRT.", "Unable to use snippet tool", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            using (Previewer imagePreviewer = new ImagePreviewer(Enums.Actions.Snippet, uiTabbedBrowserControl.CurrentTab.Browser.URL))
            {
                imagePreviewer.ShowDialog();
            }
            ImageDiskCache.RemoveItemsInCache();

        }
        private void ShowImagePreviewer(Actions action, string imagePath)
        {
            Invoke((MethodInvoker)delegate
            {
                ScreenshotDetails details = new ScreenshotDetails(CurrentBrowser.URL);
                DialogResult dialogRes;
                string fileName;
                string dateAndtime;

                using (Previewer previewForm = new ImagePreviewer(action, CurrentBrowser.URL, imagePath))
                {
                    dialogRes = previewForm.ShowDialog();
                    fileName = previewForm.FileName + previewForm.FileExtension;
                    dateAndtime = previewForm.DateAndTime;
                }
                ImageDiskCache.RemoveItemsInCache();
                if (dialogRes != DialogResult.OK)
                    return;

                DisplaySavedLabel(fileName, dateAndtime);
            });

        }