Ejemplo n.º 1
0
        void upload_progress_complete(object sender, UploadValuesCompletedEventArgs e)
        {
            group_upload_progress.Text = "Upload Progress";
            progress.Value             = 0;

            String response = Encoding.UTF8.GetString(e.Result);

            String delete_hash = Global_Func.get_text_inbetween(response, "deletehash\":\"", "\",\"name\"").Replace("\\", "");
            String link        = Global_Func.get_text_inbetween(response, "link\":\"", "\"}").Replace("\\", "");

            list_image_links.Items.Add(
                new ListViewItem(new String[] { link, delete_hash })
                );

            list_image_links.Items[list_image_links.Items.Count - 1].EnsureVisible();

            if (Settings.copy_links_to_clipboard)
            {
                Clipboard.SetText(link);
            }

            if (Settings.balloon_messages)
            {
                balloon_tip(link, "Upload Complete!", 2000);
            }

            Global_Func.play_sound("success.wav");
        }
Ejemplo n.º 2
0
        void work_image(Bitmap bmp, Boolean edit = false)
        {
            Global_Func.play_sound("capture.wav");

            if (edit)
            {
                bmp = edit_screenshot(bmp);
            }

            if (bmp == null)
            {
                return;
            }

            if (Settings.upload_method == "imgur")
            {
                if (!Imgur.upload(bmp))
                {
                    Global_Func.play_sound("error.wav");

                    if (Settings.balloon_messages)
                    {
                        balloon_tip("Error uploading file!", "Error", 2000, ToolTipIcon.Error);
                    }
                }
            }

            save_screenshot(bmp);
        }
Ejemplo n.º 3
0
        void DeleteToolStripMenuItemClick(object sender, EventArgs e)
        {
            if (list_image_links.SelectedItems.Count <= 0)
            {
                return;
            }

            if (Imgur.delete(list_image_links.SelectedItems[0].SubItems[1].Text))
            {
                list_image_links.SelectedItems[0].Remove();
            }
            else
            {
                Global_Func.play_sound("error.wav");

                if (Settings.balloon_messages)
                {
                    balloon_tip("Could not delete file!", "Error", 2000, ToolTipIcon.Error);
                }
            }
        }