├── .gitattributes
├── .github
├── dependabot.yml
└── workflows
│ └── codeql.yml
├── .gitignore
├── .gitmodules
├── CppProperties.json
├── ISSUE_TEMPLATE.md
├── LICENSE.md
├── README.md
├── SidebarDiagnostics.sln
├── SidebarDiagnostics
├── App.config
├── App.xaml
├── App.xaml.cs
├── ChangeLog.json
├── ChangeLog.xaml
├── ChangeLog.xaml.cs
├── ChangeLogModel.cs
├── Commands.cs
├── Constants.cs
├── Converters.cs
├── Dummy.xaml
├── Dummy.xaml.cs
├── FlatStyle.xaml
├── FlatStyle.xaml.cs
├── Graph.xaml
├── Graph.xaml.cs
├── GraphModel.cs
├── Monitoring.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.ar.Designer.cs
│ ├── Resources.ar.resx
│ ├── Resources.da.Designer.cs
│ ├── Resources.da.resx
│ ├── Resources.de-CH.Designer.cs
│ ├── Resources.de-CH.resx
│ ├── Resources.de.Designer.cs
│ ├── Resources.de.resx
│ ├── Resources.es.Designer.cs
│ ├── Resources.es.resx
│ ├── Resources.fi.Designer.cs
│ ├── Resources.fi.resx
│ ├── Resources.fr.Designer.cs
│ ├── Resources.fr.resx
│ ├── Resources.it.Designer.cs
│ ├── Resources.it.resx
│ ├── Resources.ja.Designer.cs
│ ├── Resources.ja.resx
│ ├── Resources.nl.Designer.cs
│ ├── Resources.nl.resx
│ ├── Resources.resx
│ ├── Resources.ru.Designer.cs
│ ├── Resources.ru.resx
│ ├── Resources.tr.resx
│ ├── Resources.zh.Designer.cs
│ ├── Resources.zh.resx
│ └── app.manifest
├── Settings.cs
├── Settings.ico
├── Settings.xaml
├── Settings.xaml.cs
├── SettingsModel.cs
├── Setup.xaml
├── Setup.xaml.cs
├── Sidebar.ico
├── Sidebar.xaml
├── Sidebar.xaml.cs
├── SidebarDiagnostics.csproj
├── SidebarModel.cs
├── Update.xaml
├── Update.xaml.cs
├── UpdateModel.cs
├── Utilities.cs
├── Windows.cs
└── packages.config
├── resharper.svg
└── sidebar.ico
/.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/dependabot.yml:
--------------------------------------------------------------------------------
1 | # To get started with Dependabot version updates, you'll need to specify which
2 | # package ecosystems to update and where the package manifests are located.
3 | # Please see the documentation for all configuration options:
4 | # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5 |
6 | version: 2
7 | updates:
8 | - package-ecosystem: "nuget"
9 | directory: "/"
10 | target-branch: "main"
11 | schedule:
12 | interval: "daily"
13 | - package-ecosystem: "github-actions"
14 | directory: "/"
15 | target-branch: "main"
16 | schedule:
17 | interval: "daily"
18 |
--------------------------------------------------------------------------------
/.github/workflows/codeql.yml:
--------------------------------------------------------------------------------
1 | # For most projects, this workflow file will not need changing; you simply need
2 | # to commit it to your repository.
3 | #
4 | # You may wish to alter this file to override the set of languages analyzed,
5 | # or to provide custom queries or build logic.
6 | #
7 | # ******** NOTE ********
8 | # We have attempted to detect the languages in your repository. Please check
9 | # the `language` matrix defined below to confirm you have the correct set of
10 | # supported CodeQL languages.
11 | #
12 | name: "CodeQL Advanced"
13 |
14 | on:
15 | push:
16 | branches: [ "master" ]
17 | pull_request:
18 | branches: [ "master" ]
19 | schedule:
20 | - cron: '19 20 * * 5'
21 |
22 | jobs:
23 | analyze:
24 | name: Analyze (${{ matrix.language }})
25 | # Runner size impacts CodeQL analysis time. To learn more, please see:
26 | # - https://gh.io/recommended-hardware-resources-for-running-codeql
27 | # - https://gh.io/supported-runners-and-hardware-resources
28 | # - https://gh.io/using-larger-runners (GitHub.com only)
29 | # Consider using larger runners or machines with greater resources for possible analysis time improvements.
30 | runs-on: ${{ matrix.language == 'swift' && 'macos-latest' || matrix.language == 'csharp' && 'windows-latest' || 'ubuntu-latest' }}
31 | permissions:
32 | # required for all workflows
33 | security-events: write
34 |
35 | # required to fetch internal or private CodeQL packs
36 | packages: read
37 |
38 | # only required for workflows in private repositories
39 | actions: read
40 | contents: read
41 |
42 | strategy:
43 | fail-fast: false
44 | matrix:
45 | include:
46 | - language: csharp
47 | build-mode: autobuild
48 | # CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
49 | # Use `c-cpp` to analyze code written in C, C++ or both
50 | # Use 'java-kotlin' to analyze code written in Java, Kotlin or both
51 | # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
52 | # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
53 | # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
54 | # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
55 | # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
56 | steps:
57 | - name: Checkout repository
58 | uses: actions/checkout@v4
59 | with:
60 | submodules: recursive
61 |
62 | # Add any setup steps before running the `github/codeql-action/init` action.
63 | # This includes steps like installing compilers or runtimes (`actions/setup-node`
64 | # or others). This is typically only required for manual builds.
65 | # - name: Setup runtime (example)
66 | # uses: actions/setup-example@v1
67 |
68 | # Initializes the CodeQL tools for scanning.
69 | - name: Initialize CodeQL
70 | uses: github/codeql-action/init@v3
71 | with:
72 | languages: csharp
73 | build-mode: autobuild
74 | # If you wish to specify custom queries, you can do so here or in a config file.
75 | # By default, queries listed here will override any specified in a config file.
76 | # Prefix the list here with "+" to use these queries and those in the config file.
77 |
78 | # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
79 | # queries: security-extended,security-and-quality
80 |
81 | # If the analyze step fails for one of the languages you are analyzing with
82 | # "We were unable to automatically build your code", modify the matrix above
83 | # to set the build mode to "manual" for that language. Then modify this step
84 | # to build your code.
85 | # ℹ️ Command-line programs to run using the OS shell.
86 | # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
87 | - if: matrix.build-mode == 'manual'
88 | shell: bash
89 | run: |
90 | echo 'If you are using a "manual" build mode for one or more of the' \
91 | 'languages you are analyzing, replace this with the commands to build' \
92 | 'your code, for example:'
93 | echo ' make bootstrap'
94 | echo ' make release'
95 | exit 1
96 |
97 | - name: Perform CodeQL Analysis
98 | uses: github/codeql-action/analyze@v3
99 | with:
100 | category: "/language:${{matrix.language}}"
101 |
--------------------------------------------------------------------------------
/.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 | x64/
19 | x86/
20 | build/
21 | bld/
22 | [Bb]in/
23 | [Oo]bj/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 |
28 | # MSTest test Results
29 | [Tt]est[Rr]esult*/
30 | [Bb]uild[Ll]og.*
31 |
32 | # NUNIT
33 | *.VisualState.xml
34 | TestResult.xml
35 |
36 | # Build Results of an ATL Project
37 | [Dd]ebugPS/
38 | [Rr]eleasePS/
39 | dlldata.c
40 |
41 | # DNX
42 | project.lock.json
43 | artifacts/
44 |
45 | *_i.c
46 | *_p.c
47 | *_i.h
48 | *.ilk
49 | *.meta
50 | *.obj
51 | *.pch
52 | *.pdb
53 | *.pgc
54 | *.pgd
55 | *.rsp
56 | *.sbr
57 | *.tlb
58 | *.tli
59 | *.tlh
60 | *.tmp
61 | *.tmp_proj
62 | *.log
63 | *.vspscc
64 | *.vssscc
65 | .builds
66 | *.pidb
67 | *.svclog
68 | *.scc
69 |
70 | # Chutzpah Test files
71 | _Chutzpah*
72 |
73 | # Visual C++ cache files
74 | ipch/
75 | *.aps
76 | *.ncb
77 | *.opensdf
78 | *.sdf
79 | *.cachefile
80 |
81 | # Visual Studio profiler
82 | *.psess
83 | *.vsp
84 | *.vspx
85 |
86 | # TFS 2012 Local Workspace
87 | $tf/
88 |
89 | # Guidance Automation Toolkit
90 | *.gpState
91 |
92 | # ReSharper is a .NET coding add-in
93 | _ReSharper*/
94 | *.[Rr]e[Ss]harper
95 | *.DotSettings.user
96 |
97 | # JustCode is a .NET coding add-in
98 | .JustCode
99 |
100 | # TeamCity is a build add-in
101 | _TeamCity*
102 |
103 | # DotCover is a Code Coverage Tool
104 | *.dotCover
105 |
106 | # NCrunch
107 | _NCrunch_*
108 | .*crunch*.local.xml
109 |
110 | # MightyMoose
111 | *.mm.*
112 | AutoTest.Net/
113 |
114 | # Web workbench (sass)
115 | .sass-cache/
116 |
117 | # Installshield output folder
118 | [Ee]xpress/
119 |
120 | # DocProject is a documentation generator add-in
121 | DocProject/buildhelp/
122 | DocProject/Help/*.HxT
123 | DocProject/Help/*.HxC
124 | DocProject/Help/*.hhc
125 | DocProject/Help/*.hhk
126 | DocProject/Help/*.hhp
127 | DocProject/Help/Html2
128 | DocProject/Help/html
129 |
130 | # Click-Once directory
131 | publish/
132 |
133 | # Publish Web Output
134 | *.[Pp]ublish.xml
135 | *.azurePubxml
136 | ## TODO: Comment the next line if you want to checkin your
137 | ## web deploy settings but do note that will include unencrypted
138 | ## passwords
139 | #*.pubxml
140 |
141 | *.publishproj
142 |
143 | # NuGet Packages
144 | *.nupkg
145 | # The packages folder can be ignored because of Package Restore
146 | **/packages/*
147 | # except build/, which is used as an MSBuild target.
148 | !**/packages/build/
149 | # Uncomment if necessary however generally it will be regenerated when needed
150 | #!**/packages/repositories.config
151 |
152 | # Windows Azure Build Output
153 | csx/
154 | *.build.csdef
155 |
156 | # Windows Store app package directory
157 | AppPackages/
158 |
159 | # Visual Studio cache files
160 | # files ending in .cache can be ignored
161 | *.[Cc]ache
162 | # but keep track of directories ending in .cache
163 | !*.[Cc]ache/
164 |
165 | # Others
166 | ClientBin/
167 | [Ss]tyle[Cc]op.*
168 | ~$*
169 | *~
170 | *.dbmdl
171 | *.dbproj.schemaview
172 | *.pfx
173 | *.publishsettings
174 | node_modules/
175 | orleans.codegen.cs
176 |
177 | # RIA/Silverlight projects
178 | Generated_Code/
179 |
180 | # Backup & report files from converting an old project file
181 | # to a newer Visual Studio version. Backup files are not needed,
182 | # because we have git ;-)
183 | _UpgradeReport_Files/
184 | Backup*/
185 | UpgradeLog*.XML
186 | UpgradeLog*.htm
187 |
188 | # SQL Server files
189 | *.mdf
190 | *.ldf
191 |
192 | # Business Intelligence projects
193 | *.rdl.data
194 | *.bim.layout
195 | *.bim_*.settings
196 |
197 | # Microsoft Fakes
198 | FakesAssemblies/
199 |
200 | # Node.js Tools for Visual Studio
201 | .ntvs_analysis.dat
202 |
203 | # Visual Studio 6 build log
204 | *.plg
205 |
206 | # Visual Studio 6 workspace options file
207 | *.opt
208 |
209 | # LightSwitch generated files
210 | GeneratedArtifacts/
211 | _Pvt_Extensions/
212 | ModelManifest.xml
213 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "LibreHardwareMonitor"]
2 | path = LibreHardwareMonitor
3 | url = https://github.com/LibreHardwareMonitor/LibreHardwareMonitor.git
4 |
--------------------------------------------------------------------------------
/CppProperties.json:
--------------------------------------------------------------------------------
1 | {
2 | "configurations": [
3 | {
4 | "inheritEnvironments": [
5 | "msvc_x64"
6 | ],
7 | "name": "x64-Release",
8 | "includePath": [
9 | "${env.INCLUDE}",
10 | "${workspaceRoot}\\**"
11 | ],
12 | "defines": [
13 | "WIN32",
14 | "NDEBUG",
15 | "UNICODE",
16 | "_UNICODE"
17 | ],
18 | "intelliSenseMode": "windows-msvc-x64"
19 | }
20 | ]
21 | }
--------------------------------------------------------------------------------
/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | **1. Is this a feature request?**
2 |
3 | *If yes then sorry but this project is not taking feature requests at this time.*
4 |
5 | **2. Your Operating System**
6 |
7 | **3. App Version**
8 |
9 | **4. Any Relevant Settings**
10 |
11 | **5. Steps to Reproduce**
12 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
Sidebar Diagnostics
2 |
3 | A simple sidebar for Windows desktop that displays hardware diagnostic information.
4 |
5 | ### Download
6 |
7 | Go to the releases tab.
8 |
9 | ### Features
10 | * Monitors CPU, RAM, GPU, network, and logical drives.
11 | * Create graphs for all metrics.
12 | * Allows for lots of customization.
13 | * Allows alerts for various values.
14 | * Allows binding hotkeys.
15 | * Supports monitors of all DPI types.
16 | * Has a clock at the top.
17 |
18 | ### Important
19 |
20 | If you are changing your screen's DPI settings, view this page!
21 |
22 | ### Author Note
23 |
24 | This software will always be free on GitHub. If you really like it please consider donating. I'd appreciate it!
25 | Thanks.
26 |
27 | https://www.paypal.me/arcaderenegade
28 |
29 | ### Supported OS
30 |
31 | * Windows 10
32 | * Windows 8.1
33 | * Windows 8
34 | * Windows 7
35 |
36 | ### License
37 |
38 | GNU GENERAL PUBLIC LICENSE
39 |
40 | Please provide a link to this GitHub repository if reuploading. Thank you.
41 |
42 | ### Info
43 |
44 | Written in C# .NET WPF.
45 |
46 | Currently compiled in .NET 4.7.2.
47 |
48 | You will need to run it as administrator.
49 |
50 | Data provided by Libre Hardware Monitor. Please thank the library's contributors for their support!
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/SidebarDiagnostics.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.29920.165
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SidebarDiagnostics", "SidebarDiagnostics\SidebarDiagnostics.csproj", "{A1174319-5065-453E-9864-9E7108419DDA}"
7 | EndProject
8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibreHardwareMonitorLib", "LibreHardwareMonitor\LibreHardwareMonitorLib\LibreHardwareMonitorLib.csproj", "{8C38AB06-AC1A-49A7-9683-5B4CA7FB0115}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {A1174319-5065-453E-9864-9E7108419DDA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {A1174319-5065-453E-9864-9E7108419DDA}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {A1174319-5065-453E-9864-9E7108419DDA}.Release|Any CPU.ActiveCfg = Release|Any CPU
19 | {A1174319-5065-453E-9864-9E7108419DDA}.Release|Any CPU.Build.0 = Release|Any CPU
20 | {8C38AB06-AC1A-49A7-9683-5B4CA7FB0115}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {8C38AB06-AC1A-49A7-9683-5B4CA7FB0115}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {8C38AB06-AC1A-49A7-9683-5B4CA7FB0115}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {8C38AB06-AC1A-49A7-9683-5B4CA7FB0115}.Release|Any CPU.Build.0 = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | GlobalSection(ExtensibilityGlobals) = postSolution
29 | SolutionGuid = {57150843-DDB4-488E-8A35-F34859E4DE57}
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/SidebarDiagnostics/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/SidebarDiagnostics/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Diagnostics;
5 | using System.Linq;
6 | using System.Net;
7 | using System.Threading.Tasks;
8 | using System.Reflection;
9 | using System.Windows;
10 | using System.Windows.Controls;
11 | using Squirrel;
12 | using Hardcodet.Wpf.TaskbarNotification;
13 | using SidebarDiagnostics.Monitoring;
14 | using SidebarDiagnostics.Utilities;
15 | using SidebarDiagnostics.Windows;
16 | using Xceed.Wpf.Toolkit;
17 |
18 | namespace SidebarDiagnostics
19 | {
20 | ///
21 | /// Interaction logic for App.xaml
22 | ///
23 | public partial class App : Application
24 | {
25 | protected async override void OnStartup(StartupEventArgs e)
26 | {
27 | base.OnStartup(e);
28 |
29 | // ERROR HANDLING
30 | #if !DEBUG
31 | AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(AppDomain_Error);
32 | #endif
33 |
34 | // LANGUAGE
35 | Culture.SetDefault();
36 | Culture.SetCurrent(true);
37 |
38 | // UPDATE
39 | #if !DEBUG
40 | if (Framework.Settings.Instance.AutoUpdate)
41 | {
42 | await AppUpdate(false);
43 | }
44 | #endif
45 |
46 | // SETTINGS
47 | CheckSettings();
48 |
49 | // VERSION
50 | Version _version = Assembly.GetExecutingAssembly().GetName().Version;
51 | string _vstring = _version.ToString(3);
52 |
53 | // TRAY ICON
54 | TrayIcon = (TaskbarIcon)FindResource("TrayIcon");
55 | TrayIcon.ToolTipText = string.Format("{0} v{1}", Framework.Resources.AppName, _vstring);
56 | TrayIcon.TrayContextMenuOpen += TrayIcon_TrayContextMenuOpen;
57 |
58 | // START APP
59 | if (Framework.Settings.Instance.InitialSetup)
60 | {
61 | new Setup();
62 | }
63 | else
64 | {
65 | StartApp(false);
66 | }
67 | }
68 |
69 | protected override void OnExit(ExitEventArgs e)
70 | {
71 | TrayIcon.Dispose();
72 |
73 | base.OnExit(e);
74 | }
75 |
76 | public static void StartApp(bool openSettings)
77 | {
78 | Version _version = Assembly.GetExecutingAssembly().GetName().Version;
79 | string _vstring = _version.ToString(3);
80 |
81 | if (!string.Equals(Framework.Settings.Instance.ChangeLog, _vstring, StringComparison.OrdinalIgnoreCase))
82 | {
83 | Framework.Settings.Instance.ChangeLog = _vstring;
84 | Framework.Settings.Instance.Save();
85 |
86 | new ChangeLog(_version).Show();
87 | }
88 |
89 | new Sidebar(openSettings, Framework.Settings.Instance.InitiallyHidden).Show();
90 |
91 | RefreshIcon();
92 | }
93 |
94 | public static void RefreshIcon()
95 | {
96 | TrayIcon.Visibility = Framework.Settings.Instance.ShowTrayIcon ? Visibility.Visible : Visibility.Collapsed;
97 | }
98 |
99 | public static void ShowPerformanceCounterError()
100 | {
101 | MessageBoxResult _result = System.Windows.MessageBox.Show(Framework.Resources.ErrorPerformanceCounter, Framework.Resources.ErrorTitle, MessageBoxButton.OKCancel, MessageBoxImage.Warning, MessageBoxResult.OK, MessageBoxOptions.DefaultDesktopOnly);
102 |
103 | if (_result == MessageBoxResult.OK)
104 | {
105 | Process.Start(ConfigurationManager.AppSettings["WikiURL"]);
106 | }
107 | }
108 |
109 | public void OpenSettings()
110 | {
111 | Settings _settings = Windows.OfType().FirstOrDefault();
112 |
113 | if (_settings != null)
114 | {
115 | _settings.WindowState = System.Windows.WindowState.Normal;
116 | _settings.Activate();
117 | return;
118 | }
119 |
120 | Sidebar _sidebar = Sidebar;
121 |
122 | if (_sidebar == null)
123 | {
124 | return;
125 | }
126 |
127 | new Settings(_sidebar);
128 | }
129 |
130 | public void OpenGraph()
131 | {
132 | Sidebar _sidebar = Sidebar;
133 |
134 | if (_sidebar == null || !_sidebar.Ready)
135 | {
136 | return;
137 | }
138 |
139 | new Graph(_sidebar);
140 | }
141 |
142 | private async Task AppUpdate(bool showInfo)
143 | {
144 | string _exe = await SquirrelUpdate(showInfo);
145 |
146 | if (_exe != null)
147 | {
148 | if (Framework.Settings.Instance.RunAtStartup)
149 | {
150 | Utilities.Startup.EnableStartupTask(_exe);
151 | }
152 |
153 | Process.Start(_exe);
154 |
155 | Shutdown();
156 | }
157 | }
158 |
159 | private async Task SquirrelUpdate(bool showInfo)
160 | {
161 | try
162 | {
163 | using (UpdateManager _manager = new UpdateManager(ConfigurationManager.AppSettings["CurrentReleaseURL"]))
164 | {
165 | UpdateInfo _update = await _manager.CheckForUpdate();
166 |
167 | if (_update.ReleasesToApply.Any())
168 | {
169 | Version _newVersion = _update.ReleasesToApply.OrderByDescending(r => r.Version).First().Version.Version;
170 |
171 | Update _updateWindow = new Update();
172 | _updateWindow.Show();
173 |
174 | await _manager.UpdateApp((p) => _updateWindow.SetProgress(p));
175 |
176 | _updateWindow.Close();
177 |
178 | return Utilities.Paths.Exe(_newVersion);
179 | }
180 | else if (showInfo)
181 | {
182 | System.Windows.MessageBox.Show(Framework.Resources.UpdateSuccessText, Framework.Resources.AppName, MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK, MessageBoxOptions.DefaultDesktopOnly);
183 | }
184 | }
185 | }
186 | catch (WebException)
187 | {
188 | if (showInfo)
189 | {
190 | System.Windows.MessageBox.Show(Framework.Resources.UpdateErrorText, Framework.Resources.UpdateErrorTitle, MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK, MessageBoxOptions.DefaultDesktopOnly);
191 | }
192 | }
193 | catch (Exception e)
194 | {
195 | Framework.Settings.Instance.AutoUpdate = false;
196 | Framework.Settings.Instance.Save();
197 |
198 | using (EventLog _log = new EventLog("Application"))
199 | {
200 | _log.Source = Framework.Resources.AppName;
201 | _log.WriteEntry(e.ToString(), EventLogEntryType.Error, 100, 1);
202 | }
203 |
204 | System.Windows.MessageBox.Show(Framework.Resources.UpdateErrorFatalText, Framework.Resources.UpdateErrorTitle, MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK, MessageBoxOptions.DefaultDesktopOnly);
205 | }
206 |
207 | return null;
208 | }
209 |
210 | private void CheckSettings()
211 | {
212 | if (Framework.Settings.Instance.RunAtStartup && !Utilities.Startup.StartupTaskExists())
213 | {
214 | Utilities.Startup.EnableStartupTask();
215 | }
216 |
217 | Framework.Settings.Instance.MonitorConfig = MonitorConfig.CheckConfig(Framework.Settings.Instance.MonitorConfig);
218 | }
219 |
220 | private void TrayIcon_TrayContextMenuOpen(object sender, RoutedEventArgs e)
221 | {
222 | Monitor _primary = Monitor.GetMonitors().GetPrimary();
223 |
224 | TrayIcon.ContextMenu.HorizontalOffset *= _primary.InverseScaleX;
225 | TrayIcon.ContextMenu.VerticalOffset *= _primary.InverseScaleY;
226 | }
227 |
228 | private void Settings_Click(object sender, EventArgs e)
229 | {
230 | OpenSettings();
231 | }
232 |
233 | private void Reload_Click(object sender, EventArgs e)
234 | {
235 | Sidebar _sidebar = Sidebar;
236 |
237 | if (_sidebar == null)
238 | {
239 | return;
240 | }
241 |
242 | _sidebar.Reload();
243 | }
244 |
245 | private void Graph_Click(object sender, EventArgs e)
246 | {
247 | OpenGraph();
248 | }
249 |
250 | private void Visibility_SubmenuOpened(object sender, EventArgs e)
251 | {
252 | Sidebar _sidebar = Sidebar;
253 |
254 | if (_sidebar == null)
255 | {
256 | return;
257 | }
258 |
259 | MenuItem _this = (MenuItem)sender;
260 |
261 | (_this.Items.GetItemAt(0) as MenuItem).IsChecked = _sidebar.Visibility == Visibility.Visible;
262 | (_this.Items.GetItemAt(1) as MenuItem).IsChecked = _sidebar.Visibility == Visibility.Hidden;
263 | }
264 |
265 | private void Show_Click(object sender, EventArgs e)
266 | {
267 | Sidebar _sidebar = Sidebar;
268 |
269 | if (_sidebar == null || _sidebar.Visibility == Visibility.Visible)
270 | {
271 | return;
272 | }
273 |
274 | _sidebar.AppBarShow();
275 | }
276 |
277 | private void Hide_Click(object sender, EventArgs e)
278 | {
279 | Sidebar _sidebar = Sidebar;
280 |
281 | if (_sidebar == null || _sidebar.Visibility == Visibility.Hidden)
282 | {
283 | return;
284 | }
285 |
286 | _sidebar.AppBarHide();
287 | }
288 |
289 | private void Donate_Click(object sender, RoutedEventArgs e)
290 | {
291 | Process.Start(ConfigurationManager.AppSettings["DonateURL"]);
292 | }
293 |
294 | private void GitHub_Click(object sender, RoutedEventArgs e)
295 | {
296 | Process.Start(ConfigurationManager.AppSettings["RepoURL"]);
297 | }
298 |
299 | private async void Update_Click(object sender, RoutedEventArgs e)
300 | {
301 | await AppUpdate(true);
302 | }
303 |
304 | private void Close_Click(object sender, EventArgs e)
305 | {
306 | Shutdown();
307 | }
308 |
309 | private static void AppDomain_Error(object sender, UnhandledExceptionEventArgs e)
310 | {
311 | Exception ex = (Exception)e.ExceptionObject;
312 |
313 | System.Windows.MessageBox.Show(ex.ToString(), Framework.Resources.ErrorTitle, MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK, MessageBoxOptions.DefaultDesktopOnly);
314 | }
315 |
316 | public Sidebar Sidebar
317 | {
318 | get
319 | {
320 | return Windows.OfType().FirstOrDefault();
321 | }
322 | }
323 |
324 | public IEnumerable Graphs
325 | {
326 | get
327 | {
328 | return Windows.OfType();
329 | }
330 | }
331 |
332 | public new static App Current
333 | {
334 | get
335 | {
336 | return (App)Application.Current;
337 | }
338 | }
339 |
340 | public static TaskbarIcon TrayIcon { get; set; }
341 |
342 | internal static bool _reloading { get; set; } = false;
343 | }
344 | }
--------------------------------------------------------------------------------
/SidebarDiagnostics/ChangeLog.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "Version": "3.6.3",
4 | "Changes": [
5 | "Updated Libre Hardware Monitor.",
6 | "Arabic language support."
7 | ]
8 | },
9 | {
10 | "Version": "3.6.2",
11 | "Changes": [
12 | "Fix GPU fan metric bug.",
13 | "Fix GPU VRAM load metric bug."
14 | ]
15 | },
16 | {
17 | "Version": "3.6.1",
18 | "Changes": [
19 | "Updated Libre Hardware Monitor.",
20 | "Fix GPU fan metric bug."
21 | ]
22 | },
23 | {
24 | "Version": "3.6.0",
25 | "Changes": [
26 | "Updated Libre Hardware Monitor."
27 | ]
28 | },
29 | {
30 | "Version": "3.5.9",
31 | "Changes": [
32 | "Updated Libre Hardware Monitor."
33 | ]
34 | },
35 | {
36 | "Version": "3.5.8",
37 | "Changes": [
38 | "Updated Libre Hardware Monitor."
39 | ]
40 | },
41 | {
42 | "Version": "3.5.7",
43 | "Changes": [
44 | "Updated Libre Hardware Monitor.",
45 | "i18n language updates (thank you contributors)."
46 | ]
47 | },
48 | {
49 | "Version": "3.5.6",
50 | "Changes": [
51 | "Updated Libre Hardware Monitor.",
52 | "Russian language support.",
53 | "Italian language support.",
54 | "Fix: AMD core chiplet dies temperature (Ryzen Master)"
55 | ]
56 | },
57 | {
58 | "Version": "3.5.5",
59 | "Changes": [
60 | "Bug fix for Ryzen CPU clock speed.",
61 | "Bug fix for AMD Video Card VRAM."
62 | ]
63 | },
64 | {
65 | "Version": "3.5.4",
66 | "Changes": [
67 | "Update to latest version of Libre Hardware Monitor.",
68 | "Bug fix for Ryzen CPU temperature.",
69 | "Thanks for the PR, @hirschmann!",
70 | "Also broke the auto-updater in the last version but it should work from now on.",
71 | "Sorry if you had to re-install!"
72 | ]
73 | },
74 | {
75 | "Version": "3.5.3",
76 | "Changes": [
77 | "Now uses Libre Hardware Monitor instead of Open Hardware Monitor for Ryzen support."
78 | ]
79 | },
80 | {
81 | "Version": "3.5.2",
82 | "Changes": [
83 | "Added an option to show the computer name at the top of the sidebar.",
84 | "Enable it in the settings under the customize tab.",
85 | "Disabled by default."
86 | ]
87 | },
88 | {
89 | "Version": "3.5.1",
90 | "Changes": [
91 | "Fix for high DPI monitors or settings.",
92 | "Fix for sidebar floating left or right."
93 | ]
94 | },
95 | {
96 | "Version": "3.5.0",
97 | "Changes": [
98 | "Updated to .NET framework v4.7.1.",
99 | "Updated dependencies."
100 | ]
101 | },
102 | {
103 | "Version": "3.4.6",
104 | "Changes": [
105 | "Updated to the latest version of Open Hardware Monitor.",
106 | "Updated dependencies."
107 | ]
108 | },
109 | {
110 | "Version": "3.4.5",
111 | "Changes": [
112 | "Updated to the latest version of Open Hardware Monitor with bugfix for Kaby Lake clock speed.",
113 | "The \"UI Scale\" setting now only affects the sidebar window.",
114 | "Hardware names should now update correctly after the hardware is changed.",
115 | "Unfortunately, this fix reset your custom hardware names but you can rename them back.",
116 | "The app should now correctly run on Windows startup for laptops running on battery power.",
117 | "All isatap network interfaces should be filtered now.",
118 | "Updated dependencies."
119 | ]
120 | },
121 | {
122 | "Version": "3.4.4",
123 | "Changes": [
124 | "Updated to the latest version of Open Hardware Monitor with Kaby Lake support.",
125 | "Updated dependencies."
126 | ]
127 | },
128 | {
129 | "Version": "3.4.3",
130 | "Changes": [
131 | "ISATAP (Intra-Site Automatic Tunnel Addressing Protocol) are now filtered via Regex from Network Adapters to monitor.",
132 | "Showing or toggling the sidebar will no longer cause it to activate or gain focus.",
133 | "The \"Show in Alt + Tab\" option has been renamed \"Toolbar Mode\".",
134 | "Enabling Toolbar Mode allows the sidebar to persist between Virtual Desktops and not show up in the Alt + Tab menu.",
135 | "Want to help translate? Please visit the GitHub wiki!"
136 | ]
137 | },
138 | {
139 | "Version": "3.4.2",
140 | "Changes": [
141 | "Added a network metric for external IP address, disabled by default.",
142 | "Be careful when sharing your desktop to not show your public IP address.",
143 | "Removed Virtual Desktop support due to incompatibilities and errors.",
144 | "If you want the sidebar to persist between different Virtual Desktops, you can disable the \"Show in Alt + Tab\" setting instead.",
145 | "Want to help translate? Please visit the GitHub wiki!"
146 | ]
147 | },
148 | {
149 | "Version": "3.4.1",
150 | "Changes": [
151 | "Fixed a bug where the default hardware name stayed the same after the hardware was replaced.",
152 | "Sidebar now remains visible during Aero peek.",
153 | "Added a new hotkey for toggling \"Reserve Space\".",
154 | "Fixed a bug where changes to hotkeys would not apply immediately after saving.",
155 | "Want to help translate? Please visit the GitHub wiki!"
156 | ]
157 | },
158 | {
159 | "Version": "3.4.0",
160 | "Changes": [
161 | "Fixed a crash when click-through is enabled with 32 bit Windows.",
162 | "Want to help translate? Please visit the GitHub wiki!"
163 | ]
164 | },
165 | {
166 | "Version": "3.3.9",
167 | "Changes": [
168 | "Added a setting to enable or disable Virtual Desktop support.",
169 | "Want to help translate? Please visit the GitHub wiki!"
170 | ]
171 | },
172 | {
173 | "Version": "3.3.8",
174 | "Changes": [
175 | "Added a metric for Network Adapter IPV4 address. Thanks dknedlik.",
176 | "Added a setting under advanced to hide the sidebar at startup.",
177 | "Want to help translate? Please visit the GitHub wiki!"
178 | ]
179 | },
180 | {
181 | "Version": "3.3.7",
182 | "Changes": [
183 | "Fixed a fatal error that occurred during auto-update.",
184 | "Added a setting to enable or disable \"Alert Blink\".",
185 | "Polling is now paused when the sidebar is hidden to reduce CPU usage.",
186 | "Want to help translate? Please visit the GitHub wiki!"
187 | ]
188 | },
189 | {
190 | "Version": "3.3.6",
191 | "Changes": [
192 | "Metric alerts now blink to be more conspicuous.",
193 | "Fixed a bug with the font size settings.",
194 | "Want to help translate? Please visit the GitHub wiki!"
195 | ]
196 | },
197 | {
198 | "Version": "3.3.5",
199 | "Changes": [
200 | "Fixed network bandwidth alerts.",
201 | "Want to help translate? Please visit the GitHub wiki!"
202 | ]
203 | },
204 | {
205 | "Version": "3.3.4",
206 | "Changes": [
207 | "Made the \"Show Desktop\" fix for when \"Always on Top\" is disabled to be more consistent.",
208 | "Want to help translate? Please visit the GitHub wiki!"
209 | ]
210 | },
211 | {
212 | "Version": "3.3.3",
213 | "Changes": [
214 | "Localization updates.",
215 | "Want to help translate? Please visit the GitHub wiki!"
216 | ]
217 | },
218 | {
219 | "Version": "3.3.2",
220 | "Changes": [
221 | "Added an option for \"Text Align\" right or left.",
222 | "Added complete localization for French and Chinese.",
223 | "Thanks @AlexandreBT and @Vassile-D.",
224 | "Want to help translate? Please visit the GitHub wiki!"
225 | ]
226 | },
227 | {
228 | "Version": "3.3.1",
229 | "Changes": [
230 | "Added the option to enable or disable specific metrics.",
231 | "Fixed a bug where charts for scaling metrics like bandwidth were incorrect.",
232 | "Finished preparing all text for localization.",
233 | "The complete Excel file of all text to be translated has been uploaded to the localization thread.",
234 | "Want to help translate? Please visit the GitHub wiki!"
235 | ]
236 | },
237 | {
238 | "Version": "3.3.0",
239 | "Changes": [
240 | "Added graphs.",
241 | "For performance reasons, graphs only store data while they are open. No historical data.",
242 | "Fixed French being missing in the Language dropdown."
243 | ]
244 | },
245 | {
246 | "Version": "3.2.1",
247 | "Changes": [
248 | "Fixed a bug where the sidebar would often freeze between updates.",
249 | "Fixed a bug with reserved space in Windows 7.",
250 | "Added an option for Language."
251 | ]
252 | },
253 | {
254 | "Version": "3.2.0",
255 | "Changes": [
256 | "Fixed all high DPI monitor issues.",
257 | "For real this time guys.",
258 | "Removed the \"High DPI Support\" option as it is now redundant.",
259 | "Please set your horizontal and vertical offset options back to 0.",
260 | "Added initial localization for Danish, Dutch, German, and Japanese.",
261 | "Want to help localize? Please visit the GitHub wiki!"
262 | ]
263 | },
264 | {
265 | "Version": "3.1.0",
266 | "Changes": [
267 | "Implemented initial French localization.",
268 | "Want to help localize? Please visit the GitHub wiki!",
269 | "Added error handling for when the app fails to update.",
270 | "Added a catch for an error involving virtual desktops."
271 | ]
272 | },
273 | {
274 | "Version": "3.0.8",
275 | "Changes": [
276 | "Added the option to show or hide the sidebar in Alt + Tab.",
277 | "Minor consistency changes."
278 | ]
279 | },
280 | {
281 | "Version": "3.0.7",
282 | "Changes": [
283 | "Fixed two issues that caused higher CPU usage than necessary.",
284 | "The settings.json file is now formatted and indented to make it easier to edit manually."
285 | ]
286 | },
287 | {
288 | "Version": "3.0.6",
289 | "Changes": [
290 | "Fixed a fatal error for Windows 8."
291 | ]
292 | },
293 | {
294 | "Version": "3.0.5",
295 | "Changes": [
296 | "Fixed the default monitor settings being in the reverse order.",
297 | "The sidebar will now reposition when the work area changes if \"Reserve Space\" is disabled.",
298 | "New version of the install and update framework."
299 | ]
300 | },
301 | {
302 | "Version": "3.0.4",
303 | "Changes": [
304 | "Fixed a bug where the sidebar would disappear when \"Show Desktop\" occurs.",
305 | "This was a tricky one. So please let me know if it works for you or not.",
306 | "Sorting monitors is now done via drag and drop.",
307 | "Added the ability to sort hardware via drag and drop.",
308 | "This created a bug where you have to double click the checkbox to enable or disable hardware.",
309 | "Working on a fix for that."
310 | ]
311 | },
312 | {
313 | "Version": "3.0.3",
314 | "Changes": [
315 | "Added a \"Auto Background Color\" option.",
316 | "This will set the sidebar's background color to your Windows color settings.",
317 | "Updated the icon for drives so it doesn't look like a speaker anymore.",
318 | "Added a change log window that pops up after updating.",
319 | "Minor bug fixes."
320 | ]
321 | }
322 | ]
323 |
--------------------------------------------------------------------------------
/SidebarDiagnostics/ChangeLog.xaml:
--------------------------------------------------------------------------------
1 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/SidebarDiagnostics/ChangeLog.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows;
3 | using SidebarDiagnostics.Models;
4 | using SidebarDiagnostics.Windows;
5 | using SidebarDiagnostics.Style;
6 |
7 | namespace SidebarDiagnostics
8 | {
9 | ///
10 | /// Interaction logic for ChangeLog.xaml
11 | ///
12 | public partial class ChangeLog : FlatWindow
13 | {
14 | public ChangeLog(Version version)
15 | {
16 | InitializeComponent();
17 |
18 | DataContext = Model = new ChangeLogModel(version);
19 | }
20 |
21 | private void Close_Click(object sender, RoutedEventArgs e)
22 | {
23 | Close();
24 | }
25 |
26 | public ChangeLogModel Model { get; private set; }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/SidebarDiagnostics/ChangeLogModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using System.IO;
4 | using System.Linq;
5 | using Newtonsoft.Json;
6 | using SidebarDiagnostics.Utilities;
7 | using SidebarDiagnostics.Framework;
8 |
9 | namespace SidebarDiagnostics.Models
10 | {
11 | public class ChangeLogModel : INotifyPropertyChanged
12 | {
13 | public ChangeLogModel(Version version)
14 | {
15 | string _vstring = version.ToString(3);
16 |
17 | Title = string.Format("{0} v{1}", Resources.ChangeLogTitle, _vstring);
18 |
19 | ChangeLogEntry _log = ChangeLogEntry.Load().FirstOrDefault(e => string.Equals(e.Version, _vstring, StringComparison.OrdinalIgnoreCase));
20 |
21 | if (_log != null)
22 | {
23 | Changes = _log.Changes;
24 | }
25 | else
26 | {
27 | Changes = new string[0];
28 | }
29 | }
30 |
31 | public void NotifyPropertyChanged(string propertyName)
32 | {
33 | if (PropertyChanged != null)
34 | {
35 | PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
36 | }
37 | }
38 |
39 | public event PropertyChangedEventHandler PropertyChanged;
40 |
41 | private string _title { get; set; }
42 |
43 | public string Title
44 | {
45 | get
46 | {
47 | return _title;
48 | }
49 | set
50 | {
51 | _title = value;
52 |
53 | NotifyPropertyChanged("Title");
54 | }
55 | }
56 |
57 | private string[] _changes { get; set; }
58 |
59 | public string[] Changes
60 | {
61 | get
62 | {
63 | return _changes;
64 | }
65 | set
66 | {
67 | _changes = value;
68 |
69 | NotifyPropertyChanged("Changes");
70 | }
71 | }
72 | }
73 |
74 | [JsonObject(MemberSerialization.OptIn)]
75 | public class ChangeLogEntry
76 | {
77 | public static ChangeLogEntry[] Load()
78 | {
79 | ChangeLogEntry[] _return = null;
80 |
81 | string _file = Paths.ChangeLog;
82 |
83 | if (File.Exists(_file))
84 | {
85 | using (StreamReader _reader = File.OpenText(_file))
86 | {
87 | _return = (ChangeLogEntry[])new JsonSerializer().Deserialize(_reader, typeof(ChangeLogEntry[]));
88 | }
89 | }
90 |
91 | return _return ?? new ChangeLogEntry[0];
92 | }
93 |
94 | [JsonProperty]
95 | public string Version { get; set; }
96 |
97 | [JsonProperty]
98 | public string[] Changes { get; set; }
99 | }
100 | }
101 |
--------------------------------------------------------------------------------
/SidebarDiagnostics/Commands.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Windows;
4 | using System.Windows.Input;
5 |
6 | namespace SidebarDiagnostics.Commands
7 | {
8 | public class ActivateCommand : ICommand
9 | {
10 | public void Execute(object parameter)
11 | {
12 | Sidebar _sidebar = App.Current.Sidebar;
13 |
14 | if (_sidebar == null)
15 | {
16 | return;
17 | }
18 |
19 | _sidebar.Activate();
20 | }
21 |
22 | public bool CanExecute(object parameter)
23 | {
24 | return true;
25 | }
26 |
27 | public event EventHandler CanExecuteChanged;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/SidebarDiagnostics/Constants.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace SidebarDiagnostics
3 | {
4 | public static class Constants
5 | {
6 | public static class Generic
7 | {
8 | public const string TASKNAME = "SidebarStartup";
9 | }
10 |
11 | public static class URLs
12 | {
13 | public const string IPIFY = "https://api.ipify.org";
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/SidebarDiagnostics/Converters.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 | using System.Windows;
4 | using System.Windows.Data;
5 | using System.Windows.Input;
6 | using SidebarDiagnostics.Windows;
7 |
8 | namespace SidebarDiagnostics.Converters
9 | {
10 | public class IntToStringConverter : IValueConverter
11 | {
12 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
13 | {
14 | string _format = (string)parameter;
15 |
16 | if (string.IsNullOrEmpty(_format))
17 | {
18 | return value.ToString();
19 | }
20 | else
21 | {
22 | return string.Format(culture, _format, value);
23 | }
24 | }
25 |
26 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
27 | {
28 | int _return = 0;
29 |
30 | int.TryParse(value.ToString(), out _return);
31 |
32 | return _return;
33 | }
34 | }
35 |
36 | public class HotkeyToStringConverter : IValueConverter
37 | {
38 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
39 | {
40 | Hotkey _hotkey = (Hotkey)value;
41 |
42 | if (_hotkey == null)
43 | {
44 | return "None";
45 | }
46 |
47 | return
48 | (_hotkey.AltMod ? "Alt + " : "") +
49 | (_hotkey.CtrlMod ? "Ctrl + " : "") +
50 | (_hotkey.ShiftMod ? "Shift + " : "") +
51 | (_hotkey.WinMod ? "Win + " : "") +
52 | new KeyConverter().ConvertToString(_hotkey.WinKey);
53 | }
54 |
55 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
56 | {
57 | return null;
58 | }
59 | }
60 |
61 | public class PercentConverter : IValueConverter
62 | {
63 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
64 | {
65 | double _value = (double)value;
66 |
67 | return string.Format("{0:0}%", _value);
68 | }
69 |
70 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
71 | {
72 | return null;
73 | }
74 | }
75 |
76 | public class BoolInverseConverter : IValueConverter
77 | {
78 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
79 | {
80 | return !(bool)value;
81 | }
82 |
83 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
84 | {
85 | return !(bool)value;
86 | }
87 | }
88 |
89 | public class MetricLabelConverter : IValueConverter
90 | {
91 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
92 | {
93 | string _value = (string)value;
94 |
95 | return string.Format("{0}:", _value);
96 | }
97 |
98 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
99 | {
100 | return null;
101 | }
102 | }
103 |
104 | public class FontToSpaceConverter : IValueConverter
105 | {
106 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
107 | {
108 | int _value = (int)value;
109 |
110 | return new Thickness(0, 0, _value * 0.4d, 0);
111 | }
112 |
113 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
114 | {
115 | return null;
116 | }
117 | }
118 | }
119 |
--------------------------------------------------------------------------------
/SidebarDiagnostics/Dummy.xaml:
--------------------------------------------------------------------------------
1 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/SidebarDiagnostics/Dummy.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Windows;
5 | using System.Windows.Threading;
6 | using SidebarDiagnostics.Windows;
7 |
8 | namespace SidebarDiagnostics
9 | {
10 | ///
11 | /// Interaction logic for Dummy.xaml
12 | ///
13 | public partial class Dummy : AppBarWindow
14 | {
15 | public Dummy(Setup setup)
16 | {
17 | InitializeComponent();
18 |
19 | Setup = setup;
20 | }
21 |
22 | public void Reposition()
23 | {
24 | Monitor.GetWorkArea(this, out int _screen, out DockEdge _edge, out WorkArea _initPos, out WorkArea _windowWA, out WorkArea _appbarWA);
25 |
26 | Move(_initPos);
27 |
28 | Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, (Action)(() =>
29 | {
30 | Move(_windowWA);
31 | }));
32 | }
33 |
34 | private void Window_Loaded(object sender, RoutedEventArgs e)
35 | {
36 | Reposition();
37 |
38 | Setup.Owner = this;
39 | Setup.ShowDialog();
40 | }
41 |
42 | private void Window_StateChanged(object sender, EventArgs e)
43 | {
44 | if (WindowState != WindowState.Normal)
45 | {
46 | WindowState = WindowState.Normal;
47 | }
48 | }
49 |
50 | public Setup Setup { get; private set; }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/SidebarDiagnostics/FlatStyle.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
32 |
33 |
34 |
35 |
42 |
43 |
50 |
51 |
58 |
59 |
74 |
75 |
155 |
156 |
187 |
188 |
192 |
193 |
201 |
202 |
206 |
207 |
215 |
216 |
220 |
221 |
229 |
230 |
234 |
235 |
244 |
245 |
251 |
--------------------------------------------------------------------------------
/SidebarDiagnostics/FlatStyle.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls;
3 | using System.Windows.Controls.Primitives;
4 |
5 | namespace SidebarDiagnostics.Style
6 | {
7 | public partial class FlatStyle : ResourceDictionary
8 | {
9 | public FlatStyle()
10 | {
11 | InitializeComponent();
12 | }
13 |
14 | private void PART_TITLEBAR_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
15 | {
16 | Border _titlebar = (Border)sender;
17 |
18 | if (_titlebar != null)
19 | {
20 | Window _window = Window.GetWindow(_titlebar);
21 |
22 | if (_window != null && _window.IsInitialized)
23 | {
24 | _window.DragMove();
25 | }
26 | }
27 | }
28 |
29 | private void PART_MINIMIZE_Click(object sender, RoutedEventArgs e)
30 | {
31 | Button _button = (Button)sender;
32 |
33 | if (_button != null)
34 | {
35 | Window _window = Window.GetWindow(_button);
36 |
37 | if (_window != null && _window.IsInitialized)
38 | {
39 | _window.WindowState = WindowState.Minimized;
40 | }
41 | }
42 | }
43 |
44 | private void PART_MAXIMIZE_RESTORE_Click(object sender, RoutedEventArgs e)
45 | {
46 | Button _button = (Button)sender;
47 |
48 | if (_button != null)
49 | {
50 | Window _window = Window.GetWindow(_button);
51 |
52 | if (_window != null && _window.IsInitialized)
53 | {
54 | switch (_window.WindowState)
55 | {
56 | case WindowState.Normal:
57 | _window.WindowState = WindowState.Maximized;
58 | break;
59 |
60 | case WindowState.Maximized:
61 | _window.WindowState = WindowState.Normal;
62 | break;
63 | }
64 | }
65 | }
66 | }
67 |
68 | private void PART_CLOSE_Click(object sender, RoutedEventArgs e)
69 | {
70 | Button _button = (Button)sender;
71 |
72 | if (_button != null)
73 | {
74 | Window _window = Window.GetWindow(_button);
75 |
76 | if (_window != null && _window.IsInitialized)
77 | {
78 | _window.Close();
79 | }
80 | }
81 | }
82 |
83 | private void PART_RESIZE_BOTRIGHT_DragDelta(object sender, DragDeltaEventArgs e)
84 | {
85 | Thumb _thumb = (Thumb)sender;
86 |
87 | if (_thumb != null)
88 | {
89 | Window _window = Window.GetWindow(_thumb);
90 |
91 | if (_window != null && _window.IsInitialized)
92 | {
93 | double _newWidth = _window.Width + e.HorizontalChange;
94 |
95 | if (_newWidth > 0)
96 | {
97 | _window.Width = _newWidth > _window.MinWidth ? _newWidth : _window.MinWidth;
98 | }
99 |
100 | double _newHeight = _window.Height + e.VerticalChange;
101 |
102 | if (_newHeight > 0)
103 | {
104 | _window.Height = _newHeight > _window.MinHeight ? _newHeight : _window.MinHeight;
105 | }
106 | }
107 | }
108 | }
109 | }
110 |
111 | public partial class FlatWindow : Window
112 | {
113 | public static readonly DependencyProperty ShowTitleBarProperty = DependencyProperty.Register("ShowTitleBar", typeof(bool), typeof(FlatWindow), new UIPropertyMetadata(true));
114 |
115 | public bool ShowTitleBar
116 | {
117 | get
118 | {
119 | return (bool)GetValue(ShowTitleBarProperty);
120 | }
121 | set
122 | {
123 | SetValue(ShowTitleBarProperty, value);
124 | }
125 | }
126 |
127 | public static readonly DependencyProperty ShowIconProperty = DependencyProperty.Register("ShowIcon", typeof(bool), typeof(FlatWindow), new UIPropertyMetadata(true));
128 |
129 | public bool ShowIcon
130 | {
131 | get
132 | {
133 | return (bool)GetValue(ShowIconProperty);
134 | }
135 | set
136 | {
137 | SetValue(ShowIconProperty, value);
138 | }
139 | }
140 |
141 | public static readonly DependencyProperty ShowTitleProperty = DependencyProperty.Register("ShowTitle", typeof(bool), typeof(FlatWindow), new UIPropertyMetadata(true));
142 |
143 | public bool ShowTitle
144 | {
145 | get
146 | {
147 | return (bool)GetValue(ShowTitleProperty);
148 | }
149 | set
150 | {
151 | SetValue(ShowTitleProperty, value);
152 | }
153 | }
154 |
155 | public static readonly DependencyProperty ShowCloseProperty = DependencyProperty.Register("ShowClose", typeof(bool), typeof(FlatWindow), new UIPropertyMetadata(true));
156 |
157 | public bool ShowClose
158 | {
159 | get
160 | {
161 | return (bool)GetValue(ShowCloseProperty);
162 | }
163 | set
164 | {
165 | SetValue(ShowCloseProperty, value);
166 | }
167 | }
168 |
169 | public static readonly DependencyProperty ShowMaximizeProperty = DependencyProperty.Register("ShowMaximize", typeof(bool), typeof(FlatWindow), new UIPropertyMetadata(true));
170 |
171 | public bool ShowMaximize
172 | {
173 | get
174 | {
175 | return (bool)GetValue(ShowMaximizeProperty);
176 | }
177 | set
178 | {
179 | SetValue(ShowMaximizeProperty, value);
180 | }
181 | }
182 |
183 | public static readonly DependencyProperty ShowMinimizeProperty = DependencyProperty.Register("ShowMinimize", typeof(bool), typeof(FlatWindow), new UIPropertyMetadata(true));
184 |
185 | public bool ShowMinimize
186 | {
187 | get
188 | {
189 | return (bool)GetValue(ShowMinimizeProperty);
190 | }
191 | set
192 | {
193 | SetValue(ShowMinimizeProperty, value);
194 | }
195 | }
196 | }
197 | }
198 |
--------------------------------------------------------------------------------
/SidebarDiagnostics/Graph.xaml:
--------------------------------------------------------------------------------
1 |
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 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/SidebarDiagnostics/Graph.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Input;
2 | using SidebarDiagnostics.Models;
3 | using SidebarDiagnostics.Windows;
4 | using System.ComponentModel;
5 | using SidebarDiagnostics.Style;
6 | using Xceed.Wpf.Toolkit;
7 | using OxyPlot.Wpf;
8 |
9 | namespace SidebarDiagnostics
10 | {
11 | ///
12 | /// Interaction logic for Graph.xaml
13 | ///
14 | public partial class Graph : FlatWindow
15 | {
16 | public Graph(Sidebar sidebar)
17 | {
18 | InitializeComponent();
19 |
20 | DataContext = Model = new GraphModel(OPGraph);
21 | Model.BindData(sidebar.Model.MonitorManager);
22 |
23 | Show();
24 | }
25 |
26 | private void Window_PreviewKeyDown(object sender, KeyEventArgs e)
27 | {
28 | if (e.Key == Key.Space)
29 | {
30 | OPGraph.ResetAllAxes();
31 | }
32 | }
33 |
34 | private void Window_Closing(object sender, CancelEventArgs e)
35 | {
36 | DataContext = null;
37 |
38 | if (Model != null)
39 | {
40 | Model.Dispose();
41 | Model = null;
42 | }
43 | }
44 |
45 | public GraphModel Model { get; private set; }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/SidebarDiagnostics/GraphModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using System.Collections.Generic;
4 | using System.Collections.ObjectModel;
5 | using System.Collections.Specialized;
6 | using System.Linq;
7 | using OxyPlot.Wpf;
8 | using SidebarDiagnostics.Framework;
9 | using SidebarDiagnostics.Monitoring;
10 |
11 | namespace SidebarDiagnostics.Models
12 | {
13 | public class GraphModel : INotifyPropertyChanged, IDisposable
14 | {
15 | public GraphModel(Plot plot)
16 | {
17 | _plot = plot;
18 | }
19 |
20 | public void Dispose()
21 | {
22 | Dispose(true);
23 | GC.SuppressFinalize(this);
24 | }
25 |
26 | protected virtual void Dispose(bool disposing)
27 | {
28 | if (!_disposed)
29 | {
30 | if (disposing)
31 | {
32 | _monitorItems = null;
33 | _monitor = null;
34 |
35 | _hardwareItems = null;
36 | _hardware = null;
37 |
38 | _metricItems = null;
39 |
40 | if (_metrics != null)
41 | {
42 | _metrics.CollectionChanged -= Metrics_CollectionChanged;
43 |
44 | foreach (iMetric _metric in _metrics)
45 | {
46 | _metric.PropertyChanged -= Metric_PropertyChanged;
47 | }
48 |
49 | _metrics = null;
50 | }
51 |
52 | _plot = null;
53 | _data = null;
54 | }
55 |
56 | _disposed = true;
57 | }
58 | }
59 |
60 | ~GraphModel()
61 | {
62 | Dispose(false);
63 | }
64 |
65 | public void BindData(MonitorManager manager)
66 | {
67 | BindMonitors(manager.MonitorPanels);
68 |
69 | ExpandConfig = true;
70 | }
71 |
72 | public void SetupPlot()
73 | {
74 | _data = new Dictionary>();
75 |
76 | _plot.Series.Clear();
77 |
78 | foreach (iMetric _metric in Metrics)
79 | {
80 | ObservableCollection _records = new ObservableCollection();
81 |
82 | _data.Add(_metric, _records);
83 |
84 | _metric.PropertyChanged += Metric_PropertyChanged;
85 |
86 | _plot.Series.Add(
87 | new LineSeries()
88 | {
89 | Title = _metric.FullName,
90 | TrackerFormatString = string.Format("{0}\r\n{{Value:#,##0.##}}{1}\r\n{{Recorded:T}}", _metric.FullName, _metric.nAppend),
91 | ItemsSource = _records,
92 | DataFieldX = "Recorded",
93 | DataFieldY = "Value"
94 | });
95 | }
96 | }
97 |
98 | public void NotifyPropertyChanged(string propertyName)
99 | {
100 | if (PropertyChanged != null)
101 | {
102 | PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
103 | }
104 | }
105 |
106 | public event PropertyChangedEventHandler PropertyChanged;
107 |
108 | private void BindMonitors(MonitorPanel[] panels)
109 | {
110 | MonitorItems = panels;
111 |
112 | if (panels.Length > 0)
113 | {
114 | Monitor = panels[0];
115 | }
116 | else
117 | {
118 | Monitor = null;
119 | }
120 | }
121 |
122 | private void BindHardware(iMonitor[] monitors)
123 | {
124 | HardwareItems = monitors;
125 |
126 | if (monitors.Length > 0)
127 | {
128 | Hardware = monitors[0];
129 | }
130 | else
131 | {
132 | Hardware = null;
133 | }
134 | }
135 |
136 | private void BindMetrics(iMetric[] metrics)
137 | {
138 | MetricItems = metrics;
139 | Metrics = new ObservableCollection();
140 | }
141 |
142 | private void Metrics_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
143 | {
144 | if (e.OldItems != null)
145 | {
146 | foreach (iMetric _metric in e.OldItems)
147 | {
148 | _metric.PropertyChanged -= Metric_PropertyChanged;
149 | }
150 | }
151 |
152 | SetupPlot();
153 | }
154 |
155 | private void Metric_PropertyChanged(object sender, PropertyChangedEventArgs e)
156 | {
157 | if (_disposed)
158 | {
159 | (sender as iMetric).PropertyChanged -= Metric_PropertyChanged;
160 | return;
161 | }
162 |
163 | if (e.PropertyName != "nValue")
164 | {
165 | return;
166 | }
167 |
168 | iMetric _metric = (iMetric)sender;
169 |
170 | if (_data == null || !_data.ContainsKey(_metric))
171 | {
172 | _metric.PropertyChanged -= Metric_PropertyChanged;
173 | return;
174 | }
175 |
176 | DateTime _now = DateTime.Now;
177 |
178 | try
179 | {
180 | ObservableCollection _mData = _data[_metric];
181 |
182 | foreach (MetricRecord _record in _mData.Where(r => (_now - r.Recorded).TotalSeconds > Duration).ToArray())
183 | {
184 | _mData.Remove(_record);
185 | }
186 |
187 | _mData.Add(new MetricRecord(_metric.nValue, _now));
188 | }
189 | catch
190 | {
191 | _metric.PropertyChanged -= Metric_PropertyChanged;
192 | }
193 | }
194 |
195 | private string _title { get; set; } = Resources.GraphTitle;
196 |
197 | public string Title
198 | {
199 | get
200 | {
201 | return _title;
202 | }
203 | set
204 | {
205 | _title = value;
206 |
207 | NotifyPropertyChanged("Title");
208 | }
209 | }
210 |
211 | private MonitorPanel[] _monitorItems { get; set; }
212 |
213 | public MonitorPanel[] MonitorItems
214 | {
215 | get
216 | {
217 | return _monitorItems;
218 | }
219 | set
220 | {
221 | _monitorItems = value;
222 |
223 | NotifyPropertyChanged("MonitorItems");
224 | }
225 | }
226 |
227 | private MonitorPanel _monitor { get; set; }
228 |
229 | public MonitorPanel Monitor
230 | {
231 | get
232 | {
233 | return _monitor;
234 | }
235 | set
236 | {
237 | _monitor = value;
238 |
239 | if (_monitor == null)
240 | {
241 | BindHardware(new iMonitor[0]);
242 | }
243 | else
244 | {
245 | BindHardware(_monitor.Monitors);
246 | }
247 |
248 | NotifyPropertyChanged("Monitor");
249 | }
250 | }
251 |
252 | private iMonitor[] _hardwareItems { get; set; }
253 |
254 | public iMonitor[] HardwareItems
255 | {
256 | get
257 | {
258 | return _hardwareItems;
259 | }
260 | set
261 | {
262 | _hardwareItems = value;
263 |
264 | NotifyPropertyChanged("HardwareItems");
265 | }
266 | }
267 |
268 | private iMonitor _hardware { get; set; }
269 |
270 | public iMonitor Hardware
271 | {
272 | get
273 | {
274 | return _hardware;
275 | }
276 | set
277 | {
278 | _hardware = value;
279 |
280 | if (_hardware == null)
281 | {
282 | BindMetrics(new iMetric[0]);
283 |
284 | Title = Resources.GraphTitle;
285 | }
286 | else
287 | {
288 | BindMetrics(_hardware.Metrics.Where(m => m.IsNumeric).ToArray());
289 |
290 | Title = string.Format("{0} - {1}", Resources.GraphTitle, _hardware.Name);
291 | }
292 |
293 | NotifyPropertyChanged("Hardware");
294 | }
295 | }
296 |
297 | private iMetric[] _metricItems { get; set; }
298 |
299 | public iMetric[] MetricItems
300 | {
301 | get
302 | {
303 | return _metricItems;
304 | }
305 | set
306 | {
307 | _metricItems = value;
308 |
309 | NotifyPropertyChanged("MetricItems");
310 | }
311 | }
312 |
313 | private ObservableCollection _metrics { get; set; }
314 |
315 | public ObservableCollection Metrics
316 | {
317 | get
318 | {
319 | return _metrics;
320 | }
321 | set
322 | {
323 | if (_metrics != null)
324 | {
325 | foreach (iMetric _metric in _metrics)
326 | {
327 | _metric.PropertyChanged -= Metric_PropertyChanged;
328 | }
329 | }
330 |
331 | _metrics = value;
332 |
333 | if (_metrics != null)
334 | {
335 | SetupPlot();
336 |
337 | _metrics.CollectionChanged += Metrics_CollectionChanged;
338 | }
339 |
340 | NotifyPropertyChanged("Metrics");
341 | }
342 | }
343 |
344 | public DurationItem[] DurationItems
345 | {
346 | get
347 | {
348 |
349 | return new DurationItem[5]
350 | {
351 | new DurationItem(15, string.Format("15 {0}", Resources.GraphDurationSeconds)),
352 | new DurationItem(30, string.Format("30 {0}", Resources.GraphDurationSeconds)),
353 | new DurationItem(60, string.Format("1 {0}", Resources.GraphDurationMinute)),
354 | new DurationItem(300, string.Format("5 {0}", Resources.GraphDurationMinutes)),
355 | new DurationItem(900, string.Format("15 {0}", Resources.GraphDurationMinutes))
356 | };
357 | }
358 | }
359 |
360 | private int _duration { get; set; } = 15;
361 |
362 | public int Duration
363 | {
364 | get
365 | {
366 | return _duration;
367 | }
368 | set
369 | {
370 | _duration = value;
371 |
372 | NotifyPropertyChanged("Duration");
373 | }
374 | }
375 |
376 | private bool _expandConfig { get; set; } = true;
377 |
378 | public bool ExpandConfig
379 | {
380 | get
381 | {
382 | return _expandConfig;
383 | }
384 | set
385 | {
386 | _expandConfig = value;
387 |
388 | NotifyPropertyChanged("ExpandConfig");
389 | }
390 | }
391 |
392 | private Plot _plot { get; set; }
393 |
394 | private Dictionary> _data { get; set; }
395 |
396 | private bool _disposed { get; set; } = false;
397 | }
398 |
399 | public class DurationItem
400 | {
401 | public DurationItem(int seconds, string text)
402 | {
403 | Seconds = seconds;
404 | Text = text;
405 | }
406 |
407 | public int Seconds { get; set; }
408 |
409 | public string Text { get; set; }
410 | }
411 |
412 | public class MetricRecord
413 | {
414 | public MetricRecord(double value, DateTime recorded)
415 | {
416 | Value = value > 0 ? value : 0.001d;
417 | Recorded = recorded;
418 | }
419 |
420 | public double Value { get; set; }
421 |
422 | public DateTime Recorded { get; set; }
423 | }
424 | }
425 |
--------------------------------------------------------------------------------
/SidebarDiagnostics/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | [assembly: AssemblyTitle("Sidebar Diagnostics")]
11 | [assembly: AssemblyDescription("Sidebar Diagnostics")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("Sidebar Diagnostics")]
14 | [assembly: AssemblyProduct("Sidebar Diagnostics")]
15 | [assembly: AssemblyCopyright("Copyright © 2021")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 |
19 | // Setting ComVisible to false makes the types in this assembly not visible
20 | // to COM components. If you need to access a type in this assembly from
21 | // COM, set the ComVisible attribute to true on that type.
22 | [assembly: ComVisible(false)]
23 |
24 | //In order to begin building localizable applications, set
25 | //CultureYouAreCodingWith in your .csproj file
26 | //inside a . For example, if you are using US english
27 | //in your source files, set the to en-US. Then uncomment
28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
29 | //the line below to match the UICulture setting in the project file.
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36 | //(used if a resource is not found in the page,
37 | // or application resource dictionaries)
38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39 | //(used if a resource is not found in the page,
40 | // app, or any theme specific resource dictionaries)
41 | )]
42 |
43 |
44 | // Version information for an assembly consists of the following four values:
45 | //
46 | // Major Version
47 | // Minor Version
48 | // Build Number
49 | // Revision
50 | //
51 | // You can specify all the values or you can default the Build and Revision Numbers
52 | // by using the '*' as shown below:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 | [assembly: AssemblyVersion("3.6.3.0")]
55 | [assembly: AssemblyFileVersion("3.6.3.0")]
56 |
--------------------------------------------------------------------------------
/SidebarDiagnostics/Properties/Resources.ar.Designer.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thewriteway/SidebarDiagnostics/a9a417f757737ba63f2ccd7fafb7bf13c193ef33/SidebarDiagnostics/Properties/Resources.ar.Designer.cs
--------------------------------------------------------------------------------
/SidebarDiagnostics/Properties/Resources.da.Designer.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thewriteway/SidebarDiagnostics/a9a417f757737ba63f2ccd7fafb7bf13c193ef33/SidebarDiagnostics/Properties/Resources.da.Designer.cs
--------------------------------------------------------------------------------
/SidebarDiagnostics/Properties/Resources.de-CH.Designer.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thewriteway/SidebarDiagnostics/a9a417f757737ba63f2ccd7fafb7bf13c193ef33/SidebarDiagnostics/Properties/Resources.de-CH.Designer.cs
--------------------------------------------------------------------------------
/SidebarDiagnostics/Properties/Resources.de.Designer.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thewriteway/SidebarDiagnostics/a9a417f757737ba63f2ccd7fafb7bf13c193ef33/SidebarDiagnostics/Properties/Resources.de.Designer.cs
--------------------------------------------------------------------------------
/SidebarDiagnostics/Properties/Resources.de.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 | Sidebar Diagnostik
122 | Name of the app
123 |
124 |
125 | Schließen
126 | Close app taskbar menu item
127 |
128 |
129 | CPU
130 | CPU monitor title
131 |
132 |
133 | Takt
134 | Full name for CPU clock metric
135 |
136 |
137 | Takt
138 | Short label for CPU clock metric
139 |
140 |
141 | Core Clock
142 | Full name for CPU core clock metric
143 |
144 |
145 | Kern
146 | Short label for CPU core clock metric
147 |
148 |
149 | Core Load
150 | Full name for CPU core load metric
151 |
152 |
153 | Kern
154 | Short label for CPU core load metric
155 |
156 |
157 | Lüfter
158 | Full name for CPU fan metric
159 |
160 |
161 | Lüfter
162 | Short label for CPU fan metric
163 |
164 |
165 | Auslastung
166 | Full name for CPU load metric
167 |
168 |
169 | Auslastung
170 | Short label for CPU load metric
171 |
172 |
173 | Temperature
174 | Full name for CPU temp metric
175 |
176 |
177 | Temp
178 | Short label for CPU temp metric
179 |
180 |
181 | Spannung
182 | Full name for CPU voltage metric
183 |
184 |
185 | Spannung
186 | Short label for CPU voltage metric
187 |
188 |
189 | Spenden
190 | Donate taskbar menu item
191 |
192 |
193 | Frei
194 | Full name for drive free metric
195 |
196 |
197 | Frei
198 | Short label for drive free metric
199 |
200 |
201 | Auslastung
202 | Full name for drive load metric
203 |
204 |
205 | Load Bar
206 | Full name for drive load bar metric
207 |
208 |
209 | Auslastung
210 | Short label for drive load bar metric
211 |
212 |
213 | Auslastung
214 | Short label for drive load metric
215 |
216 |
217 | Read Rate
218 | Full name for drive read metric
219 |
220 |
221 | Lesen
222 | Short label for drive read metric
223 |
224 |
225 | Festplatten
226 | Drives monitor title
227 |
228 |
229 | Belegt
230 | Full name for drive used metric
231 |
232 |
233 | Belegt
234 | Short label for drive used metric
235 |
236 |
237 | Write Rate
238 | Full name for drive write metric
239 |
240 |
241 | Schreiben
242 | Short label for drive write metric
243 |
244 |
245 | GitHub
246 | GitHub taskbar menu item
247 |
248 |
249 | Grafikkarte
250 | GPU monitor title
251 |
252 |
253 | Core Clock
254 | Full name for GPU core clock metric
255 |
256 |
257 | Kern
258 | Short label for RAM core clock metric
259 |
260 |
261 | Core Load
262 | Full name for GPU core load metric
263 |
264 |
265 | Kern
266 | Short label for GPU core load metric
267 |
268 |
269 | Lüfter
270 | Full name for GPU fan metric
271 |
272 |
273 | Lüfter
274 | Short label for GPU voltage metric
275 |
276 |
277 | Temperature
278 | Full name for GPU temp metric
279 |
280 |
281 | Temp
282 | Short label for GPU temp metric
283 |
284 |
285 | Spannung
286 | Full name for GPU voltage metric
287 |
288 |
289 | Spannung
290 | Short label for GPU voltage metric
291 |
292 |
293 | VRAM Clock
294 | Full name for GPU VRAM clock metric
295 |
296 |
297 | VRAM
298 | Short label for GPU VRAM clock metric
299 |
300 |
301 | VRAM Load
302 | Full name for GPU VRAM load metric
303 |
304 |
305 | VRAM
306 | Short label for GPU VRAM load metric
307 |
308 |
309 | Graph
310 | Graph taskbar menu item
311 |
312 |
313 | Verstecken
314 | Hide taskbar menu item
315 |
316 |
317 | Netzwerk
318 | Network monitor title
319 |
320 |
321 | Bandwidth In
322 | Full name for network in metric
323 |
324 |
325 | Ein
326 | Short label for network in metric
327 |
328 |
329 | Bandwidth Out
330 | Full name for network out metric
331 |
332 |
333 | Aus
334 | Short label for network out metric
335 |
336 |
337 | RAM
338 | RAM monitor title
339 |
340 |
341 | Takt
342 | Full name for RAM clock metric
343 |
344 |
345 | Takt
346 | Short label for RAM clock metric
347 |
348 |
349 | Frei
350 | Full name for RAM free metric
351 |
352 |
353 | Frei
354 | Short label for RAM free metric
355 |
356 |
357 | Auslastung
358 | Full name for RAM load metric
359 |
360 |
361 | Auslastung
362 | Short label for RAM load metric
363 |
364 |
365 | Belegt
366 | Full name for RAM load metric
367 |
368 |
369 | Belegt
370 | Short label for RAM used metric
371 |
372 |
373 | Spannung
374 | Full name for RAM voltage metric
375 |
376 |
377 | Spannung
378 | Short label for RAM voltage metric
379 |
380 |
381 | Neuladen
382 | Reload taskbar menu item
383 |
384 |
385 | Einstellungen
386 | Settings taskbar menu item
387 |
388 |
389 | Anzeigen
390 | Show taskbar menu item
391 |
392 |
393 | Sidebar
394 | Title of the sidebar window
395 |
396 |
397 | Uhrzeit
398 | Sidebar clock title
399 |
400 |
401 | Update
402 | Update taskbar menu item
403 |
404 |
405 | Sichtbarkeit
406 | Visibility taskbar menu item
407 |
408 |
--------------------------------------------------------------------------------
/SidebarDiagnostics/Properties/Resources.es.Designer.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thewriteway/SidebarDiagnostics/a9a417f757737ba63f2ccd7fafb7bf13c193ef33/SidebarDiagnostics/Properties/Resources.es.Designer.cs
--------------------------------------------------------------------------------
/SidebarDiagnostics/Properties/Resources.fi.Designer.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thewriteway/SidebarDiagnostics/a9a417f757737ba63f2ccd7fafb7bf13c193ef33/SidebarDiagnostics/Properties/Resources.fi.Designer.cs
--------------------------------------------------------------------------------
/SidebarDiagnostics/Properties/Resources.fr.Designer.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thewriteway/SidebarDiagnostics/a9a417f757737ba63f2ccd7fafb7bf13c193ef33/SidebarDiagnostics/Properties/Resources.fr.Designer.cs
--------------------------------------------------------------------------------
/SidebarDiagnostics/Properties/Resources.it.Designer.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thewriteway/SidebarDiagnostics/a9a417f757737ba63f2ccd7fafb7bf13c193ef33/SidebarDiagnostics/Properties/Resources.it.Designer.cs
--------------------------------------------------------------------------------
/SidebarDiagnostics/Properties/Resources.ja.Designer.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thewriteway/SidebarDiagnostics/a9a417f757737ba63f2ccd7fafb7bf13c193ef33/SidebarDiagnostics/Properties/Resources.ja.Designer.cs
--------------------------------------------------------------------------------
/SidebarDiagnostics/Properties/Resources.ja.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 | Sidebar Diagnostics
122 | Name of the app
123 |
124 |
125 | 閉じる
126 | Close app taskbar menu item
127 |
128 |
129 | CPU
130 | CPU monitor title
131 |
132 |
133 | CPUクロック
134 | Full name for CPU clock metric
135 |
136 |
137 | 速度
138 | Short label for CPU clock metric
139 |
140 |
141 | Core Clock
142 | Full name for CPU core clock metric
143 |
144 |
145 | コア
146 | Short label for CPU core clock metric
147 |
148 |
149 | Core Load
150 | Full name for CPU core load metric
151 |
152 |
153 | コア
154 | Short label for CPU core load metric
155 |
156 |
157 | Fan Usage
158 | Full name for CPU fan metric
159 |
160 |
161 | ファン
162 | Short label for CPU fan metric
163 |
164 |
165 | 負荷
166 | Full name for CPU load metric
167 |
168 |
169 | 負荷
170 | Short label for CPU load metric
171 |
172 |
173 | 温度
174 | Full name for CPU temp metric
175 |
176 |
177 | 温度
178 | Short label for CPU temp metric
179 |
180 |
181 | 電圧
182 | Full name for CPU voltage metric
183 |
184 |
185 | 電圧
186 | Short label for CPU voltage metric
187 |
188 |
189 | 寄付する
190 | Donate taskbar menu item
191 |
192 |
193 | 空き容量
194 | Full name for drive free metric
195 |
196 |
197 | 空き容量
198 | Short label for drive free metric
199 |
200 |
201 | 使用率
202 | Full name for drive load metric
203 |
204 |
205 | Load Bar
206 | Full name for drive load bar metric
207 |
208 |
209 | 使用率
210 | Short label for drive load bar metric
211 |
212 |
213 | 使用率
214 | Short label for drive load metric
215 |
216 |
217 | 読み込み
218 | Full name for drive read metric
219 |
220 |
221 | 読み込み
222 | Short label for drive read metric
223 |
224 |
225 | ドライブ
226 | Drives monitor title
227 |
228 |
229 | 使用量
230 | Full name for drive used metric
231 |
232 |
233 | 使用量
234 | Short label for drive used metric
235 |
236 |
237 | 書き込み
238 | Full name for drive write metric
239 |
240 |
241 | 書き込み
242 | Short label for drive write metric
243 |
244 |
245 | GitHub
246 | GitHub taskbar menu item
247 |
248 |
249 | GPU
250 | GPU monitor title
251 |
252 |
253 | Core Clock
254 | Full name for GPU core clock metric
255 |
256 |
257 | コア
258 | Short label for RAM core clock metric
259 |
260 |
261 | Core Load
262 | Full name for GPU core load metric
263 |
264 |
265 | コア
266 | Short label for GPU core load metric
267 |
268 |
269 | ファン
270 | Full name for GPU fan metric
271 |
272 |
273 | ファン
274 | Short label for GPU voltage metric
275 |
276 |
277 | 温度
278 | Full name for GPU temp metric
279 |
280 |
281 | 温度
282 | Short label for GPU temp metric
283 |
284 |
285 | 電圧
286 | Full name for GPU voltage metric
287 |
288 |
289 | 電圧
290 | Short label for GPU voltage metric
291 |
292 |
293 | VRAM Clock
294 | Full name for GPU VRAM clock metric
295 |
296 |
297 | Vメモリ
298 | Short label for GPU VRAM clock metric
299 |
300 |
301 | VRAM Load
302 | Full name for GPU VRAM load metric
303 |
304 |
305 | Vメモリ
306 | Short label for GPU VRAM load metric
307 |
308 |
309 | Graph
310 | Graph taskbar menu item
311 |
312 |
313 | 隠す
314 | Hide taskbar menu item
315 |
316 |
317 | ネットワーク
318 | Network monitor title
319 |
320 |
321 | 受信
322 | Full name for network in metric
323 |
324 |
325 | 受信
326 | Short label for network in metric
327 |
328 |
329 | 送信
330 | Full name for network out metric
331 |
332 |
333 | 送信
334 | Short label for network out metric
335 |
336 |
337 | メモリ
338 | RAM monitor title
339 |
340 |
341 | 速度
342 | Full name for RAM clock metric
343 |
344 |
345 | 速度
346 | Short label for RAM clock metric
347 |
348 |
349 | 利用可能
350 | Full name for RAM free metric
351 |
352 |
353 | 利用可能
354 | Short label for RAM free metric
355 |
356 |
357 | 使用率
358 | Full name for RAM load metric
359 |
360 |
361 | 使用率
362 | Short label for RAM load metric
363 |
364 |
365 | 使用量
366 | Full name for RAM load metric
367 |
368 |
369 | 使用量
370 | Short label for RAM used metric
371 |
372 |
373 | 電圧
374 | Full name for RAM voltage metric
375 |
376 |
377 | 電圧
378 | Short label for RAM voltage metric
379 |
380 |
381 | 再読み込み
382 | Reload taskbar menu item
383 |
384 |
385 | 設定
386 | Settings taskbar menu item
387 |
388 |
389 | show
390 | Show taskbar menu item
391 |
392 |
393 | サイドバー
394 | Title of the sidebar window
395 |
396 |
397 | 時間
398 | Sidebar clock title
399 |
400 |
401 | アップデート
402 | Update taskbar menu item
403 |
404 |
405 | 表示方法
406 | Visibility taskbar menu item
407 |
408 |
409 |
--------------------------------------------------------------------------------
/SidebarDiagnostics/Properties/Resources.nl.Designer.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thewriteway/SidebarDiagnostics/a9a417f757737ba63f2ccd7fafb7bf13c193ef33/SidebarDiagnostics/Properties/Resources.nl.Designer.cs
--------------------------------------------------------------------------------
/SidebarDiagnostics/Properties/Resources.nl.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 | Sidebar Diagnostics
122 | Name of the app
123 |
124 |
125 | Afsluiten
126 | Close app taskbar menu item
127 |
128 |
129 | CPU
130 | CPU monitor title
131 |
132 |
133 | Klok
134 | Full name for CPU clock metric
135 |
136 |
137 | Klok
138 | Short label for CPU clock metric
139 |
140 |
141 | Core Clock
142 | Full name for CPU core clock metric
143 |
144 |
145 | Kern
146 | Short label for CPU core clock metric
147 |
148 |
149 | Core Load
150 | Full name for CPU core load metric
151 |
152 |
153 | Kern
154 | Short label for CPU core load metric
155 |
156 |
157 | Fan Usage
158 | Full name for CPU fan metric
159 |
160 |
161 | Ventilator
162 | Short label for CPU fan metric
163 |
164 |
165 | Load
166 | Full name for CPU load metric
167 |
168 |
169 | Gebruik
170 | Short label for CPU load metric
171 |
172 |
173 | Temperature
174 | Full name for CPU temp metric
175 |
176 |
177 | Temp
178 | Short label for CPU temp metric
179 |
180 |
181 | Voltage
182 | Full name for CPU voltage metric
183 |
184 |
185 | Voltage
186 | Short label for CPU voltage metric
187 |
188 |
189 | Doneer
190 | Donate taskbar menu item
191 |
192 |
193 | Beschikbaar
194 | Full name for drive free metric
195 |
196 |
197 | Beschikbaar
198 | Short label for drive free metric
199 |
200 |
201 | Gebruik
202 | Full name for drive load metric
203 |
204 |
205 | Load Bar
206 | Full name for drive load bar metric
207 |
208 |
209 | Gebruik
210 | Short label for drive load bar metric
211 |
212 |
213 | Gebruik
214 | Short label for drive load metric
215 |
216 |
217 | Read Rate
218 | Full name for drive read metric
219 |
220 |
221 | Lezen
222 | Short label for drive read metric
223 |
224 |
225 | Opslag
226 | Drives monitor title
227 |
228 |
229 | In Gebruik
230 | Full name for drive used metric
231 |
232 |
233 | In Gebruik
234 | Short label for drive used metric
235 |
236 |
237 | Write Rate
238 | Full name for drive write metric
239 |
240 |
241 | Schrijven
242 | Short label for drive write metric
243 |
244 |
245 | GitHub
246 | GitHub taskbar menu item
247 |
248 |
249 | GPU
250 | GPU monitor title
251 |
252 |
253 | Core Clock
254 | Full name for GPU core clock metric
255 |
256 |
257 | Kern
258 | Short label for RAM core clock metric
259 |
260 |
261 | Core Load
262 | Full name for GPU core load metric
263 |
264 |
265 | Kern
266 | Short label for GPU core load metric
267 |
268 |
269 | Fan Usage
270 | Full name for GPU fan metric
271 |
272 |
273 | Ventilator
274 | Short label for GPU voltage metric
275 |
276 |
277 | Temperature
278 | Full name for GPU temp metric
279 |
280 |
281 | Temp
282 | Short label for GPU temp metric
283 |
284 |
285 | Voltage
286 | Full name for GPU voltage metric
287 |
288 |
289 | Voltage
290 | Short label for GPU voltage metric
291 |
292 |
293 | VRAM Clock
294 | Full name for GPU VRAM clock metric
295 |
296 |
297 | VRAM
298 | Short label for GPU VRAM clock metric
299 |
300 |
301 | VRAM Load
302 | Full name for GPU VRAM load metric
303 |
304 |
305 | VRAM
306 | Short label for GPU VRAM load metric
307 |
308 |
309 | Graph
310 | Graph taskbar menu item
311 |
312 |
313 | Verbergen
314 | Hide taskbar menu item
315 |
316 |
317 | Netwerk
318 | Network monitor title
319 |
320 |
321 | Bandwidth In
322 | Full name for network in metric
323 |
324 |
325 | In
326 | Short label for network in metric
327 |
328 |
329 | Bandwidth Out
330 | Full name for network out metric
331 |
332 |
333 | Uit
334 | Short label for network out metric
335 |
336 |
337 | RAM
338 | RAM monitor title
339 |
340 |
341 | Klok
342 | Full name for RAM clock metric
343 |
344 |
345 | Klok
346 | Short label for RAM clock metric
347 |
348 |
349 | Beschikbaar
350 | Full name for RAM free metric
351 |
352 |
353 | Beschikbaar
354 | Short label for RAM free metric
355 |
356 |
357 | Gebruik
358 | Full name for RAM load metric
359 |
360 |
361 | Gebruik
362 | Short label for RAM load metric
363 |
364 |
365 | In Gebruik
366 | Full name for RAM load metric
367 |
368 |
369 | In Gebruik
370 | Short label for RAM used metric
371 |
372 |
373 | Voltage
374 | Full name for RAM voltage metric
375 |
376 |
377 | Voltage
378 | Short label for RAM voltage metric
379 |
380 |
381 | Ververs
382 | Reload taskbar menu item
383 |
384 |
385 | Zijbalk
386 | Settings taskbar menu item
387 |
388 |
389 | Tonen
390 | Show taskbar menu item
391 |
392 |
393 | Sidebar
394 | Title of the sidebar window
395 |
396 |
397 | Tijd
398 | Sidebar clock title
399 |
400 |
401 | Bijwerken
402 | Update taskbar menu item
403 |
404 |
405 | Zichtbaarheid
406 | Visibility taskbar menu item
407 |
408 |
--------------------------------------------------------------------------------
/SidebarDiagnostics/Properties/Resources.ru.Designer.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thewriteway/SidebarDiagnostics/a9a417f757737ba63f2ccd7fafb7bf13c193ef33/SidebarDiagnostics/Properties/Resources.ru.Designer.cs
--------------------------------------------------------------------------------
/SidebarDiagnostics/Properties/Resources.zh.Designer.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thewriteway/SidebarDiagnostics/a9a417f757737ba63f2ccd7fafb7bf13c193ef33/SidebarDiagnostics/Properties/Resources.zh.Designer.cs
--------------------------------------------------------------------------------
/SidebarDiagnostics/Properties/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | true/PM
33 |
34 |
35 |
--------------------------------------------------------------------------------
/SidebarDiagnostics/Settings.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thewriteway/SidebarDiagnostics/a9a417f757737ba63f2ccd7fafb7bf13c193ef33/SidebarDiagnostics/Settings.ico
--------------------------------------------------------------------------------
/SidebarDiagnostics/Settings.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using System.Linq;
4 | using System.Text.RegularExpressions;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls.Primitives;
8 | using System.Windows.Input;
9 | using System.Windows.Threading;
10 | using SidebarDiagnostics.Models;
11 | using SidebarDiagnostics.Windows;
12 | using SidebarDiagnostics.Style;
13 | using Xceed.Wpf.Toolkit;
14 |
15 | namespace SidebarDiagnostics
16 | {
17 | ///
18 | /// Interaction logic for Settings.xaml
19 | ///
20 | public partial class Settings : FlatWindow
21 | {
22 | public Settings(Sidebar sidebar)
23 | {
24 | InitializeComponent();
25 |
26 | DataContext = Model = new SettingsModel(sidebar);
27 |
28 | Owner = sidebar;
29 | ShowDialog();
30 | }
31 |
32 | private async Task Save(bool finalize)
33 | {
34 | Model.Save();
35 |
36 | await App.Current.Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, (Action)(async () =>
37 | {
38 | Sidebar _sidebar = App.Current.Sidebar;
39 |
40 | if (_sidebar == null)
41 | {
42 | return;
43 | }
44 |
45 | await _sidebar.Reset(finalize);
46 | }));
47 | }
48 |
49 | private void NumberBox_PreviewTextInput(object sender, TextCompositionEventArgs e)
50 | {
51 | if (new Regex("[^0-9.-]+").IsMatch(e.Text))
52 | {
53 | e.Handled = true;
54 | }
55 | }
56 |
57 | private void OffsetSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs e)
58 | {
59 | if (e.NewValue != 0d)
60 | {
61 | ShowTrayIconCheckbox.IsChecked = true;
62 | }
63 | }
64 |
65 | private void ClickThroughCheckbox_Checked(object sender, RoutedEventArgs e)
66 | {
67 | ShowTrayIconCheckbox.IsChecked = true;
68 | }
69 |
70 | private void ShowTrayIconCheckbox_Unchecked(object sender, RoutedEventArgs e)
71 | {
72 | XOffsetSlider.Value = 0d;
73 | YOffsetSlider.Value = 0d;
74 |
75 | ClickThroughCheckbox.IsChecked = false;
76 | }
77 |
78 | private void BindButton_LostFocus(object sender, RoutedEventArgs e)
79 | {
80 | if (_hotkey != null)
81 | {
82 | EndBind();
83 | }
84 |
85 | (sender as ToggleButton).IsChecked = false;
86 | }
87 |
88 | private void BindToggle_Click(object sender, RoutedEventArgs e)
89 | {
90 | _keybinder = (ToggleButton)sender;
91 |
92 | if (_keybinder.IsChecked == true)
93 | {
94 | BeginBind(Hotkey.KeyAction.Toggle);
95 | }
96 | else
97 | {
98 | EndBind();
99 | }
100 | }
101 |
102 | private void BindShow_Click(object sender, RoutedEventArgs e)
103 | {
104 | _keybinder = (ToggleButton)sender;
105 |
106 | if (_keybinder.IsChecked == true)
107 | {
108 | BeginBind(Hotkey.KeyAction.Show);
109 | }
110 | else
111 | {
112 | EndBind();
113 | }
114 | }
115 |
116 | private void BindHide_Click(object sender, RoutedEventArgs e)
117 | {
118 | _keybinder = (ToggleButton)sender;
119 |
120 | if (_keybinder.IsChecked == true)
121 | {
122 | BeginBind(Hotkey.KeyAction.Hide);
123 | }
124 | else
125 | {
126 | EndBind();
127 | }
128 | }
129 |
130 | private void BindReload_Click(object sender, RoutedEventArgs e)
131 | {
132 | _keybinder = (ToggleButton)sender;
133 |
134 | if (_keybinder.IsChecked == true)
135 | {
136 | BeginBind(Hotkey.KeyAction.Reload);
137 | }
138 | else
139 | {
140 | EndBind();
141 | }
142 | }
143 |
144 | private void BindClose_Click(object sender, RoutedEventArgs e)
145 | {
146 | _keybinder = (ToggleButton)sender;
147 |
148 | if (_keybinder.IsChecked == true)
149 | {
150 | BeginBind(Hotkey.KeyAction.Close);
151 | }
152 | else
153 | {
154 | EndBind();
155 | }
156 | }
157 |
158 | private void BindCycleEdge_Click(object sender, RoutedEventArgs e)
159 | {
160 | _keybinder = (ToggleButton)sender;
161 |
162 | if (_keybinder.IsChecked == true)
163 | {
164 | BeginBind(Hotkey.KeyAction.CycleEdge);
165 | }
166 | else
167 | {
168 | EndBind();
169 | }
170 | }
171 |
172 | private void BindCycleScreen_Click(object sender, RoutedEventArgs e)
173 | {
174 | _keybinder = (ToggleButton)sender;
175 |
176 | if (_keybinder.IsChecked == true)
177 | {
178 | BeginBind(Hotkey.KeyAction.CycleScreen);
179 | }
180 | else
181 | {
182 | EndBind();
183 | }
184 | }
185 |
186 | private void BindReserveSpace_Click(object sender, RoutedEventArgs e)
187 | {
188 | _keybinder = (ToggleButton)sender;
189 |
190 | if (_keybinder.IsChecked == true)
191 | {
192 | BeginBind(Hotkey.KeyAction.ReserveSpace);
193 | }
194 | else
195 | {
196 | EndBind();
197 | }
198 | }
199 |
200 | private void BeginBind(Hotkey.KeyAction action)
201 | {
202 | _hotkey = new Hotkey();
203 | _hotkey.Action = action;
204 | _hotkey.WinKey = Key.Escape;
205 |
206 | KeyDown += Window_KeyDown;
207 | }
208 |
209 | private void EndBind()
210 | {
211 | KeyDown -= Window_KeyDown;
212 |
213 | Hotkey.KeyAction _action = _hotkey.Action;
214 |
215 | if (_hotkey.WinKey == Key.Escape)
216 | {
217 | _hotkey = null;
218 | }
219 |
220 | switch (_action)
221 | {
222 | case Hotkey.KeyAction.Toggle:
223 | Model.ToggleKey = _hotkey;
224 | break;
225 |
226 | case Hotkey.KeyAction.Show:
227 | Model.ShowKey = _hotkey;
228 | break;
229 |
230 | case Hotkey.KeyAction.Hide:
231 | Model.HideKey = _hotkey;
232 | break;
233 |
234 | case Hotkey.KeyAction.Reload:
235 | Model.ReloadKey = _hotkey;
236 | break;
237 |
238 | case Hotkey.KeyAction.Close:
239 | Model.CloseKey = _hotkey;
240 | break;
241 |
242 | case Hotkey.KeyAction.CycleEdge:
243 | Model.CycleEdgeKey = _hotkey;
244 | break;
245 |
246 | case Hotkey.KeyAction.CycleScreen:
247 | Model.CycleScreenKey = _hotkey;
248 | break;
249 |
250 | case Hotkey.KeyAction.ReserveSpace:
251 | Model.ReserveSpaceKey = _hotkey;
252 | break;
253 | }
254 |
255 | _keybinder.IsChecked = false;
256 | }
257 |
258 | private void Window_KeyDown(object sender, KeyEventArgs e)
259 | {
260 | Key _key = e.Key == Key.System ? e.SystemKey : e.Key;
261 |
262 | if (new Key[] { Key.LeftAlt, Key.RightAlt, Key.LeftCtrl, Key.RightCtrl, Key.LeftShift, Key.RightShift, Key.LWin, Key.RWin }.Contains(_key))
263 | {
264 | return;
265 | }
266 |
267 | if ((e.KeyboardDevice.Modifiers & ModifierKeys.Control) == ModifierKeys.Control)
268 | {
269 | _hotkey.CtrlMod = true;
270 | }
271 |
272 | if ((e.KeyboardDevice.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift)
273 | {
274 | _hotkey.ShiftMod = true;
275 | }
276 |
277 | if ((e.KeyboardDevice.Modifiers & ModifierKeys.Windows) == ModifierKeys.Windows)
278 | {
279 | _hotkey.WinMod = true;
280 | }
281 |
282 | if ((e.KeyboardDevice.Modifiers & ModifierKeys.Alt) == ModifierKeys.Alt)
283 | {
284 | _hotkey.AltMod = true;
285 | }
286 |
287 | _hotkey.WinKey = _key;
288 |
289 | EndBind();
290 |
291 | e.Handled = true;
292 | }
293 |
294 | private async void SaveButton_Click(object sender, RoutedEventArgs e)
295 | {
296 | await Save(true);
297 |
298 | Close();
299 | }
300 |
301 | private async void ApplyButton_Click(object sender, RoutedEventArgs e)
302 | {
303 | await Save(false);
304 | }
305 |
306 | private void CloseButton_Click(object sender, RoutedEventArgs e)
307 | {
308 | if (Model.IsChanged)
309 | {
310 | Sidebar _sidebar = App.Current.Sidebar;
311 |
312 | if (_sidebar != null)
313 | {
314 | DataContext = Model = new SettingsModel(_sidebar);
315 | return;
316 | }
317 | }
318 |
319 | Close();
320 | }
321 |
322 | private void Window_Loaded(object sender, RoutedEventArgs e)
323 | {
324 | Hotkey.Disable();
325 | }
326 |
327 | private void Window_Closing(object sender, CancelEventArgs e)
328 | {
329 | DataContext = null;
330 | Model = null;
331 | }
332 |
333 | private void Window_Closed(object sender, EventArgs e)
334 | {
335 | Hotkey.Enable();
336 | }
337 |
338 | public SettingsModel Model { get; private set; }
339 |
340 | private Hotkey _hotkey { get; set; }
341 |
342 | private ToggleButton _keybinder { get; set; }
343 | }
344 | }
345 |
--------------------------------------------------------------------------------
/SidebarDiagnostics/Setup.xaml:
--------------------------------------------------------------------------------
1 |
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 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
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 |
--------------------------------------------------------------------------------
/SidebarDiagnostics/Setup.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using System.Text.RegularExpressions;
4 | using System.Threading;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Input;
9 | using System.Windows.Threading;
10 | using SidebarDiagnostics.Windows;
11 | using SidebarDiagnostics.Style;
12 |
13 | namespace SidebarDiagnostics
14 | {
15 | ///
16 | /// Interaction logic for Setup.xaml
17 | ///
18 | public partial class Setup : FlatWindow
19 | {
20 | public Setup()
21 | {
22 | InitializeComponent();
23 |
24 | Framework.Settings.Instance.ScreenIndex = 0;
25 | Framework.Settings.Instance.DockEdge = DockEdge.Right;
26 | Framework.Settings.Instance.XOffset = 0;
27 | Framework.Settings.Instance.YOffset = 0;
28 |
29 | Sidebar = new Dummy(this);
30 | Sidebar.Show();
31 | }
32 |
33 | private void ShowPage(Page page)
34 | {
35 | foreach (DockPanel _panel in SetupGrid.Children)
36 | {
37 | _panel.IsEnabled = _panel.Name == page.ToString();
38 | }
39 |
40 | CurrentPage = page;
41 | }
42 |
43 | private void Yes_Click(object sender, RoutedEventArgs e)
44 | {
45 | switch (CurrentPage)
46 | {
47 | case Page.Initial:
48 | case Page.BeginCustom:
49 | ShowPage(Page.Final);
50 | return;
51 | }
52 | }
53 |
54 | private void No_Click(object sender, RoutedEventArgs e)
55 | {
56 | switch (CurrentPage)
57 | {
58 | case Page.Initial:
59 | ShowPage(Page.BeginCustom);
60 | return;
61 | }
62 | }
63 |
64 | private void OffsetSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs e)
65 | {
66 | if (_cancelReposition != null)
67 | {
68 | _cancelReposition.Cancel();
69 | }
70 |
71 | _cancelReposition = new CancellationTokenSource();
72 |
73 | Task.Delay(TimeSpan.FromMilliseconds(500), _cancelReposition.Token).ContinueWith(_ =>
74 | {
75 | if (_.IsCanceled)
76 | {
77 | return;
78 | }
79 |
80 | Dispatcher.BeginInvoke(DispatcherPriority.Normal, (Action)(() =>
81 | {
82 | Framework.Settings.Instance.XOffset = (int)XOffsetSlider.Value;
83 | Framework.Settings.Instance.YOffset = (int)YOffsetSlider.Value;
84 |
85 | Sidebar.Reposition();
86 | }));
87 |
88 | _cancelReposition = null;
89 | });
90 | }
91 |
92 | private void NumberBox_PreviewTextInput(object sender, TextCompositionEventArgs e)
93 | {
94 | if (new Regex("[^0-9.-]+").IsMatch(e.Text))
95 | {
96 | e.Handled = true;
97 | }
98 | }
99 |
100 | private void Settings_Click(object sender, RoutedEventArgs e)
101 | {
102 | _openSettings = true;
103 |
104 | Close();
105 | }
106 |
107 | private void Close_Click(object sender, RoutedEventArgs e)
108 | {
109 | Close();
110 | }
111 |
112 | private void Window_Closed(object sender, EventArgs e)
113 | {
114 | if (Sidebar != null && Sidebar.IsInitialized)
115 | {
116 | Sidebar.Close();
117 | }
118 |
119 | Framework.Settings.Instance.InitialSetup = false;
120 | Framework.Settings.Instance.Save();
121 |
122 | App.StartApp(_openSettings);
123 | }
124 |
125 | public Dummy Sidebar { get; private set; }
126 |
127 | public Page CurrentPage { get; set; } = Page.Initial;
128 |
129 | private CancellationTokenSource _cancelReposition { get; set; }
130 |
131 | private bool _openSettings { get; set; } = false;
132 |
133 | public enum Page : byte
134 | {
135 | Initial,
136 | BeginCustom,
137 | Final
138 | }
139 | }
140 | }
--------------------------------------------------------------------------------
/SidebarDiagnostics/Sidebar.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thewriteway/SidebarDiagnostics/a9a417f757737ba63f2ccd7fafb7bf13c193ef33/SidebarDiagnostics/Sidebar.ico
--------------------------------------------------------------------------------
/SidebarDiagnostics/Sidebar.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using System.Threading.Tasks;
4 | using System.Windows;
5 | using System.Windows.Input;
6 | using System.Windows.Threading;
7 | using SidebarDiagnostics.Windows;
8 | using SidebarDiagnostics.Models;
9 |
10 | namespace SidebarDiagnostics
11 | {
12 | ///
13 | /// Interaction logic for Sidebar.xaml
14 | ///
15 | public partial class Sidebar : AppBarWindow
16 | {
17 | public Sidebar(bool openSettings, bool initiallyHidden)
18 | {
19 | InitializeComponent();
20 |
21 | _openSettings = openSettings;
22 | _initiallyHidden = initiallyHidden;
23 | }
24 |
25 | public void Reload()
26 | {
27 | if (!Ready)
28 | {
29 | return;
30 | }
31 |
32 | Ready = false;
33 |
34 | App._reloading = true;
35 |
36 | Close();
37 | }
38 |
39 | public async Task Reset(bool enableHotkeys)
40 | {
41 | if (!Ready)
42 | {
43 | return;
44 | }
45 |
46 | Ready = false;
47 |
48 | await BindSettings(enableHotkeys);
49 |
50 | await BindModel();
51 | }
52 |
53 | public async Task Reposition()
54 | {
55 | if (!Ready)
56 | {
57 | return;
58 | }
59 |
60 | Ready = false;
61 |
62 | await BindPosition();
63 |
64 | Ready = true;
65 | }
66 |
67 | public void ContentReload()
68 | {
69 | if (!Ready)
70 | {
71 | return;
72 | }
73 |
74 | Ready = false;
75 |
76 | Model.Reload();
77 |
78 | Ready = true;
79 |
80 | BindGraphs();
81 | }
82 |
83 | public override async Task AppBarShow()
84 | {
85 | await base.AppBarShow();
86 |
87 | Model.Resume();
88 | }
89 |
90 | public override void AppBarHide()
91 | {
92 | base.AppBarHide();
93 |
94 | Model.Pause();
95 | }
96 |
97 | private async Task Initialize()
98 | {
99 | Ready = false;
100 |
101 | Devices.AddHook(this);
102 |
103 | DisableAeroPeek();
104 |
105 | await BindSettings(true);
106 |
107 | await BindModel();
108 | }
109 |
110 | private async Task BindSettings(bool enableHotkeys)
111 | {
112 | await BindPosition();
113 |
114 | if (Framework.Settings.Instance.AlwaysTop)
115 | {
116 | SetTopMost(false);
117 |
118 | ShowDesktop.RemoveHook();
119 | }
120 | else
121 | {
122 | ClearTopMost(false);
123 |
124 | ShowDesktop.AddHook(this);
125 | }
126 |
127 | if (Framework.Settings.Instance.ClickThrough)
128 | {
129 | SetClickThrough();
130 | }
131 | else
132 | {
133 | ClearClickThrough();
134 | }
135 |
136 | if (Framework.Settings.Instance.ToolbarMode)
137 | {
138 | HideInAltTab();
139 | }
140 | else
141 | {
142 | ShowInAltTab();
143 | }
144 |
145 | if (WindowControls.Visibility != Visibility.Visible)
146 | {
147 | if (Framework.Settings.Instance.CollapseMenuBar)
148 | {
149 | WindowControls.Visibility = Visibility.Collapsed;
150 | }
151 | else
152 | {
153 | WindowControls.Visibility = Visibility.Hidden;
154 | }
155 | }
156 |
157 | Hotkey.Initialize(this, Framework.Settings.Instance.Hotkeys);
158 |
159 | if (enableHotkeys)
160 | {
161 | Hotkey.Enable();
162 | }
163 | }
164 |
165 | private async Task BindPosition()
166 | {
167 | await SetAppBar();
168 | }
169 |
170 | private async Task BindModel()
171 | {
172 | await Task.Run(async () =>
173 | {
174 | if (Model != null)
175 | {
176 | Model.Dispose();
177 | Model = null;
178 | }
179 |
180 | await Dispatcher.BeginInvoke(DispatcherPriority.Normal, new ModelReadyHandler(ModelReady), new SidebarModel());
181 | });
182 | }
183 |
184 | private delegate void ModelReadyHandler(SidebarModel model);
185 |
186 | private void ModelReady(SidebarModel model)
187 | {
188 | DataContext = Model = model;
189 | model.Start();
190 |
191 | Ready = true;
192 |
193 | BindGraphs();
194 |
195 | if (_openSettings)
196 | {
197 | _openSettings = false;
198 |
199 | App.Current.OpenSettings();
200 | }
201 |
202 | if (_initiallyHidden)
203 | {
204 | _initiallyHidden = false;
205 |
206 | AppBarHide();
207 | }
208 | }
209 |
210 | private void BindGraphs()
211 | {
212 | foreach (Graph _graph in App.Current.Graphs)
213 | {
214 | _graph.Model.BindData(Model.MonitorManager);
215 | }
216 | }
217 |
218 | private void GraphButton_Click(object sender, RoutedEventArgs e)
219 | {
220 | App.Current.OpenGraph();
221 | }
222 |
223 | private void SettingsButton_Click(object sender, RoutedEventArgs e)
224 | {
225 | App.Current.OpenSettings();
226 | }
227 |
228 | private void CloseButton_Click(object sender, RoutedEventArgs e)
229 | {
230 | App.Current.Shutdown();
231 | }
232 |
233 | private void Window_MouseEnter(object sender, MouseEventArgs e)
234 | {
235 | WindowControls.Visibility = Visibility.Visible;
236 | }
237 |
238 | private void Window_MouseLeave(object sender, MouseEventArgs e)
239 | {
240 | WindowControls.Visibility = Framework.Settings.Instance.CollapseMenuBar ? Visibility.Collapsed : Visibility.Hidden;
241 | }
242 |
243 | private async void Window_Loaded(object sender, RoutedEventArgs e)
244 | {
245 | await Initialize();
246 | }
247 |
248 | private void Window_StateChanged(object sender, EventArgs e)
249 | {
250 | if (WindowState != WindowState.Normal)
251 | {
252 | WindowState = WindowState.Normal;
253 | }
254 | }
255 |
256 | private void Window_Closing(object sender, CancelEventArgs e)
257 | {
258 | Ready = false;
259 |
260 | DataContext = null;
261 |
262 | if (Model != null)
263 | {
264 | Model.Dispose();
265 | Model = null;
266 | }
267 |
268 | ClearAppBar();
269 |
270 | Devices.RemoveHook(this);
271 | ShowDesktop.RemoveHook();
272 | Hotkey.Dispose();
273 | }
274 |
275 | private void Window_Closed(object sender, EventArgs e)
276 | {
277 | if (App._reloading)
278 | {
279 | App._reloading = false;
280 |
281 | new Sidebar(false, false).Show();
282 | }
283 | else
284 | {
285 | App.Current.Shutdown();
286 | }
287 | }
288 |
289 | private bool _ready { get; set; } = false;
290 |
291 | public bool Ready
292 | {
293 | get
294 | {
295 | return _ready;
296 | }
297 | set
298 | {
299 | _ready = value;
300 |
301 | if (Model != null)
302 | {
303 | Model.Ready = value;
304 | }
305 | }
306 | }
307 |
308 | public SidebarModel Model { get; private set; }
309 |
310 | private bool _openSettings { get; set; } = false;
311 |
312 | private bool _initiallyHidden { get; set; } = false;
313 | }
314 | }
--------------------------------------------------------------------------------
/SidebarDiagnostics/SidebarDiagnostics.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {A1174319-5065-453E-9864-9E7108419DDA}
6 | WinExe
7 | AnyCPU
8 | Properties
9 | SidebarDiagnostics
10 | SidebarDiagnostics
11 | v4.7.2
12 | win-x64
13 | 512
14 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
15 | 4
16 | true
17 |
18 | false
19 |
20 |
21 | publish\
22 | true
23 | Disk
24 | false
25 | Foreground
26 | 7
27 | Days
28 | false
29 | false
30 | true
31 | true
32 | 0
33 | 1.3.1
34 | false
35 | true
36 | true
37 |
38 |
39 | x64
40 | true
41 | full
42 | false
43 | bin\Debug\
44 | DEBUG;TRACE
45 | prompt
46 | 4
47 | false
48 |
49 |
50 | x64
51 | pdbonly
52 | true
53 | bin\Release\
54 | TRACE
55 | prompt
56 | 4
57 | false
58 |
59 |
60 | LocalIntranet
61 |
62 |
63 | false
64 |
65 |
66 | Properties\app.manifest
67 |
68 |
69 | SidebarDiagnostics.App
70 |
71 |
72 | Sidebar.ico
73 |
74 |
75 | 04836BFB55DC45C7D1C31B8EBC2AC038779EDF93
76 |
77 |
78 | SidebarDiagnostics_TemporaryKey.pfx
79 |
80 |
81 | false
82 |
83 |
84 | false
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 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 | 4.7.2
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 | MSBuild:Compile
131 | Designer
132 |
133 |
134 | ChangeLog.xaml
135 |
136 |
137 |
138 | Graph.xaml
139 |
140 |
141 |
142 | Resources.ar.resx
143 | True
144 | True
145 |
146 |
147 | True
148 | True
149 | Resources.es.resx
150 |
151 |
152 | Resources.fi.resx
153 | True
154 | True
155 |
156 |
157 | Resources.de-CH.resx
158 | True
159 | True
160 |
161 |
162 | True
163 | True
164 | Resources.it.resx
165 |
166 |
167 | Resources.zh.resx
168 | True
169 | True
170 |
171 |
172 | Resources.de.resx
173 | True
174 | True
175 |
176 |
177 | Resources.nl.resx
178 | True
179 | True
180 |
181 |
182 | Resources.da.resx
183 | True
184 | True
185 |
186 |
187 | Resources.ja.resx
188 | True
189 | True
190 |
191 |
192 | Resources.fr.resx
193 | True
194 | True
195 |
196 |
197 | True
198 | True
199 | Resources.resx
200 |
201 |
202 |
203 |
204 |
205 |
206 | Dummy.xaml
207 |
208 |
209 |
210 |
211 | Setup.xaml
212 |
213 |
214 | Update.xaml
215 |
216 |
217 |
218 |
219 |
220 | Settings.xaml
221 |
222 |
223 |
224 | FlatStyle.xaml
225 |
226 |
227 | Designer
228 | MSBuild:Compile
229 |
230 |
231 | Designer
232 | MSBuild:Compile
233 |
234 |
235 | MSBuild:Compile
236 | Designer
237 |
238 |
239 | App.xaml
240 | Code
241 |
242 |
243 | Sidebar.xaml
244 | Code
245 |
246 |
247 | MSBuild:Compile
248 | Designer
249 |
250 |
251 | Designer
252 | MSBuild:Compile
253 |
254 |
255 | Designer
256 | MSBuild:Compile
257 |
258 |
259 | Designer
260 | MSBuild:Compile
261 |
262 |
263 | Designer
264 | MSBuild:Compile
265 |
266 |
267 |
268 |
269 | Code
270 |
271 |
272 | Always
273 |
274 |
275 |
276 | Designer
277 |
278 |
279 |
280 |
281 |
282 | Designer
283 |
284 |
285 |
286 |
287 | False
288 | .NET Framework 4.7.2
289 | false
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 | PublicResXFileCodeGenerator
301 | Resources.ar.Designer.cs
302 | SidebarDiagnostics.Framework
303 |
304 |
305 | ResXFileCodeGenerator
306 | Resources.es.Designer.cs
307 |
308 |
309 | PublicResXFileCodeGenerator
310 | Resources.fi.Designer.cs
311 | SidebarDiagnostics.Framework
312 | Designer
313 |
314 |
315 | PublicResXFileCodeGenerator
316 | Resources.de-CH.Designer.cs
317 | SidebarDiagnostics.Framework
318 |
319 |
320 | PublicResXFileCodeGenerator
321 | Resources.it.Designer.cs
322 | SidebarDiagnostics.Framework
323 |
324 |
325 |
326 |
327 | PublicResXFileCodeGenerator
328 | Resources.zh.Designer.cs
329 | SidebarDiagnostics.Framework
330 |
331 |
332 | PublicResXFileCodeGenerator
333 | Resources.de.Designer.cs
334 | SidebarDiagnostics.Framework
335 |
336 |
337 | PublicResXFileCodeGenerator
338 | Resources.nl.Designer.cs
339 | SidebarDiagnostics.Framework
340 |
341 |
342 | PublicResXFileCodeGenerator
343 | Resources.da.Designer.cs
344 | SidebarDiagnostics.Framework
345 |
346 |
347 | PublicResXFileCodeGenerator
348 | Resources.ja.Designer.cs
349 | SidebarDiagnostics.Framework
350 |
351 |
352 | PublicResXFileCodeGenerator
353 | Resources.fr.Designer.cs
354 | SidebarDiagnostics.Framework
355 |
356 |
357 | PublicResXFileCodeGenerator
358 | SidebarDiagnostics.Framework
359 | Resources.Designer.cs
360 |
361 |
362 |
363 |
364 | {8c38ab06-ac1a-49a7-9683-5b4ca7fb0115}
365 | LibreHardwareMonitorLib
366 |
367 |
368 |
369 |
370 |
371 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
372 |
373 |
374 |
381 |
--------------------------------------------------------------------------------
/SidebarDiagnostics/SidebarModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using System.Windows.Threading;
4 | using SidebarDiagnostics.Monitoring;
5 | using SidebarDiagnostics.Utilities;
6 |
7 | namespace SidebarDiagnostics.Models
8 | {
9 | public class SidebarModel : INotifyPropertyChanged, IDisposable
10 | {
11 | public SidebarModel()
12 | {
13 | InitMachineName();
14 | InitClock();
15 | InitMonitors();
16 | }
17 |
18 | public void Dispose()
19 | {
20 | Dispose(true);
21 | GC.SuppressFinalize(this);
22 | }
23 |
24 | protected virtual void Dispose(bool disposing)
25 | {
26 | if (!_disposed)
27 | {
28 | if (disposing)
29 | {
30 | DisposeClock();
31 | DisposeMonitors();
32 | }
33 |
34 | _disposed = true;
35 | }
36 | }
37 |
38 | ~SidebarModel()
39 | {
40 | Dispose(false);
41 | }
42 |
43 | public void Start()
44 | {
45 | StartClock();
46 | StartMonitors();
47 | }
48 |
49 | public void Reload()
50 | {
51 | DisposeMonitors();
52 | InitMonitors();
53 | StartMonitors();
54 | }
55 |
56 | public void Pause()
57 | {
58 | PauseClock();
59 | PauseMonitors();
60 | }
61 |
62 | public void Resume()
63 | {
64 | ResumeClock();
65 | ResumeMonitors();
66 | }
67 |
68 | public void NotifyPropertyChanged(string propertyName)
69 | {
70 | if (PropertyChanged != null)
71 | {
72 | PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
73 | }
74 | }
75 |
76 | public event PropertyChangedEventHandler PropertyChanged;
77 |
78 | private void InitMachineName()
79 | {
80 | ShowMachineName = Framework.Settings.Instance.ShowMachineName;
81 |
82 | MachineName = Environment.MachineName;
83 | }
84 |
85 | private void InitClock()
86 | {
87 | ShowClock = Framework.Settings.Instance.ShowClock;
88 |
89 | if (!ShowClock)
90 | {
91 | return;
92 | }
93 |
94 | ShowDate = !Framework.Settings.Instance.DateSetting.Equals(Framework.DateSetting.Disabled);
95 |
96 | UpdateClock();
97 | }
98 |
99 | private void InitMonitors()
100 | {
101 | MonitorManager = new MonitorManager(Framework.Settings.Instance.MonitorConfig);
102 | MonitorManager.Update();
103 | }
104 |
105 | private void StartClock()
106 | {
107 | if (!ShowClock)
108 | {
109 | return;
110 | }
111 |
112 | _clockTimer = new DispatcherTimer();
113 | _clockTimer.Interval = TimeSpan.FromSeconds(1);
114 | _clockTimer.Tick += new EventHandler(ClockTimer_Tick);
115 | _clockTimer.Start();
116 | }
117 |
118 | private void StartMonitors()
119 | {
120 | _monitorTimer = new DispatcherTimer();
121 | _monitorTimer.Interval = TimeSpan.FromMilliseconds(Framework.Settings.Instance.PollingInterval);
122 | _monitorTimer.Tick += new EventHandler(MonitorTimer_Tick);
123 | _monitorTimer.Start();
124 | }
125 |
126 | private void UpdateClock()
127 | {
128 | DateTime _now = DateTime.Now;
129 |
130 | Time = _now.ToString(Framework.Settings.Instance.Clock24HR ? "H:mm:ss" : "h:mm:ss tt", Culture.CultureInfo);
131 |
132 | if (ShowDate)
133 | {
134 | Date = _now.ToString(Framework.Settings.Instance.DateSetting.Format, Culture.CultureInfo);
135 | }
136 | }
137 |
138 | private void UpdateMonitors()
139 | {
140 | MonitorManager.Update();
141 | }
142 |
143 | private void PauseClock()
144 | {
145 | if (_clockTimer != null)
146 | {
147 | _clockTimer.Stop();
148 | }
149 | }
150 |
151 | private void PauseMonitors()
152 | {
153 | if (_monitorTimer != null)
154 | {
155 | _monitorTimer.Stop();
156 | }
157 | }
158 |
159 | private void ResumeClock()
160 | {
161 | if (_clockTimer != null)
162 | {
163 | _clockTimer.Start();
164 | }
165 | }
166 |
167 | private void ResumeMonitors()
168 | {
169 | if (_monitorTimer != null)
170 | {
171 | _monitorTimer.Start();
172 | }
173 | }
174 |
175 | private void DisposeClock()
176 | {
177 | if (_clockTimer != null)
178 | {
179 | _clockTimer.Stop();
180 | _clockTimer = null;
181 | }
182 | }
183 |
184 | private void DisposeMonitors()
185 | {
186 | if (_monitorTimer != null)
187 | {
188 | _monitorTimer.Stop();
189 | _monitorTimer = null;
190 | }
191 |
192 | if (MonitorManager != null)
193 | {
194 | MonitorManager.Dispose();
195 | _monitorManager = null;
196 | }
197 | }
198 |
199 | private void ClockTimer_Tick(object sender, EventArgs e)
200 | {
201 | UpdateClock();
202 | }
203 |
204 | private void MonitorTimer_Tick(object sender, EventArgs e)
205 | {
206 | UpdateMonitors();
207 | }
208 |
209 | private bool _ready { get; set; } = false;
210 |
211 | public bool Ready
212 | {
213 | get
214 | {
215 | return _ready;
216 | }
217 | set
218 | {
219 | _ready = value;
220 |
221 | NotifyPropertyChanged("Ready");
222 | }
223 | }
224 |
225 | private bool _showMachineName { get; set; }
226 |
227 | public bool ShowMachineName
228 | {
229 | get
230 | {
231 | return _showMachineName;
232 | }
233 | set
234 | {
235 | _showMachineName = value;
236 |
237 | NotifyPropertyChanged("ShowMachineName");
238 | }
239 | }
240 |
241 | private string _machineName { get; set; }
242 |
243 | public string MachineName
244 | {
245 | get
246 | {
247 | return _machineName;
248 | }
249 | set
250 | {
251 | _machineName = value;
252 |
253 | NotifyPropertyChanged("MachineName");
254 | }
255 | }
256 |
257 | private bool _showClock { get; set; }
258 |
259 | public bool ShowClock
260 | {
261 | get
262 | {
263 | return _showClock;
264 | }
265 | set
266 | {
267 | _showClock = value;
268 |
269 | NotifyPropertyChanged("ShowClock");
270 | }
271 | }
272 |
273 | private string _time { get; set; }
274 |
275 | public string Time
276 | {
277 | get
278 | {
279 | return _time;
280 | }
281 | set
282 | {
283 | _time = value;
284 |
285 | NotifyPropertyChanged("Time");
286 | }
287 | }
288 |
289 | private bool _showDate { get; set; }
290 |
291 | public bool ShowDate
292 | {
293 | get
294 | {
295 | return _showDate;
296 | }
297 | set
298 | {
299 | _showDate = value;
300 |
301 | NotifyPropertyChanged("ShowDate");
302 | }
303 | }
304 |
305 | private string _date { get; set; }
306 |
307 | public string Date
308 | {
309 | get
310 | {
311 | return _date;
312 | }
313 | set
314 | {
315 | _date = value;
316 |
317 | NotifyPropertyChanged("Date");
318 | }
319 | }
320 |
321 | private MonitorManager _monitorManager { get; set; }
322 |
323 | public MonitorManager MonitorManager
324 | {
325 | get
326 | {
327 | return _monitorManager;
328 | }
329 | set
330 | {
331 | _monitorManager = value;
332 |
333 | NotifyPropertyChanged("MonitorManager");
334 | }
335 | }
336 |
337 | private DispatcherTimer _clockTimer { get; set; }
338 |
339 | private DispatcherTimer _monitorTimer { get; set; }
340 |
341 | private bool _disposed { get; set; } = false;
342 | }
343 | }
344 |
--------------------------------------------------------------------------------
/SidebarDiagnostics/Update.xaml:
--------------------------------------------------------------------------------
1 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/SidebarDiagnostics/Update.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using System.Windows.Input;
4 | using System.Windows.Threading;
5 | using SidebarDiagnostics.Models;
6 | using SidebarDiagnostics.Windows;
7 | using SidebarDiagnostics.Style;
8 |
9 | namespace SidebarDiagnostics
10 | {
11 | ///
12 | /// Interaction logic for Update.xaml
13 | ///
14 | public partial class Update : FlatWindow
15 | {
16 | public Update()
17 | {
18 | InitializeComponent();
19 |
20 | DataContext = Model = new UpdateModel();
21 | }
22 |
23 | public void SetProgress(double percent)
24 | {
25 | Dispatcher.BeginInvoke(DispatcherPriority.Normal, (Action)(() =>
26 | {
27 | Model.Progress = percent;
28 | }));
29 | }
30 |
31 | public new void Close()
32 | {
33 | _close = true;
34 |
35 | base.Close();
36 | }
37 |
38 | protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
39 | {
40 | base.OnMouseLeftButtonDown(e);
41 |
42 | DragMove();
43 | }
44 |
45 | protected override void OnClosing(CancelEventArgs e)
46 | {
47 | if (_close)
48 | {
49 | base.OnClosing(e);
50 | }
51 | else
52 | {
53 | e.Cancel = true;
54 | }
55 | }
56 |
57 | public UpdateModel Model { get; private set; }
58 |
59 | private bool _close { get; set; } = false;
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/SidebarDiagnostics/UpdateModel.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 |
3 | namespace SidebarDiagnostics.Models
4 | {
5 | public class UpdateModel : INotifyPropertyChanged
6 | {
7 | public void NotifyPropertyChanged(string propertyName)
8 | {
9 | if (PropertyChanged != null)
10 | {
11 | PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
12 | }
13 | }
14 |
15 | public event PropertyChangedEventHandler PropertyChanged;
16 |
17 | private double _progress { get; set; } = 0d;
18 |
19 | public double Progress
20 | {
21 | get
22 | {
23 | return _progress;
24 | }
25 | set
26 | {
27 | _progress = value;
28 |
29 | NotifyPropertyChanged("Progress");
30 | NotifyPropertyChanged("ProgressNormalized");
31 | }
32 | }
33 |
34 | public double ProgressNormalized
35 | {
36 | get
37 | {
38 | return _progress / 100d;
39 | }
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/SidebarDiagnostics/Utilities.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 | using System.Linq;
4 | using System.IO;
5 | using System.Reflection;
6 | using System.Threading;
7 | using System.Windows;
8 | using System.Windows.Markup;
9 | using Microsoft.Win32.TaskScheduler;
10 | using SidebarDiagnostics.Framework;
11 | using System.Diagnostics;
12 |
13 | namespace SidebarDiagnostics.Utilities
14 | {
15 | public static class Paths
16 | {
17 | private const string SETTINGS = "settings.json";
18 | private const string CHANGELOG = "ChangeLog.json";
19 |
20 | public static string Install(Version version)
21 | {
22 | return Path.Combine(LocalApp, string.Format("app-{0}", version.ToString(3)));
23 | }
24 |
25 | public static string Exe(Version version)
26 | {
27 | return Path.Combine(Install(version), ExeName);
28 | }
29 |
30 | public static string ChangeLog
31 | {
32 | get
33 | {
34 | return Path.Combine(CurrentDirectory, CHANGELOG);
35 | }
36 | }
37 |
38 | public static string CurrentDirectory
39 | {
40 | get
41 | {
42 | return Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory);
43 | }
44 | }
45 |
46 | public static string TaskBar
47 | {
48 | get
49 | {
50 | return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar");
51 | }
52 | }
53 |
54 | private static string _assemblyName { get; set; } = null;
55 |
56 | public static string AssemblyName
57 | {
58 | get
59 | {
60 | if (_assemblyName == null)
61 | {
62 | _assemblyName = Assembly.GetExecutingAssembly().GetName().Name;
63 | }
64 |
65 | return _assemblyName;
66 | }
67 | }
68 |
69 | private static string _exeName { get; set; } = null;
70 |
71 | public static string ExeName
72 | {
73 | get
74 | {
75 | if (_exeName == null)
76 | {
77 | _exeName = string.Format("{0}.exe", AssemblyName);
78 | }
79 |
80 | return _exeName;
81 | }
82 | }
83 |
84 | private static string _settingsFile { get; set; } = null;
85 |
86 | public static string SettingsFile
87 | {
88 | get
89 | {
90 | if (_settingsFile == null)
91 | {
92 | _settingsFile = Path.Combine(LocalApp, SETTINGS);
93 | }
94 |
95 | return _settingsFile;
96 | }
97 | }
98 |
99 | private static string _localApp { get; set; } = null;
100 |
101 | public static string LocalApp
102 | {
103 | get
104 | {
105 | if (_localApp == null)
106 | {
107 | _localApp = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), AssemblyName);
108 | }
109 |
110 | return _localApp;
111 | }
112 | }
113 | }
114 |
115 | public static class Startup
116 | {
117 | public static bool StartupTaskExists()
118 | {
119 | using (TaskService _taskService = new TaskService())
120 | {
121 | Task _task = _taskService.FindTask(Constants.Generic.TASKNAME);
122 |
123 | if (_task == null)
124 | {
125 | return false;
126 | }
127 |
128 | ExecAction _action = _task.Definition.Actions.OfType().FirstOrDefault();
129 |
130 | if (_action == null || _action.Path != Assembly.GetExecutingAssembly().Location)
131 | {
132 | return false;
133 | }
134 |
135 | return true;
136 | }
137 | }
138 |
139 | public static void EnableStartupTask(string exePath = null)
140 | {
141 | try
142 | {
143 | using (TaskService _taskService = new TaskService())
144 | {
145 | TaskDefinition _def = _taskService.NewTask();
146 | _def.Triggers.Add(new LogonTrigger() { Enabled = true });
147 | _def.Actions.Add(new ExecAction(exePath ?? Assembly.GetExecutingAssembly().Location));
148 | _def.Principal.RunLevel = TaskRunLevel.Highest;
149 |
150 | _def.Settings.DisallowStartIfOnBatteries = false;
151 | _def.Settings.StopIfGoingOnBatteries = false;
152 | _def.Settings.ExecutionTimeLimit = TimeSpan.Zero;
153 |
154 | _taskService.RootFolder.RegisterTaskDefinition(Constants.Generic.TASKNAME, _def);
155 | }
156 | }
157 | catch (Exception e)
158 | {
159 | using (EventLog _log = new EventLog("Application"))
160 | {
161 | _log.Source = Resources.AppName;
162 | _log.WriteEntry(e.ToString(), EventLogEntryType.Error, 100, 1);
163 | }
164 | }
165 | }
166 |
167 | public static void DisableStartupTask()
168 | {
169 | using (TaskService _taskService = new TaskService())
170 | {
171 | _taskService.RootFolder.DeleteTask(Constants.Generic.TASKNAME, false);
172 | }
173 | }
174 | }
175 |
176 | public static class Culture
177 | {
178 | public const string DEFAULT = "Default";
179 |
180 | public static void SetDefault()
181 | {
182 | Default = Thread.CurrentThread.CurrentUICulture;
183 | }
184 |
185 | public static void SetCurrent(bool init)
186 | {
187 | Resources.Culture = CultureInfo;
188 |
189 | Thread.CurrentThread.CurrentCulture = CultureInfo;
190 | Thread.CurrentThread.CurrentUICulture = CultureInfo;
191 |
192 | if (init)
193 | {
194 | FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement), new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.Name)));
195 | }
196 | }
197 |
198 | public static CultureItem[] GetAll()
199 | {
200 | return new CultureItem[1] { new CultureItem() { Value = DEFAULT, Text = Resources.SettingsLanguageDefault } }.Concat(CultureInfo.GetCultures(CultureTypes.SpecificCultures).Where(c => Languages.Contains(c.TwoLetterISOLanguageName)).OrderBy(c => c.DisplayName).Select(c => new CultureItem() { Value = c.Name, Text = c.DisplayName })).ToArray();
201 | }
202 |
203 | public static string[] Languages
204 | {
205 | get
206 | {
207 | return new string[11] { "en", "da", "de", "fr", "ja", "nl", "zh", "it", "ru", "fi", "es" };
208 | }
209 | }
210 |
211 | public static CultureInfo Default { get; private set; }
212 |
213 | public static CultureInfo CultureInfo
214 | {
215 | get
216 | {
217 | string culture = Framework.Settings.Instance.Culture;
218 | return string.Equals(culture, DEFAULT, StringComparison.Ordinal)
219 | ? Default
220 | : new CultureInfo(culture);
221 | }
222 | }
223 | }
224 |
225 | public class CultureItem
226 | {
227 | public string Value { get; set; }
228 |
229 | public string Text { get; set; }
230 | }
231 | }
232 |
--------------------------------------------------------------------------------
/SidebarDiagnostics/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/resharper.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
51 |
--------------------------------------------------------------------------------
/sidebar.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thewriteway/SidebarDiagnostics/a9a417f757737ba63f2ccd7fafb7bf13c193ef33/sidebar.ico
--------------------------------------------------------------------------------