Skip to content

Commit

Permalink
Made UploadPNG static
Browse files Browse the repository at this point in the history
  • Loading branch information
flickenmaste committed Apr 4, 2015
1 parent 15cc131 commit c55f427
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions Nekopomf/Nekopomf/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,32 +65,29 @@ public MainWindow()

private void SnipScreenShot(object sender, HotkeyEventArgs e)
{
Upload myUpload = new Upload();
var bmp = SnippingTool.Snip();
if (bmp != null)
{
System.Windows.Forms.Clipboard.SetImage(bmp);
URLBox.IsEnabled = true;
myUpload.UploadPNG();
Upload.UploadPNG();
URLBox.IsEnabled = false;
}
}

private void UploadScreenShot(object sender, HotkeyEventArgs e)
{
Upload myUpload = new Upload();
URLBox.IsEnabled = true;
myUpload.UploadPNG();
Upload.UploadPNG();
URLBox.IsEnabled = false;
}

private void Window_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{
if ((Keyboard.Modifiers == ModifierKeys.Control) && (e.Key == Key.V)) // if ctrl+v hit upload paste
{
Upload myUpload = new Upload();
URLBox.IsEnabled = true;
myUpload.UploadPNG();
Upload.UploadPNG();
URLBox.IsEnabled = false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion Nekopomf/Nekopomf/Upload.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public static void UploadPNG(BitmapSource bitmapSource)
File.Delete(path); // Delete temp image
}

public void UploadPNG()
static public void UploadPNG()
{
if (System.Windows.Clipboard.ContainsImage())
{
Expand Down

0 comments on commit c55f427

Please sign in to comment.