├── .gitattributes ├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── AniView.sln ├── AniView ├── AniView.csproj ├── App.config ├── App.xaml ├── App.xaml.cs ├── Classes │ ├── ImageUtils.cs │ ├── NativeMethods.cs │ ├── SettingsBinder.cs │ └── StyleManager.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── Resources │ └── Images │ │ ├── about.png │ │ ├── aniview.png │ │ ├── aniview_tab.png │ │ ├── close.png │ │ ├── edit.png │ │ ├── exit.png │ │ ├── export.png │ │ ├── help.png │ │ ├── house.png │ │ ├── house_tab.png │ │ ├── left.png │ │ ├── license.png │ │ ├── money.png │ │ ├── monitor.png │ │ ├── open.png │ │ ├── pause.png │ │ ├── play.png │ │ ├── properties.png │ │ ├── right.png │ │ ├── settings.png │ │ ├── settings_tab.png │ │ └── update.png ├── Windows │ ├── AboutWindow.xaml │ ├── AboutWindow.xaml.cs │ ├── MainWindow.xaml │ ├── MainWindow.xaml.cs │ ├── SettingsWindow.xaml │ └── SettingsWindow.xaml.cs ├── aniview.ico ├── app.manifest └── packages.config ├── CODE_OF_CONDUCT.md ├── LICENSE └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: CodeDead 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. Windows 10 1809] 28 | - Version: [e.g. 1.5] 29 | 30 | **Additional context** 31 | Add any other context about the problem here. 32 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: enhancement 6 | assignees: CodeDead 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | [Xx]64/ 19 | [Xx]86/ 20 | [Bb]uild/ 21 | bld/ 22 | [Bb]in/ 23 | [Oo]bj/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | artifacts/ 46 | 47 | *_i.c 48 | *_p.c 49 | *_i.h 50 | *.ilk 51 | *.meta 52 | *.obj 53 | *.pch 54 | *.pdb 55 | *.pgc 56 | *.pgd 57 | *.rsp 58 | *.sbr 59 | *.tlb 60 | *.tli 61 | *.tlh 62 | *.tmp 63 | *.tmp_proj 64 | *.log 65 | *.vspscc 66 | *.vssscc 67 | .builds 68 | *.pidb 69 | *.svclog 70 | *.scc 71 | 72 | # Chutzpah Test files 73 | _Chutzpah* 74 | 75 | # Visual C++ cache files 76 | ipch/ 77 | *.aps 78 | *.ncb 79 | *.opendb 80 | *.opensdf 81 | *.sdf 82 | *.cachefile 83 | *.VC.db 84 | 85 | # Visual Studio profiler 86 | *.psess 87 | *.vsp 88 | *.vspx 89 | *.sap 90 | 91 | # TFS 2012 Local Workspace 92 | $tf/ 93 | 94 | # Guidance Automation Toolkit 95 | *.gpState 96 | 97 | # ReSharper is a .NET coding add-in 98 | _ReSharper*/ 99 | *.[Rr]e[Ss]harper 100 | *.DotSettings.user 101 | 102 | # JustCode is a .NET coding add-in 103 | .JustCode 104 | 105 | # TeamCity is a build add-in 106 | _TeamCity* 107 | 108 | # DotCover is a Code Coverage Tool 109 | *.dotCover 110 | 111 | # NCrunch 112 | _NCrunch_* 113 | .*crunch*.local.xml 114 | nCrunchTemp_* 115 | 116 | # MightyMoose 117 | *.mm.* 118 | AutoTest.Net/ 119 | 120 | # Web workbench (sass) 121 | .sass-cache/ 122 | 123 | # Installshield output folder 124 | [Ee]xpress/ 125 | 126 | # DocProject is a documentation generator add-in 127 | DocProject/buildhelp/ 128 | DocProject/Help/*.HxT 129 | DocProject/Help/*.HxC 130 | DocProject/Help/*.hhc 131 | DocProject/Help/*.hhk 132 | DocProject/Help/*.hhp 133 | DocProject/Help/Html2 134 | DocProject/Help/html 135 | 136 | # Click-Once directory 137 | publish/ 138 | 139 | # Publish Web Output 140 | *.[Pp]ublish.xml 141 | *.azurePubxml 142 | 143 | # TODO: Un-comment the next line if you do not want to checkin 144 | # your web deploy settings because they may include unencrypted 145 | # passwords 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # NuGet Packages 150 | *.nupkg 151 | # The packages folder can be ignored because of Package Restore 152 | **/packages/* 153 | # except build/, which is used as an MSBuild target. 154 | !**/packages/build/ 155 | # Uncomment if necessary however generally it will be regenerated when needed 156 | #!**/packages/repositories.config 157 | # NuGet v3's project.json files produces more ignoreable files 158 | *.nuget.props 159 | *.nuget.targets 160 | 161 | # Microsoft Azure Build Output 162 | csx/ 163 | *.build.csdef 164 | 165 | # Microsoft Azure Emulator 166 | ecf/ 167 | rcf/ 168 | 169 | # Windows Store app package directory 170 | AppPackages/ 171 | BundleArtifacts/ 172 | 173 | # Visual Studio cache files 174 | # files ending in .cache can be ignored 175 | *.[Cc]ache 176 | # but keep track of directories ending in .cache 177 | !*.[Cc]ache/ 178 | 179 | # Others 180 | ClientBin/ 181 | [Ss]tyle[Cc]op.* 182 | ~$* 183 | *~ 184 | *.dbmdl 185 | *.dbproj.schemaview 186 | *.pfx 187 | *.publishsettings 188 | node_modules/ 189 | orleans.codegen.cs 190 | 191 | # RIA/Silverlight projects 192 | Generated_Code/ 193 | 194 | # Backup & report files from converting an old project file 195 | # to a newer Visual Studio version. Backup files are not needed, 196 | # because we have git ;-) 197 | _UpgradeReport_Files/ 198 | Backup*/ 199 | UpgradeLog*.XML 200 | UpgradeLog*.htm 201 | 202 | # SQL Server files 203 | *.mdf 204 | *.ldf 205 | 206 | # Business Intelligence projects 207 | *.rdl.data 208 | *.bim.layout 209 | *.bim_*.settings 210 | 211 | # Microsoft Fakes 212 | FakesAssemblies/ 213 | 214 | # GhostDoc plugin setting file 215 | *.GhostDoc.xml 216 | 217 | # Node.js Tools for Visual Studio 218 | .ntvs_analysis.dat 219 | 220 | # Visual Studio 6 build log 221 | *.plg 222 | 223 | # Visual Studio 6 workspace options file 224 | *.opt 225 | 226 | # Visual Studio LightSwitch build output 227 | **/*.HTMLClient/GeneratedArtifacts 228 | **/*.DesktopClient/GeneratedArtifacts 229 | **/*.DesktopClient/ModelManifest.xml 230 | **/*.Server/GeneratedArtifacts 231 | **/*.Server/ModelManifest.xml 232 | _Pvt_Extensions 233 | 234 | # LightSwitch generated files 235 | GeneratedArtifacts/ 236 | ModelManifest.xml 237 | 238 | # Paket dependency manager 239 | .paket/paket.exe 240 | 241 | # FAKE - F# Make 242 | .fake/ 243 | /.idea/.idea.AniView 244 | -------------------------------------------------------------------------------- /AniView.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26403.7 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AniView", "AniView\AniView.csproj", "{F7F70723-73CC-4075-AA2B-2CE18B0BE707}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Debug|x86 = Debug|x86 12 | Release|Any CPU = Release|Any CPU 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {F7F70723-73CC-4075-AA2B-2CE18B0BE707}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {F7F70723-73CC-4075-AA2B-2CE18B0BE707}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {F7F70723-73CC-4075-AA2B-2CE18B0BE707}.Debug|x86.ActiveCfg = Debug|Any CPU 19 | {F7F70723-73CC-4075-AA2B-2CE18B0BE707}.Debug|x86.Build.0 = Debug|Any CPU 20 | {F7F70723-73CC-4075-AA2B-2CE18B0BE707}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {F7F70723-73CC-4075-AA2B-2CE18B0BE707}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {F7F70723-73CC-4075-AA2B-2CE18B0BE707}.Release|x86.ActiveCfg = Release|Any CPU 23 | {F7F70723-73CC-4075-AA2B-2CE18B0BE707}.Release|x86.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {A627ECF1-CD0D-4353-840A-B3A7D5A85EC0} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /AniView/AniView.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {F7F70723-73CC-4075-AA2B-2CE18B0BE707} 8 | WinExe 9 | Properties 10 | AniView 11 | AniView 12 | v4.8 13 | 512 14 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 15 | 4 16 | true 17 | 18 | 19 | 20 | AnyCPU 21 | true 22 | full 23 | false 24 | bin\Debug\ 25 | DEBUG;TRACE 26 | prompt 27 | 4 28 | 29 | 30 | AnyCPU 31 | none 32 | true 33 | bin\Release\ 34 | TRACE 35 | prompt 36 | 4 37 | false 38 | 39 | 40 | AniView.App 41 | 42 | 43 | aniview.ico 44 | 45 | 46 | app.manifest 47 | 48 | 49 | 50 | ..\packages\CodeDead.UpdateManager.1.5.0\lib\net48\CodeDead.UpdateManager.dll 51 | False 52 | 53 | 54 | ..\packages\Syncfusion.Licensing.18.3.0.48\lib\net46\Syncfusion.Licensing.dll 55 | 56 | 57 | ..\packages\Syncfusion.Shared.WPF.18.3.0.48\lib\net46\Syncfusion.Shared.WPF.dll 58 | 59 | 60 | ..\packages\Syncfusion.Tools.WPF.18.3.0.48\lib\net46\Syncfusion.Tools.WPF.dll 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 4.0 69 | 70 | 71 | 72 | 73 | 74 | ..\packages\XamlAnimatedGif.1.2.3\lib\net45\XamlAnimatedGif.dll 75 | 76 | 77 | 78 | 79 | MSBuild:Compile 80 | Designer 81 | 82 | 83 | 84 | 85 | 86 | 87 | True 88 | True 89 | Resources.resx 90 | 91 | 92 | AboutWindow.xaml 93 | 94 | 95 | MainWindow.xaml 96 | 97 | 98 | App.xaml 99 | Code 100 | 101 | 102 | SettingsWindow.xaml 103 | 104 | 105 | Designer 106 | MSBuild:Compile 107 | 108 | 109 | Designer 110 | MSBuild:Compile 111 | 112 | 113 | Designer 114 | MSBuild:Compile 115 | 116 | 117 | 118 | 119 | Code 120 | 121 | 122 | True 123 | Settings.settings 124 | True 125 | 126 | 127 | ResXFileCodeGenerator 128 | Designer 129 | Resources.Designer.cs 130 | 131 | 132 | 133 | 134 | SettingsSingleFileGenerator 135 | Settings.Designer.cs 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 191 | -------------------------------------------------------------------------------- /AniView/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Metro 18 | 19 | 20 | #FF07779C 21 | 22 | 23 | 3 24 | 25 | 26 | True 27 | 28 | 29 | 0 30 | 31 | 32 | Png 33 | 34 | 35 | False 36 | 37 | 38 | True 39 | 40 | 41 | True 42 | 43 | 44 | True 45 | 46 | 47 | True 48 | 49 | 50 | True 51 | 52 | 53 | True 54 | 55 | 56 | False 57 | 58 | 59 | 100 60 | 61 | 62 | 3 63 | 64 | 65 | False 66 | 67 | 68 | 1 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /AniView/App.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /AniView/App.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace AniView 2 | { 3 | /// 4 | /// 5 | /// Interaction logic for App.xaml 6 | /// 7 | public partial class App 8 | { 9 | /// 10 | /// 11 | /// Initialize a new App 12 | /// 13 | public App() 14 | { 15 | // Enter your Syncfusion license key here 16 | Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY HERE"); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /AniView/Classes/ImageUtils.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using System.Drawing.Imaging; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | 8 | namespace AniView.Classes 9 | { 10 | /// 11 | /// This class contains methods and functions to manipulate an image 12 | /// 13 | internal static class ImageUtils 14 | { 15 | /// 16 | /// Extract all frames of an animated image 17 | /// 18 | /// The full path that points to an animated image 19 | /// The full path where the frames should be saved 20 | /// The image format in which the frames should be exported 21 | /// An integer 22 | internal static async Task ExtractFrames(string path, string savePath, ImageFormat format) 23 | { 24 | await Task.Run(() => 25 | { 26 | using (Image img = Image.FromFile(path)) 27 | { 28 | string ext = FileExtensionFromEncoder(format); 29 | Image[] frames = GetFrames(img); 30 | for (int i = 0; i < frames.Length; i++) 31 | { 32 | frames[i].Save(savePath + "\\" + i + ext, format); 33 | frames[i].Dispose(); 34 | } 35 | } 36 | }); 37 | } 38 | 39 | /// 40 | /// Retrieve the file extension from an ImageFormat 41 | /// 42 | /// The ImageFormat 43 | /// The file extension from an ImageFormat 44 | private static string FileExtensionFromEncoder(ImageFormat format) 45 | { 46 | try 47 | { 48 | return ImageCodecInfo.GetImageEncoders() 49 | .First(x => x.FormatID == format.Guid) 50 | .FilenameExtension 51 | .Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries) 52 | .First() 53 | .Trim('*') 54 | .ToLower(); 55 | } 56 | catch (Exception) 57 | { 58 | return ".unknown"; 59 | } 60 | } 61 | 62 | /// 63 | /// Get all the frames of an animated image 64 | /// 65 | /// The animated image 66 | /// All the frames of an animated image 67 | private static Image[] GetFrames(Image originalImg) 68 | { 69 | int numberOfFrames = originalImg.GetFrameCount(FrameDimension.Time); 70 | Image[] frames = new Image[numberOfFrames]; 71 | 72 | for (int i = 0; i < numberOfFrames; i++) 73 | { 74 | originalImg.SelectActiveFrame(FrameDimension.Time, i); 75 | frames[i] = (Image)originalImg.Clone(); 76 | } 77 | return frames; 78 | } 79 | 80 | /// 81 | /// Get the number of frames inside an image 82 | /// 83 | /// The path of the image 84 | /// The number of frames inside an image 85 | internal static int GetFrameCount(string path) 86 | { 87 | try 88 | { 89 | using (Image img = Image.FromFile(path)) 90 | { 91 | return img.GetFrameCount(FrameDimension.Time); 92 | } 93 | } 94 | catch (Exception e) 95 | { 96 | MessageBox.Show(e.Message, "AniView", MessageBoxButton.OK, MessageBoxImage.Error); 97 | } 98 | return 0; 99 | } 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /AniView/Classes/NativeMethods.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics.CodeAnalysis; 3 | using System.Runtime.InteropServices; 4 | 5 | namespace AniView.Classes 6 | { 7 | /// 8 | /// Internal static class that contains external native methods 9 | /// 10 | [SuppressMessage("ReSharper", "IdentifierTypo")] 11 | internal static class NativeMethods 12 | { 13 | /// 14 | /// Performs an operation on a specified file 15 | /// 16 | /// A pointer to a SHELLEXECUTEINFO structure that contains and receives information about the application being executed 17 | /// Returns True if successful; otherwise, False 18 | [DllImport("shell32.dll", CharSet = CharSet.Auto)] 19 | private static extern bool ShellExecuteEx(ref ShellExecuteInfo lpExecInfo); 20 | 21 | /// 22 | /// Contains information used by ShellExecuteEx 23 | /// 24 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] 25 | private struct ShellExecuteInfo 26 | { 27 | internal int cbSize; 28 | internal uint fMask; 29 | private readonly IntPtr hwnd; 30 | [MarshalAs(UnmanagedType.LPTStr)] 31 | internal string lpVerb; 32 | [MarshalAs(UnmanagedType.LPTStr)] 33 | internal string lpFile; 34 | [MarshalAs(UnmanagedType.LPTStr)] 35 | private readonly string lpParameters; 36 | [MarshalAs(UnmanagedType.LPTStr)] 37 | private readonly string lpDirectory; 38 | internal int nShow; 39 | private readonly IntPtr hInstApp; 40 | private readonly IntPtr lpIDList; 41 | [MarshalAs(UnmanagedType.LPTStr)] 42 | private readonly string lpClass; 43 | 44 | private readonly IntPtr hkeyClass; 45 | private readonly uint dwHotKey; 46 | private readonly IntPtr hIcon; 47 | private readonly IntPtr hProcess; 48 | } 49 | 50 | /// 51 | /// Show the properties dialog of a file 52 | /// 53 | /// The path of the file 54 | internal static void ShowFileProperties(string path) 55 | { 56 | ShellExecuteInfo info = new ShellExecuteInfo(); 57 | info.cbSize = Marshal.SizeOf(info); 58 | info.lpVerb = "properties"; 59 | info.lpFile = path; 60 | info.nShow = 5; 61 | info.fMask = 12; 62 | ShellExecuteEx(ref info); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /AniView/Classes/SettingsBinder.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Data; 2 | 3 | namespace AniView.Classes 4 | { 5 | /// 6 | /// 7 | /// Internal logic for binding settings to controls 8 | /// 9 | internal sealed class SettingsBinder : Binding 10 | { 11 | 12 | /// 13 | /// 14 | /// Initialize a new SettingsBinder 15 | /// 16 | /// The path that can be used to bind 17 | public SettingsBinder(string path) : base(path) 18 | { 19 | Source = Properties.Settings.Default; 20 | Mode = BindingMode.TwoWay; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /AniView/Classes/StyleManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows; 3 | using System.Windows.Media; 4 | using Syncfusion.Windows.Shared; 5 | 6 | namespace AniView.Classes 7 | { 8 | /// 9 | /// Static class to change the style of an object 10 | /// 11 | internal static class StyleManager 12 | { 13 | /// 14 | /// Change the visual style of an object 15 | /// 16 | /// The object that needs to have a style overhaul 17 | internal static void ChangeStyle(DependencyObject o) 18 | { 19 | try 20 | { 21 | SkinStorage.SetVisualStyle(o, Properties.Settings.Default.VisualStyle); 22 | SkinStorage.SetMetroBrush(o, new SolidColorBrush(Properties.Settings.Default.MetroColor)); 23 | if (!(o is ChromelessWindow window)) return; 24 | window.BorderThickness = new Thickness(Properties.Settings.Default.BorderThickness); 25 | window.CornerRadius = new CornerRadius(0, 0, 0, 0); 26 | window.Opacity = Properties.Settings.Default.WindowOpacity / 100; 27 | window.ResizeBorderThickness = new Thickness(Properties.Settings.Default.WindowResizeBorder); 28 | } 29 | catch (Exception ex) 30 | { 31 | SkinStorage.SetVisualStyle(o, "Metro"); 32 | MessageBox.Show(ex.Message, "AniView", MessageBoxButton.OK, MessageBoxImage.Error); 33 | } 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /AniView/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using System.Windows; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("AniView")] 9 | [assembly: AssemblyDescription("AniView")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("CodeDead")] 12 | [assembly: AssemblyProduct("AniView")] 13 | [assembly: AssemblyCopyright("Copyright © 2020 CodeDead")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | //In order to begin building localizable applications, set 23 | //CultureYouAreCodingWith in your .csproj file 24 | //inside a . For example, if you are using US english 25 | //in your source files, set the to en-US. Then uncomment 26 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 27 | //the line below to match the UICulture setting in the project file. 28 | 29 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 30 | 31 | 32 | [assembly: ThemeInfo( 33 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 34 | //(used if a resource is not found in the page, 35 | // or application resource dictionaries) 36 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 37 | //(used if a resource is not found in the page, 38 | // app, or any theme specific resource dictionaries) 39 | )] 40 | 41 | 42 | // Version information for an assembly consists of the following four values: 43 | // 44 | // Major Version 45 | // Minor Version 46 | // Build Number 47 | // Revision 48 | // 49 | // You can specify all the values or you can default the Build and Revision Numbers 50 | // by using the '*' as shown below: 51 | // [assembly: AssemblyVersion("1.0.*")] 52 | [assembly: AssemblyVersion("1.6.0.0")] 53 | [assembly: AssemblyFileVersion("1.6.0.0")] 54 | -------------------------------------------------------------------------------- /AniView/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace AniView.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AniView.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized resource of type System.Drawing.Bitmap. 65 | /// 66 | internal static System.Drawing.Bitmap about { 67 | get { 68 | object obj = ResourceManager.GetObject("about", resourceCulture); 69 | return ((System.Drawing.Bitmap)(obj)); 70 | } 71 | } 72 | 73 | /// 74 | /// Looks up a localized resource of type System.Drawing.Bitmap. 75 | /// 76 | internal static System.Drawing.Bitmap aniview { 77 | get { 78 | object obj = ResourceManager.GetObject("aniview", resourceCulture); 79 | return ((System.Drawing.Bitmap)(obj)); 80 | } 81 | } 82 | 83 | /// 84 | /// Looks up a localized resource of type System.Drawing.Bitmap. 85 | /// 86 | internal static System.Drawing.Bitmap aniview_tab { 87 | get { 88 | object obj = ResourceManager.GetObject("aniview_tab", resourceCulture); 89 | return ((System.Drawing.Bitmap)(obj)); 90 | } 91 | } 92 | 93 | /// 94 | /// Looks up a localized resource of type System.Drawing.Bitmap. 95 | /// 96 | internal static System.Drawing.Bitmap close { 97 | get { 98 | object obj = ResourceManager.GetObject("close", resourceCulture); 99 | return ((System.Drawing.Bitmap)(obj)); 100 | } 101 | } 102 | 103 | /// 104 | /// Looks up a localized resource of type System.Drawing.Bitmap. 105 | /// 106 | internal static System.Drawing.Bitmap edit { 107 | get { 108 | object obj = ResourceManager.GetObject("edit", resourceCulture); 109 | return ((System.Drawing.Bitmap)(obj)); 110 | } 111 | } 112 | 113 | /// 114 | /// Looks up a localized resource of type System.Drawing.Bitmap. 115 | /// 116 | internal static System.Drawing.Bitmap exit { 117 | get { 118 | object obj = ResourceManager.GetObject("exit", resourceCulture); 119 | return ((System.Drawing.Bitmap)(obj)); 120 | } 121 | } 122 | 123 | /// 124 | /// Looks up a localized resource of type System.Drawing.Bitmap. 125 | /// 126 | internal static System.Drawing.Bitmap export { 127 | get { 128 | object obj = ResourceManager.GetObject("export", resourceCulture); 129 | return ((System.Drawing.Bitmap)(obj)); 130 | } 131 | } 132 | 133 | /// 134 | /// Looks up a localized resource of type System.Drawing.Bitmap. 135 | /// 136 | internal static System.Drawing.Bitmap help { 137 | get { 138 | object obj = ResourceManager.GetObject("help", resourceCulture); 139 | return ((System.Drawing.Bitmap)(obj)); 140 | } 141 | } 142 | 143 | /// 144 | /// Looks up a localized resource of type System.Drawing.Bitmap. 145 | /// 146 | internal static System.Drawing.Bitmap house { 147 | get { 148 | object obj = ResourceManager.GetObject("house", resourceCulture); 149 | return ((System.Drawing.Bitmap)(obj)); 150 | } 151 | } 152 | 153 | /// 154 | /// Looks up a localized resource of type System.Drawing.Bitmap. 155 | /// 156 | internal static System.Drawing.Bitmap house_tab { 157 | get { 158 | object obj = ResourceManager.GetObject("house_tab", resourceCulture); 159 | return ((System.Drawing.Bitmap)(obj)); 160 | } 161 | } 162 | 163 | /// 164 | /// Looks up a localized resource of type System.Drawing.Bitmap. 165 | /// 166 | internal static System.Drawing.Bitmap left { 167 | get { 168 | object obj = ResourceManager.GetObject("left", resourceCulture); 169 | return ((System.Drawing.Bitmap)(obj)); 170 | } 171 | } 172 | 173 | /// 174 | /// Looks up a localized resource of type System.Drawing.Bitmap. 175 | /// 176 | internal static System.Drawing.Bitmap license { 177 | get { 178 | object obj = ResourceManager.GetObject("license", resourceCulture); 179 | return ((System.Drawing.Bitmap)(obj)); 180 | } 181 | } 182 | 183 | /// 184 | /// Looks up a localized resource of type System.Drawing.Bitmap. 185 | /// 186 | internal static System.Drawing.Bitmap money { 187 | get { 188 | object obj = ResourceManager.GetObject("money", resourceCulture); 189 | return ((System.Drawing.Bitmap)(obj)); 190 | } 191 | } 192 | 193 | /// 194 | /// Looks up a localized resource of type System.Drawing.Bitmap. 195 | /// 196 | internal static System.Drawing.Bitmap monitor { 197 | get { 198 | object obj = ResourceManager.GetObject("monitor", resourceCulture); 199 | return ((System.Drawing.Bitmap)(obj)); 200 | } 201 | } 202 | 203 | /// 204 | /// Looks up a localized resource of type System.Drawing.Bitmap. 205 | /// 206 | internal static System.Drawing.Bitmap open { 207 | get { 208 | object obj = ResourceManager.GetObject("open", resourceCulture); 209 | return ((System.Drawing.Bitmap)(obj)); 210 | } 211 | } 212 | 213 | /// 214 | /// Looks up a localized resource of type System.Drawing.Bitmap. 215 | /// 216 | internal static System.Drawing.Bitmap pause { 217 | get { 218 | object obj = ResourceManager.GetObject("pause", resourceCulture); 219 | return ((System.Drawing.Bitmap)(obj)); 220 | } 221 | } 222 | 223 | /// 224 | /// Looks up a localized resource of type System.Drawing.Bitmap. 225 | /// 226 | internal static System.Drawing.Bitmap play { 227 | get { 228 | object obj = ResourceManager.GetObject("play", resourceCulture); 229 | return ((System.Drawing.Bitmap)(obj)); 230 | } 231 | } 232 | 233 | /// 234 | /// Looks up a localized resource of type System.Drawing.Bitmap. 235 | /// 236 | internal static System.Drawing.Bitmap properties { 237 | get { 238 | object obj = ResourceManager.GetObject("properties", resourceCulture); 239 | return ((System.Drawing.Bitmap)(obj)); 240 | } 241 | } 242 | 243 | /// 244 | /// Looks up a localized resource of type System.Drawing.Bitmap. 245 | /// 246 | internal static System.Drawing.Bitmap right { 247 | get { 248 | object obj = ResourceManager.GetObject("right", resourceCulture); 249 | return ((System.Drawing.Bitmap)(obj)); 250 | } 251 | } 252 | 253 | /// 254 | /// Looks up a localized resource of type System.Drawing.Bitmap. 255 | /// 256 | internal static System.Drawing.Bitmap settings { 257 | get { 258 | object obj = ResourceManager.GetObject("settings", resourceCulture); 259 | return ((System.Drawing.Bitmap)(obj)); 260 | } 261 | } 262 | 263 | /// 264 | /// Looks up a localized resource of type System.Drawing.Bitmap. 265 | /// 266 | internal static System.Drawing.Bitmap settings_tab { 267 | get { 268 | object obj = ResourceManager.GetObject("settings_tab", resourceCulture); 269 | return ((System.Drawing.Bitmap)(obj)); 270 | } 271 | } 272 | 273 | /// 274 | /// Looks up a localized resource of type System.Drawing.Bitmap. 275 | /// 276 | internal static System.Drawing.Bitmap update { 277 | get { 278 | object obj = ResourceManager.GetObject("update", resourceCulture); 279 | return ((System.Drawing.Bitmap)(obj)); 280 | } 281 | } 282 | } 283 | } 284 | -------------------------------------------------------------------------------- /AniView/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | ..\Resources\Images\about.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 123 | 124 | 125 | ..\Resources\Images\aniview.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 126 | 127 | 128 | ..\Resources\Images\aniview_tab.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 129 | 130 | 131 | ..\Resources\Images\close.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 132 | 133 | 134 | ..\Resources\Images\edit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 135 | 136 | 137 | ..\Resources\Images\exit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 138 | 139 | 140 | ..\Resources\Images\export.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 141 | 142 | 143 | ..\Resources\Images\help.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 144 | 145 | 146 | ..\Resources\Images\house.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 147 | 148 | 149 | ..\Resources\Images\house_tab.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 150 | 151 | 152 | ..\Resources\Images\left.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 153 | 154 | 155 | ..\Resources\Images\license.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 156 | 157 | 158 | ..\Resources\Images\money.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 159 | 160 | 161 | ..\Resources\Images\monitor.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 162 | 163 | 164 | ..\Resources\Images\open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 165 | 166 | 167 | ..\Resources\Images\pause.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 168 | 169 | 170 | ..\Resources\Images\play.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 171 | 172 | 173 | ..\Resources\Images\properties.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 174 | 175 | 176 | ..\Resources\Images\right.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 177 | 178 | 179 | ..\Resources\Images\settings.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 180 | 181 | 182 | ..\Resources\Images\settings_tab.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 183 | 184 | 185 | ..\Resources\Images\update.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 186 | 187 | -------------------------------------------------------------------------------- /AniView/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace AniView.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.6.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | 26 | [global::System.Configuration.UserScopedSettingAttribute()] 27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 | [global::System.Configuration.DefaultSettingValueAttribute("Metro")] 29 | public string VisualStyle { 30 | get { 31 | return ((string)(this["VisualStyle"])); 32 | } 33 | set { 34 | this["VisualStyle"] = value; 35 | } 36 | } 37 | 38 | [global::System.Configuration.UserScopedSettingAttribute()] 39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 40 | [global::System.Configuration.DefaultSettingValueAttribute("#FF07779C")] 41 | public global::System.Windows.Media.Color MetroColor { 42 | get { 43 | return ((global::System.Windows.Media.Color)(this["MetroColor"])); 44 | } 45 | set { 46 | this["MetroColor"] = value; 47 | } 48 | } 49 | 50 | [global::System.Configuration.UserScopedSettingAttribute()] 51 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 52 | [global::System.Configuration.DefaultSettingValueAttribute("3")] 53 | public int BorderThickness { 54 | get { 55 | return ((int)(this["BorderThickness"])); 56 | } 57 | set { 58 | this["BorderThickness"] = value; 59 | } 60 | } 61 | 62 | [global::System.Configuration.UserScopedSettingAttribute()] 63 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 64 | [global::System.Configuration.DefaultSettingValueAttribute("True")] 65 | public bool AutoUpdate { 66 | get { 67 | return ((bool)(this["AutoUpdate"])); 68 | } 69 | set { 70 | this["AutoUpdate"] = value; 71 | } 72 | } 73 | 74 | [global::System.Configuration.UserScopedSettingAttribute()] 75 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 76 | [global::System.Configuration.DefaultSettingValueAttribute("0")] 77 | public int RepeatBehaviourIndex { 78 | get { 79 | return ((int)(this["RepeatBehaviourIndex"])); 80 | } 81 | set { 82 | this["RepeatBehaviourIndex"] = value; 83 | } 84 | } 85 | 86 | [global::System.Configuration.UserScopedSettingAttribute()] 87 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 88 | [global::System.Configuration.DefaultSettingValueAttribute("Png")] 89 | public global::System.Drawing.Imaging.ImageFormat ImageFormat { 90 | get { 91 | return ((global::System.Drawing.Imaging.ImageFormat)(this["ImageFormat"])); 92 | } 93 | set { 94 | this["ImageFormat"] = value; 95 | } 96 | } 97 | 98 | [global::System.Configuration.UserScopedSettingAttribute()] 99 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 100 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 101 | public bool FullScreen { 102 | get { 103 | return ((bool)(this["FullScreen"])); 104 | } 105 | set { 106 | this["FullScreen"] = value; 107 | } 108 | } 109 | 110 | [global::System.Configuration.UserScopedSettingAttribute()] 111 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 112 | [global::System.Configuration.DefaultSettingValueAttribute("True")] 113 | public bool DragDrop { 114 | get { 115 | return ((bool)(this["DragDrop"])); 116 | } 117 | set { 118 | this["DragDrop"] = value; 119 | } 120 | } 121 | 122 | [global::System.Configuration.UserScopedSettingAttribute()] 123 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 124 | [global::System.Configuration.DefaultSettingValueAttribute("True")] 125 | public bool ArrowKeys { 126 | get { 127 | return ((bool)(this["ArrowKeys"])); 128 | } 129 | set { 130 | this["ArrowKeys"] = value; 131 | } 132 | } 133 | 134 | [global::System.Configuration.UserScopedSettingAttribute()] 135 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 136 | [global::System.Configuration.DefaultSettingValueAttribute("True")] 137 | public bool AutoStart { 138 | get { 139 | return ((bool)(this["AutoStart"])); 140 | } 141 | set { 142 | this["AutoStart"] = value; 143 | } 144 | } 145 | 146 | [global::System.Configuration.UserScopedSettingAttribute()] 147 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 148 | [global::System.Configuration.DefaultSettingValueAttribute("True")] 149 | public bool AutoSizeWindow { 150 | get { 151 | return ((bool)(this["AutoSizeWindow"])); 152 | } 153 | set { 154 | this["AutoSizeWindow"] = value; 155 | } 156 | } 157 | 158 | [global::System.Configuration.UserScopedSettingAttribute()] 159 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 160 | [global::System.Configuration.DefaultSettingValueAttribute("True")] 161 | public bool ShowFileTitle { 162 | get { 163 | return ((bool)(this["ShowFileTitle"])); 164 | } 165 | set { 166 | this["ShowFileTitle"] = value; 167 | } 168 | } 169 | 170 | [global::System.Configuration.UserScopedSettingAttribute()] 171 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 172 | [global::System.Configuration.DefaultSettingValueAttribute("True")] 173 | public bool WindowDragging { 174 | get { 175 | return ((bool)(this["WindowDragging"])); 176 | } 177 | set { 178 | this["WindowDragging"] = value; 179 | } 180 | } 181 | 182 | [global::System.Configuration.UserScopedSettingAttribute()] 183 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 184 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 185 | public bool StatusBar { 186 | get { 187 | return ((bool)(this["StatusBar"])); 188 | } 189 | set { 190 | this["StatusBar"] = value; 191 | } 192 | } 193 | 194 | [global::System.Configuration.UserScopedSettingAttribute()] 195 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 196 | [global::System.Configuration.DefaultSettingValueAttribute("100")] 197 | public double WindowOpacity { 198 | get { 199 | return ((double)(this["WindowOpacity"])); 200 | } 201 | set { 202 | this["WindowOpacity"] = value; 203 | } 204 | } 205 | 206 | [global::System.Configuration.UserScopedSettingAttribute()] 207 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 208 | [global::System.Configuration.DefaultSettingValueAttribute("3")] 209 | public double WindowResizeBorder { 210 | get { 211 | return ((double)(this["WindowResizeBorder"])); 212 | } 213 | set { 214 | this["WindowResizeBorder"] = value; 215 | } 216 | } 217 | 218 | [global::System.Configuration.UserScopedSettingAttribute()] 219 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 220 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 221 | public bool Topmost { 222 | get { 223 | return ((bool)(this["Topmost"])); 224 | } 225 | set { 226 | this["Topmost"] = value; 227 | } 228 | } 229 | 230 | [global::System.Configuration.UserScopedSettingAttribute()] 231 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 232 | [global::System.Configuration.DefaultSettingValueAttribute("1")] 233 | public int CustomRepeatBehaviour { 234 | get { 235 | return ((int)(this["CustomRepeatBehaviour"])); 236 | } 237 | set { 238 | this["CustomRepeatBehaviour"] = value; 239 | } 240 | } 241 | } 242 | } 243 | -------------------------------------------------------------------------------- /AniView/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | Metro 7 | 8 | 9 | #FF07779C 10 | 11 | 12 | 3 13 | 14 | 15 | True 16 | 17 | 18 | 0 19 | 20 | 21 | Png 22 | 23 | 24 | False 25 | 26 | 27 | True 28 | 29 | 30 | True 31 | 32 | 33 | True 34 | 35 | 36 | True 37 | 38 | 39 | True 40 | 41 | 42 | True 43 | 44 | 45 | False 46 | 47 | 48 | 100 49 | 50 | 51 | 3 52 | 53 | 54 | False 55 | 56 | 57 | 1 58 | 59 | 60 | -------------------------------------------------------------------------------- /AniView/Resources/Images/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeDead/AniView/428c1e299edd31b82b4eefd3755ce94ed1af07f4/AniView/Resources/Images/about.png -------------------------------------------------------------------------------- /AniView/Resources/Images/aniview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeDead/AniView/428c1e299edd31b82b4eefd3755ce94ed1af07f4/AniView/Resources/Images/aniview.png -------------------------------------------------------------------------------- /AniView/Resources/Images/aniview_tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeDead/AniView/428c1e299edd31b82b4eefd3755ce94ed1af07f4/AniView/Resources/Images/aniview_tab.png -------------------------------------------------------------------------------- /AniView/Resources/Images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeDead/AniView/428c1e299edd31b82b4eefd3755ce94ed1af07f4/AniView/Resources/Images/close.png -------------------------------------------------------------------------------- /AniView/Resources/Images/edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeDead/AniView/428c1e299edd31b82b4eefd3755ce94ed1af07f4/AniView/Resources/Images/edit.png -------------------------------------------------------------------------------- /AniView/Resources/Images/exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeDead/AniView/428c1e299edd31b82b4eefd3755ce94ed1af07f4/AniView/Resources/Images/exit.png -------------------------------------------------------------------------------- /AniView/Resources/Images/export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeDead/AniView/428c1e299edd31b82b4eefd3755ce94ed1af07f4/AniView/Resources/Images/export.png -------------------------------------------------------------------------------- /AniView/Resources/Images/help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeDead/AniView/428c1e299edd31b82b4eefd3755ce94ed1af07f4/AniView/Resources/Images/help.png -------------------------------------------------------------------------------- /AniView/Resources/Images/house.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeDead/AniView/428c1e299edd31b82b4eefd3755ce94ed1af07f4/AniView/Resources/Images/house.png -------------------------------------------------------------------------------- /AniView/Resources/Images/house_tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeDead/AniView/428c1e299edd31b82b4eefd3755ce94ed1af07f4/AniView/Resources/Images/house_tab.png -------------------------------------------------------------------------------- /AniView/Resources/Images/left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeDead/AniView/428c1e299edd31b82b4eefd3755ce94ed1af07f4/AniView/Resources/Images/left.png -------------------------------------------------------------------------------- /AniView/Resources/Images/license.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeDead/AniView/428c1e299edd31b82b4eefd3755ce94ed1af07f4/AniView/Resources/Images/license.png -------------------------------------------------------------------------------- /AniView/Resources/Images/money.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeDead/AniView/428c1e299edd31b82b4eefd3755ce94ed1af07f4/AniView/Resources/Images/money.png -------------------------------------------------------------------------------- /AniView/Resources/Images/monitor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeDead/AniView/428c1e299edd31b82b4eefd3755ce94ed1af07f4/AniView/Resources/Images/monitor.png -------------------------------------------------------------------------------- /AniView/Resources/Images/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeDead/AniView/428c1e299edd31b82b4eefd3755ce94ed1af07f4/AniView/Resources/Images/open.png -------------------------------------------------------------------------------- /AniView/Resources/Images/pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeDead/AniView/428c1e299edd31b82b4eefd3755ce94ed1af07f4/AniView/Resources/Images/pause.png -------------------------------------------------------------------------------- /AniView/Resources/Images/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeDead/AniView/428c1e299edd31b82b4eefd3755ce94ed1af07f4/AniView/Resources/Images/play.png -------------------------------------------------------------------------------- /AniView/Resources/Images/properties.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeDead/AniView/428c1e299edd31b82b4eefd3755ce94ed1af07f4/AniView/Resources/Images/properties.png -------------------------------------------------------------------------------- /AniView/Resources/Images/right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeDead/AniView/428c1e299edd31b82b4eefd3755ce94ed1af07f4/AniView/Resources/Images/right.png -------------------------------------------------------------------------------- /AniView/Resources/Images/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeDead/AniView/428c1e299edd31b82b4eefd3755ce94ed1af07f4/AniView/Resources/Images/settings.png -------------------------------------------------------------------------------- /AniView/Resources/Images/settings_tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeDead/AniView/428c1e299edd31b82b4eefd3755ce94ed1af07f4/AniView/Resources/Images/settings_tab.png -------------------------------------------------------------------------------- /AniView/Resources/Images/update.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeDead/AniView/428c1e299edd31b82b4eefd3755ce94ed1af07f4/AniView/Resources/Images/update.png -------------------------------------------------------------------------------- /AniView/Windows/AboutWindow.xaml: -------------------------------------------------------------------------------- 1 |  12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | AniView was created by DeadLine. 27 | 28 | Images: 29 | * small-n-flat by paomedia 30 | * icons8 (https://icons8.com) 31 | Theme: Syncfusion 32 | Gif control: XamlAnimatedGif 33 | Version: 1.6.0.0 34 | 35 | Copyright © 2020 CodeDead 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 151 | 154 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 171 | 172 | 173 | -------------------------------------------------------------------------------- /AniView/Windows/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.IO; 5 | using System.Reflection; 6 | using System.Windows; 7 | using System.Windows.Forms; 8 | using System.Windows.Input; 9 | using System.Windows.Media; 10 | using System.Windows.Media.Animation; 11 | using System.Windows.Media.Imaging; 12 | using AniView.Classes; 13 | using CodeDead.UpdateManager.Classes; 14 | using XamlAnimatedGif; 15 | using Application = System.Windows.Application; 16 | using DataFormats = System.Windows.DataFormats; 17 | using DragEventArgs = System.Windows.DragEventArgs; 18 | using KeyEventArgs = System.Windows.Input.KeyEventArgs; 19 | using MessageBox = System.Windows.MessageBox; 20 | using OpenFileDialog = Microsoft.Win32.OpenFileDialog; 21 | using Path = System.IO.Path; 22 | 23 | namespace AniView.Windows 24 | { 25 | /// 26 | /// 27 | /// Interaction logic for MainWindow.xaml 28 | /// 29 | public partial class MainWindow 30 | { 31 | #region Local Variables 32 | /// 33 | /// A boolean to indicate whether frames are being extracted or not 34 | /// 35 | private bool _extractingFrames; 36 | /// 37 | /// A list of obtained paths that lead to displayable images 38 | /// 39 | private List _images = new List(); 40 | /// 41 | /// The index of the currently selected image in the image list 42 | /// 43 | private int _current; 44 | /// 45 | /// The animation behaviour for the XamlAnimatedGif control 46 | /// 47 | private Animator _animator; 48 | /// 49 | /// The path of the image that is currently being displayed 50 | /// 51 | private string _currentPath = ""; 52 | /// 53 | /// The UpdateManager that will indicate whether an application update is available or not 54 | /// 55 | private readonly UpdateManager _updateManager; 56 | #endregion 57 | 58 | #region Setting Variables 59 | /// 60 | /// A boolean to indicate whether the file path should be displayed in the title of the window 61 | /// 62 | private bool _showFileTitle; 63 | /// 64 | /// A boolean to indicate whether or not navigating AniView with arrow keys is enabled 65 | /// 66 | private bool _arrowKeysEnabled; 67 | /// 68 | /// A boolean to indicate whether the window should automatically resize itself 69 | /// 70 | private bool _autoSizeWindow; 71 | /// 72 | /// A boolean to indicate whether the animation behaviour should start automatically 73 | /// 74 | private bool _autoStartAnimation; 75 | #endregion 76 | 77 | /// 78 | /// 79 | /// Initialize a new MainWindow object 80 | /// 81 | public MainWindow() 82 | { 83 | StringVariables stringVariables = new StringVariables 84 | { 85 | CancelButtonText = "Cancel", 86 | DownloadButtonText = "Download", 87 | InformationButtonText = "Information", 88 | NoNewVersionText = "You are running the latest version!", 89 | TitleText = "AniView", 90 | UpdateNowText = "Would you like to update AniView now?" 91 | }; 92 | _updateManager = new UpdateManager(Assembly.GetExecutingAssembly().GetName().Version, "https://codedead.com/Software/AniView/update.json", stringVariables, DataType.Json); 93 | 94 | InitializeComponent(); 95 | ChangeVisualStyle(); 96 | LoadAnimationBehaviour(); 97 | LoadSettings(); 98 | 99 | LoadArguments(); 100 | 101 | try 102 | { 103 | if (Properties.Settings.Default.AutoUpdate) 104 | { 105 | _updateManager.CheckForUpdate(false, false); 106 | } 107 | } 108 | catch (Exception ex) 109 | { 110 | MessageBox.Show(ex.Message, "AniView", MessageBoxButton.OK, MessageBoxImage.Error); 111 | } 112 | } 113 | 114 | /// 115 | /// Load the animation behaviour for XamlAnimatedGif 116 | /// 117 | internal void LoadAnimationBehaviour() 118 | { 119 | try 120 | { 121 | int repeats = Properties.Settings.Default.RepeatBehaviourIndex; 122 | if (repeats == 4) repeats = Properties.Settings.Default.CustomRepeatBehaviour; 123 | 124 | AnimationBehavior.SetRepeatBehavior(ImgView, repeats == 0 ? RepeatBehavior.Forever : new RepeatBehavior(repeats)); 125 | _autoStartAnimation = Properties.Settings.Default.AutoStart; 126 | AnimationBehavior.SetAutoStart(ImgView, _autoStartAnimation); 127 | } 128 | catch (Exception ex) 129 | { 130 | MessageBox.Show(ex.Message, "AniView", MessageBoxButton.OK, MessageBoxImage.Error); 131 | } 132 | } 133 | 134 | /// 135 | /// Load all relevant settings 136 | /// 137 | internal void LoadSettings() 138 | { 139 | try 140 | { 141 | BtnFullScreen.IsChecked = Properties.Settings.Default.FullScreen; 142 | _arrowKeysEnabled = Properties.Settings.Default.ArrowKeys; 143 | _autoSizeWindow = Properties.Settings.Default.AutoSizeWindow; 144 | _showFileTitle = Properties.Settings.Default.ShowFileTitle; 145 | 146 | if (!_showFileTitle) Title = "AniView"; 147 | if (_showFileTitle && !string.IsNullOrEmpty(_currentPath)) Title = "AniView - " + _currentPath; 148 | 149 | if (Properties.Settings.Default.WindowDragging) 150 | { 151 | // Prevent duplicate handlers 152 | MouseDown -= OnMouseDown; 153 | MouseDown += OnMouseDown; 154 | } 155 | else 156 | { 157 | MouseDown -= OnMouseDown; 158 | } 159 | 160 | MniStatusbar.IsChecked = Properties.Settings.Default.StatusBar; 161 | StbInfo.Visibility = MniStatusbar.IsChecked ? Visibility.Visible : Visibility.Collapsed; 162 | } 163 | catch (Exception ex) 164 | { 165 | MessageBox.Show(ex.Message, "AniView", MessageBoxButton.OK, MessageBoxImage.Error); 166 | } 167 | } 168 | 169 | /// 170 | /// Method that is called when the Window should be dragged 171 | /// 172 | /// The object that called this method 173 | /// The MouseButtonEventArgs 174 | private void OnMouseDown(object sender, MouseButtonEventArgs e) 175 | { 176 | if (e.ChangedButton == MouseButton.Left && e.LeftButton == MouseButtonState.Pressed) 177 | { 178 | DragMove(); 179 | } 180 | } 181 | 182 | /// 183 | /// Change the visual style of an object, depending on the settings. 184 | /// 185 | internal void ChangeVisualStyle() 186 | { 187 | StyleManager.ChangeStyle(this); 188 | } 189 | 190 | /// 191 | /// Load startup arguments in order to load the image into the GUI 192 | /// 193 | private void LoadArguments() 194 | { 195 | string[] args = Environment.GetCommandLineArgs(); 196 | if (args.Length <= 1) return; 197 | if (!File.Exists(args[1])) return; 198 | 199 | LoadImage(args[1]); 200 | } 201 | 202 | /// 203 | /// Load the path of all GIF images into a list and determine the position of the current image in the list 204 | /// 205 | private void LoadImage(string path) 206 | { 207 | if (path == null) return; 208 | if (!File.Exists(path)) return; 209 | if (_currentPath == path) return; 210 | 211 | PgbLoading.Visibility = Visibility.Visible; 212 | ImgView.Visibility = Visibility.Collapsed; 213 | SldFrame.Value = 0; 214 | 215 | LblDimensions.Content = ""; 216 | LblSize.Content = ""; 217 | LblFrames.Content = ""; 218 | 219 | // Check if an image is valid 220 | try 221 | { 222 | BitmapImage bitmap = new BitmapImage(); 223 | using (FileStream stream = File.OpenRead(path)) 224 | { 225 | bitmap.BeginInit(); 226 | bitmap.CacheOption = BitmapCacheOption.OnLoad; 227 | bitmap.StreamSource = stream; 228 | bitmap.EndInit(); 229 | } 230 | } 231 | catch (NotSupportedException ex) 232 | { 233 | PgbLoading.Visibility = Visibility.Collapsed; 234 | MessageBox.Show(ex.Message, "AniView", MessageBoxButton.OK, MessageBoxImage.Error); 235 | return; 236 | } 237 | 238 | AnimationBehavior.SetSourceUri(ImgView, new Uri(path)); 239 | _images = new List(); 240 | ImgPause.Source = _autoStartAnimation ? new BitmapImage(new Uri("/AniView;component/Resources/Images/pause.png", UriKind.Relative)) : new BitmapImage(new Uri("/AniView;component/Resources/Images/play.png", UriKind.Relative)); 241 | if (_autoSizeWindow) 242 | { 243 | SizeToContent = SizeToContent.WidthAndHeight; 244 | } 245 | 246 | string pathName = Path.GetDirectoryName(path); 247 | if (pathName != null) 248 | { 249 | foreach (string s in Directory.GetFiles(pathName, "*.gif", SearchOption.TopDirectoryOnly)) 250 | { 251 | if (!_images.Contains(s)) 252 | { 253 | _images.Add(s); 254 | } 255 | } 256 | } 257 | for (int i = 0; i < _images.Count; i++) 258 | { 259 | if (_images[i] == path) 260 | { 261 | _current = i; 262 | } 263 | } 264 | _currentPath = path; 265 | 266 | Title = "AniView"; 267 | if (_showFileTitle) 268 | { 269 | Title += " - " + _currentPath; 270 | } 271 | } 272 | 273 | /// 274 | /// Unload the current image and reset all variables to their default values 275 | /// 276 | private void UnloadImage() 277 | { 278 | AnimationBehavior.SetSourceUri(ImgView, null); 279 | 280 | ImgView.Visibility = Visibility.Collapsed; 281 | PgbLoading.Visibility = Visibility.Collapsed; 282 | 283 | _animator = null; 284 | _currentPath = ""; 285 | _current = 0; 286 | _images = new List(); 287 | Title = "AniView"; 288 | 289 | LblSize.Content = ""; 290 | LblFrames.Content = ""; 291 | LblDimensions.Content = ""; 292 | 293 | SldFrame.Value = 0; 294 | } 295 | 296 | /// 297 | /// Open the next image 298 | /// 299 | /// The object that has initialized the method 300 | /// The routed event arguments 301 | private void BtnRight_Click(object sender, RoutedEventArgs e) 302 | { 303 | MoveRight(); 304 | } 305 | 306 | /// 307 | /// Load the image that is located to the left of the current image position 308 | /// 309 | private void MoveRight() 310 | { 311 | if (_images.Count == 0) return; 312 | _current++; 313 | if (_current > _images.Count - 1) 314 | { 315 | _current = 0; 316 | } 317 | LoadImage(_images[_current]); 318 | } 319 | 320 | /// 321 | /// Load the image that is located to the right of the current image position 322 | /// 323 | private void MoveLeft() 324 | { 325 | if (_images.Count == 0) return; 326 | _current--; 327 | if (_current < 0) 328 | { 329 | _current = _images.Count - 1; 330 | } 331 | LoadImage(_images[_current]); 332 | } 333 | 334 | /// 335 | /// Open the previous image 336 | /// 337 | /// The object that has initialized the method 338 | /// The routed event arguments 339 | private void BtnLeft_Click(object sender, RoutedEventArgs e) 340 | { 341 | MoveLeft(); 342 | } 343 | 344 | /// 345 | /// Pause the current image 346 | /// 347 | /// The object that has initialized the method 348 | /// The routed event arguments 349 | private void BtnPause_Click(object sender, RoutedEventArgs e) 350 | { 351 | if (_animator == null) return; 352 | if (_animator.IsPaused) 353 | { 354 | _animator.Play(); 355 | ImgPause.Source = new BitmapImage(new Uri("/AniView;component/Resources/Images/pause.png", UriKind.Relative)); 356 | } 357 | else 358 | { 359 | _animator.Pause(); 360 | ImgPause.Source = new BitmapImage(new Uri("/AniView;component/Resources/Images/play.png", UriKind.Relative)); 361 | } 362 | } 363 | 364 | /// 365 | /// This method will be called when the current frame of the image has changed 366 | /// 367 | /// The object that has initialized the method 368 | /// The event arguments 369 | private void CurrentFrameChanged(object sender, EventArgs e) 370 | { 371 | if (_animator != null && PgbLoading.Visibility == Visibility.Collapsed) 372 | { 373 | SldFrame.Value = _animator.CurrentFrameIndex; 374 | } 375 | } 376 | 377 | /// 378 | /// This method will be called when the animation of the image has completed 379 | /// 380 | /// The object that has initialized the method 381 | /// The event arguments 382 | private void AnimationCompleted(object sender, EventArgs e) 383 | { 384 | _animator.Rewind(); 385 | ImgPause.Source = new BitmapImage(new Uri("/AniView;component/Resources/Images/play.png", UriKind.Relative)); 386 | } 387 | 388 | /// 389 | /// This method will be called when the animation behaviour has loaded 390 | /// 391 | /// The object that has initialized the method 392 | /// The routed event arguments 393 | private void AnimationBehavior_OnLoaded(object sender, RoutedEventArgs e) 394 | { 395 | PgbLoading.Visibility = Visibility.Collapsed; 396 | ImgView.Visibility = Visibility.Visible; 397 | 398 | if (_animator != null) 399 | { 400 | _animator.CurrentFrameChanged -= CurrentFrameChanged; 401 | _animator.AnimationCompleted -= AnimationCompleted; 402 | } 403 | 404 | _animator = AnimationBehavior.GetAnimator(ImgView); 405 | 406 | if (_animator == null) return; 407 | _animator.CurrentFrameChanged += CurrentFrameChanged; 408 | _animator.AnimationCompleted += AnimationCompleted; 409 | SldFrame.Value = 0; 410 | SldFrame.Maximum = _animator.FrameCount - 1; 411 | 412 | LblDimensions.Content = ImgView.Source.Width + " x " + ImgView.Source.Height; 413 | LblSize.Content = (new FileInfo(_currentPath).Length / 1024f / 1024f).ToString("F2") + " MB"; 414 | LblFrames.Content = "Frames: " + ImageUtils.GetFrameCount(_currentPath); 415 | } 416 | 417 | /// 418 | /// This method will be called when an error occurs within the animation behaviour 419 | /// 420 | /// The dependency object 421 | /// The animation error event arguments 422 | private void AnimationBehavior_OnError(DependencyObject d, AnimationErrorEventArgs e) 423 | { 424 | PgbLoading.Visibility = Visibility.Collapsed; 425 | ImgView.Visibility = Visibility.Collapsed; 426 | 427 | MessageBox.Show($"An error occurred ({e.Kind}): {e.Exception}", "AniView", MessageBoxButton.OK, MessageBoxImage.Error); 428 | } 429 | 430 | /// 431 | /// Open an image 432 | /// 433 | /// The object that has initialized the method 434 | /// The routed event arguments 435 | private void BtnOpen_Click(object sender, RoutedEventArgs e) 436 | { 437 | OpenFileDialog ofd = new OpenFileDialog { Filter = "GIF Images (*.gif)|*.gif" }; 438 | 439 | if (ofd.ShowDialog(this) == true) 440 | { 441 | LoadImage(ofd.FileName); 442 | } 443 | } 444 | 445 | /// 446 | /// Exit the application 447 | /// 448 | /// The object that has initialized the method 449 | /// The routed event arguments 450 | private void BtnExit_Click(object sender, RoutedEventArgs e) 451 | { 452 | Application.Current.Shutdown(0); 453 | } 454 | 455 | /// 456 | /// Edit an image using the default image editor 457 | /// 458 | /// The object that has initialized the method 459 | /// The routed event arguments 460 | private void BtnEdit_Click(object sender, RoutedEventArgs e) 461 | { 462 | if (!File.Exists(_currentPath)) return; 463 | try 464 | { 465 | ProcessStartInfo startInfo = new ProcessStartInfo(_currentPath) { Verb = "edit" }; 466 | Process.Start(startInfo); 467 | } 468 | catch (Exception exception) 469 | { 470 | MessageBox.Show(this, exception.Message, "AniView", MessageBoxButton.OK); 471 | } 472 | } 473 | 474 | /// 475 | /// Method that is called when the visibility of the status bar should change 476 | /// 477 | /// The object that called this method 478 | /// The RoutedEventArgs 479 | private void MniStatusbar_OnChecked(object sender, RoutedEventArgs e) 480 | { 481 | try 482 | { 483 | Properties.Settings.Default.StatusBar = MniStatusbar.IsChecked; 484 | StbInfo.Visibility = MniStatusbar.IsChecked ? Visibility.Visible : Visibility.Collapsed; 485 | } 486 | catch (Exception ex) 487 | { 488 | MessageBox.Show(ex.Message, "AniView", MessageBoxButton.OK, MessageBoxImage.Error); 489 | } 490 | } 491 | 492 | /// 493 | /// Open a new SettingsWindow 494 | /// 495 | /// The object that has initialized the method 496 | /// The routed event arguments 497 | private void BtnSettings_Click(object sender, RoutedEventArgs e) 498 | { 499 | new SettingsWindow(this).ShowDialog(); 500 | } 501 | 502 | /// 503 | /// Open the help documentation, if applicable 504 | /// 505 | /// The object that has initialized the method 506 | /// The routed event arguments 507 | private void BtnHelp_Click(object sender, RoutedEventArgs e) 508 | { 509 | try 510 | { 511 | Process.Start(AppDomain.CurrentDomain.BaseDirectory + "\\help.pdf"); 512 | } 513 | catch (Exception ex) 514 | { 515 | MessageBox.Show(this, ex.Message, "AniView", MessageBoxButton.OK, MessageBoxImage.Error); 516 | } 517 | } 518 | 519 | /// 520 | /// Check for application updates 521 | /// 522 | /// The object that has initialized the method 523 | /// The routed event arguments 524 | private void BtnUpdate_Click(object sender, RoutedEventArgs e) 525 | { 526 | _updateManager.CheckForUpdate(true, true); 527 | } 528 | 529 | /// 530 | /// Open the CodeDead website 531 | /// 532 | /// The object that has initialized the method 533 | /// The routed event arguments 534 | private void BtnCodeDead_Click(object sender, RoutedEventArgs e) 535 | { 536 | try 537 | { 538 | Process.Start("https://codedead.com/"); 539 | } 540 | catch (Exception ex) 541 | { 542 | MessageBox.Show(this, ex.Message, "AniView", MessageBoxButton.OK, MessageBoxImage.Error); 543 | } 544 | } 545 | 546 | /// 547 | /// Open the file containing the license for AniView 548 | /// 549 | /// The object that has initialized the method 550 | /// The routed event arguments 551 | private void BtnLicense_Click(object sender, RoutedEventArgs e) 552 | { 553 | try 554 | { 555 | Process.Start(AppDomain.CurrentDomain.BaseDirectory + "\\gpl.pdf"); 556 | } 557 | catch (Exception ex) 558 | { 559 | MessageBox.Show(this, ex.Message, "AniView", MessageBoxButton.OK, MessageBoxImage.Error); 560 | } 561 | } 562 | 563 | /// 564 | /// Open a new AboutWindow 565 | /// 566 | /// The object that has initialized the method 567 | /// The routed event arguments 568 | private void BtnAbout_Click(object sender, RoutedEventArgs e) 569 | { 570 | new AboutWindow().ShowDialog(); 571 | } 572 | 573 | /// 574 | /// Export an image and all of its frames 575 | /// 576 | /// The object that has initialized the method 577 | /// The routed event arguments 578 | private async void BtnExport_Click(object sender, RoutedEventArgs e) 579 | { 580 | if (_currentPath.Length == 0) return; 581 | if (!File.Exists(_currentPath)) return; 582 | if (_extractingFrames) return; 583 | 584 | FolderBrowserDialog fbd = new FolderBrowserDialog(); 585 | if (fbd.ShowDialog() != System.Windows.Forms.DialogResult.OK) return; 586 | 587 | try 588 | { 589 | _extractingFrames = true; 590 | await ImageUtils.ExtractFrames(_currentPath, fbd.SelectedPath, Properties.Settings.Default.ImageFormat); 591 | MessageBox.Show("All frames have been extracted!", "AniView", MessageBoxButton.OK, MessageBoxImage.Information); 592 | _extractingFrames = false; 593 | } 594 | catch (Exception ex) 595 | { 596 | MessageBox.Show(ex.Message, "AniView", MessageBoxButton.OK, MessageBoxImage.Error); 597 | } 598 | } 599 | 600 | /// 601 | /// Open the properties of a file using the default file properties window 602 | /// 603 | /// The object that has initialized the method 604 | /// The routed event arguments 605 | private void BtnProperties_OnClick(object sender, RoutedEventArgs e) 606 | { 607 | if (_currentPath.Length == 0) return; 608 | if (!File.Exists(_currentPath)) return; 609 | try 610 | { 611 | NativeMethods.ShowFileProperties(_currentPath); 612 | } 613 | catch (Exception ex) 614 | { 615 | MessageBox.Show(ex.Message, "AniView", MessageBoxButton.OK, MessageBoxImage.Error); 616 | } 617 | } 618 | 619 | /// 620 | /// Enable or disable the stretching of an image 621 | /// 622 | /// The object that has initialized the method 623 | /// The routed event arguments 624 | private void BtnFullScreen_OnClick(object sender, RoutedEventArgs e) 625 | { 626 | ImgView.Stretch = BtnFullScreen.IsChecked ? Stretch.Fill : Stretch.None; 627 | } 628 | 629 | /// 630 | /// Allow drag and drop of an image on the MainWindow 631 | /// 632 | /// The object that has initialized the method 633 | /// The drag event arguments 634 | private void GridMain_OnDrop(object sender, DragEventArgs e) 635 | { 636 | if (!e.Data.GetDataPresent(DataFormats.FileDrop)) return; 637 | string[] files = (string[])e.Data.GetData(DataFormats.FileDrop); 638 | if (files == null) return; 639 | if (!File.Exists(files[0])) return; 640 | 641 | LoadImage(files[0]); 642 | } 643 | 644 | /// 645 | /// Open the previous or next image if arrow key navigation is enabled 646 | /// 647 | /// The object that has initialized the method 648 | /// The key event arguments 649 | private void GridMain_OnKeyDown(object sender, KeyEventArgs e) 650 | { 651 | if (!_arrowKeysEnabled) return; 652 | // ReSharper disable once SwitchStatementMissingSomeEnumCasesNoDefault 653 | switch (e.Key) 654 | { 655 | case Key.Left: 656 | MoveLeft(); 657 | e.Handled = true; 658 | break; 659 | case Key.Right: 660 | MoveRight(); 661 | e.Handled = true; 662 | break; 663 | } 664 | } 665 | 666 | /// 667 | /// Close an image 668 | /// 669 | /// The object that has initialized the method 670 | /// The routed event arguments 671 | private void BtnClose_OnClick(object sender, RoutedEventArgs e) 672 | { 673 | UnloadImage(); 674 | } 675 | 676 | /// 677 | /// Open the donation page 678 | /// 679 | /// The object that has initialized the method 680 | /// The routed event arguments 681 | private void BtnDonate_Click(object sender, RoutedEventArgs e) 682 | { 683 | try 684 | { 685 | Process.Start("https://codedead.com/?page_id=302"); 686 | } 687 | catch (Exception ex) 688 | { 689 | MessageBox.Show(this, ex.Message, "AniView", MessageBoxButton.OK, MessageBoxImage.Error); 690 | } 691 | } 692 | 693 | /// 694 | /// Method that is called when the status bar should be hidden 695 | /// 696 | /// The object that called this method 697 | /// The RoutedEventArgs 698 | private void HideStatusbarMenuItem_OnClick(object sender, RoutedEventArgs e) 699 | { 700 | MniStatusbar.IsChecked = false; 701 | } 702 | 703 | /// 704 | /// Event that is fired when the MainWindow is closing 705 | /// 706 | /// The object that called this method 707 | /// The CancelEventArgs 708 | private void ChromelessWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) 709 | { 710 | try 711 | { 712 | Properties.Settings.Default.Save(); 713 | } 714 | catch (Exception ex) 715 | { 716 | MessageBox.Show(ex.Message, "AniView", MessageBoxButton.OK, MessageBoxImage.Error); 717 | } 718 | } 719 | } 720 | } 721 | -------------------------------------------------------------------------------- /AniView/Windows/SettingsWindow.xaml: -------------------------------------------------------------------------------- 1 |  13 | 14 | 15 | 16 | 17 | 18 | 21 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 89 | 90 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 |