commit aa0b56d0d7f8b9dbd027ea7e80b07629c73d12e5 Author: Stone-Red-Code <56473591+Stone-Red-Code@users.noreply.github.com> Date: Sun Mar 14 22:16:54 2021 +0100 Initial commit diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dfe0770 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/.vs/ImgurAutoUploader/v16/.suo b/.vs/ImgurAutoUploader/v16/.suo new file mode 100644 index 0000000..559e3b7 Binary files /dev/null and b/.vs/ImgurAutoUploader/v16/.suo differ diff --git a/ImgurAutoUploader.sln b/ImgurAutoUploader.sln new file mode 100644 index 0000000..1efffaa --- /dev/null +++ b/ImgurAutoUploader.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31019.35 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImgurAutoUploader", "ImgurAutoUploader\ImgurAutoUploader.csproj", "{5D9DDEF6-D737-4C9C-A5C4-F6F48CCE1540}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5D9DDEF6-D737-4C9C-A5C4-F6F48CCE1540}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5D9DDEF6-D737-4C9C-A5C4-F6F48CCE1540}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5D9DDEF6-D737-4C9C-A5C4-F6F48CCE1540}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5D9DDEF6-D737-4C9C-A5C4-F6F48CCE1540}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {9D0C0C67-6908-46E7-B2D9-F2A1C29EBE35} + EndGlobalSection +EndGlobal diff --git a/ImgurAutoUploader/App.xaml b/ImgurAutoUploader/App.xaml new file mode 100644 index 0000000..08739f5 --- /dev/null +++ b/ImgurAutoUploader/App.xaml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/ImgurAutoUploader/App.xaml.cs b/ImgurAutoUploader/App.xaml.cs new file mode 100644 index 0000000..a88ad83 --- /dev/null +++ b/ImgurAutoUploader/App.xaml.cs @@ -0,0 +1,11 @@ +using System.Windows; + +namespace ImgurAutoUploader +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} \ No newline at end of file diff --git a/ImgurAutoUploader/AssemblyInfo.cs b/ImgurAutoUploader/AssemblyInfo.cs new file mode 100644 index 0000000..4f943de --- /dev/null +++ b/ImgurAutoUploader/AssemblyInfo.cs @@ -0,0 +1,10 @@ +using System.Windows; + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] \ No newline at end of file diff --git a/ImgurAutoUploader/ImgurAutoUploader.csproj b/ImgurAutoUploader/ImgurAutoUploader.csproj new file mode 100644 index 0000000..127be9a --- /dev/null +++ b/ImgurAutoUploader/ImgurAutoUploader.csproj @@ -0,0 +1,13 @@ + + + + WinExe + net5.0-windows + true + + + + + + + diff --git a/ImgurAutoUploader/ImgurAutoUploader.csproj.user b/ImgurAutoUploader/ImgurAutoUploader.csproj.user new file mode 100644 index 0000000..9e3e8ef --- /dev/null +++ b/ImgurAutoUploader/ImgurAutoUploader.csproj.user @@ -0,0 +1,24 @@ + + + + <_LastSelectedProfileId>C:\Users\David\Google Drive\Programmieren\ImgurAutoUploader\ImgurAutoUploader\Properties\PublishProfiles\FolderProfile.pubxml + + + + Designer + + + + + Code + + + + + Designer + + + Designer + + + \ No newline at end of file diff --git a/ImgurAutoUploader/MainWindow.xaml b/ImgurAutoUploader/MainWindow.xaml new file mode 100644 index 0000000..c5b9e05 --- /dev/null +++ b/ImgurAutoUploader/MainWindow.xaml @@ -0,0 +1,13 @@ + + + \ No newline at end of file diff --git a/ImgurAutoUploader/MainWindow.xaml.cs b/ImgurAutoUploader/MainWindow.xaml.cs new file mode 100644 index 0000000..1c09493 --- /dev/null +++ b/ImgurAutoUploader/MainWindow.xaml.cs @@ -0,0 +1,45 @@ +using Imgur.API.Authentication; +using System; +using System.Windows; +using System.Windows.Threading; + +namespace ImgurAutoUploader +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window + { + private ApiClient apiClient; + private bool check = true; + + private double width = 0; + private double height = 0; + + public MainWindow() + { + InitializeComponent(); + apiClient = new ApiClient("."); + DispatcherTimer timer = new DispatcherTimer(); + timer.Interval = new TimeSpan(0, 0, 1); + timer.Tick += Timer_Tick; + timer.Start(); + } + + private void Timer_Tick(object sender, EventArgs e) + { + if (Clipboard.ContainsImage() && check) + { + check = false; + var image = Clipboard.GetImage(); + if (width != image.Width || height != image.Height) + { + width = image.Width; + height = image.Height; + new Popup(image, apiClient).ShowDialog(); + } + check = true; + } + } + } +} \ No newline at end of file diff --git a/ImgurAutoUploader/Popup.xaml b/ImgurAutoUploader/Popup.xaml new file mode 100644 index 0000000..703b266 --- /dev/null +++ b/ImgurAutoUploader/Popup.xaml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + +