diff --git a/.gitattributes b/.gitattributes
index eba1110..bdb0cab 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,2 +1,17 @@
# Auto detect text files and perform LF normalization
-* text=auto
\ No newline at end of file
+* text=auto
+
+# Custom for Visual Studio
+*.cs diff=csharp
+
+# Standard to msysgit
+*.doc diff=astextplain
+*.DOC diff=astextplain
+*.docx diff=astextplain
+*.DOCX diff=astextplain
+*.dot diff=astextplain
+*.DOT diff=astextplain
+*.pdf diff=astextplain
+*.PDF diff=astextplain
+*.rtf diff=astextplain
+*.RTF diff=astextplain
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..49f18f2
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,303 @@
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+
+# User-specific files
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+
+# Visual Studio 2015 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUNIT
+*.VisualState.xml
+TestResult.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# DNX
+project.lock.json
+artifacts/
+
+*_i.c
+*_p.c
+*_i.h
+*.ilk
+*.meta
+*.obj
+*.pch
+*.pdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# JustCode is a .NET coding add-in
+.JustCode
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# TODO: Comment the next line if you want to checkin your web deploy settings
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# The packages folder can be ignored because of Package Restore
+**/packages/*
+# except build/, which is used as an MSBuild target.
+!**/packages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/packages/repositories.config
+# NuGet v3's project.json files produces more ignoreable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.pfx
+*.publishsettings
+node_modules/
+orleans.codegen.cs
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+
+# SQL Server files
+*.mdf
+*.ldf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# JetBrains Rider
+.idea/
+*.sln.iml
+
+# =========================
+# Operating System Files
+# =========================
+
+# OSX
+# =========================
+
+.DS_Store
+.AppleDouble
+.LSOverride
+
+# Thumbnails
+._*
+
+# Files that might appear in the root of a volume
+.DocumentRevisions-V100
+.fseventsd
+.Spotlight-V100
+.TemporaryItems
+.Trashes
+.VolumeIcon.icns
+
+# Directories potentially created on remote AFP share
+.AppleDB
+.AppleDesktop
+Network Trash Folder
+Temporary Items
+.apdisk
+
+# Windows
+# =========================
+
+# Windows image file caches
+Thumbs.db
+ehthumbs.db
+
+# Folder config file
+Desktop.ini
+
+# Recycle Bin used on file shares
+$RECYCLE.BIN/
+
+# Windows Installer files
+*.cab
+*.msi
+*.msm
+*.msp
+
+# Windows shortcuts
+*.lnk
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..d15ce1f
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2017 Takafumi.Miyake
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/PocketFanController.sln b/PocketFanController.sln
new file mode 100644
index 0000000..243be5d
--- /dev/null
+++ b/PocketFanController.sln
@@ -0,0 +1,30 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.26730.3
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PocketFanController", "PocketFanController\PocketFanController.csproj", "{8623A908-1563-46EE-98E5-0539DF3ED417}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0C9A6EBD-5404-423A-BBF6-7660A9E79686}"
+ ProjectSection(SolutionItems) = preProject
+ .gitignore = .gitignore
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {8623A908-1563-46EE-98E5-0539DF3ED417}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {8623A908-1563-46EE-98E5-0539DF3ED417}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8623A908-1563-46EE-98E5-0539DF3ED417}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {8623A908-1563-46EE-98E5-0539DF3ED417}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {EE4365AC-C77F-4406-8711-DB6B8277BC97}
+ EndGlobalSection
+EndGlobal
diff --git a/PocketFanController/App.config b/PocketFanController/App.config
new file mode 100644
index 0000000..88fa402
--- /dev/null
+++ b/PocketFanController/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/PocketFanController/App.xaml b/PocketFanController/App.xaml
new file mode 100644
index 0000000..9993af8
--- /dev/null
+++ b/PocketFanController/App.xaml
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/PocketFanController/App.xaml.cs b/PocketFanController/App.xaml.cs
new file mode 100644
index 0000000..3f4078e
--- /dev/null
+++ b/PocketFanController/App.xaml.cs
@@ -0,0 +1,16 @@
+using System.Windows;
+
+namespace PocketFanController
+{
+ ///
+ /// App.xaml の相互作用ロジック
+ ///
+ public partial class App : Application
+ {
+ protected override void OnExit(ExitEventArgs e)
+ {
+ //アプリケーション終了時にデフォルト設定に戻す。(安全のため)
+ Model.Instance.SetDefault();
+ }
+ }
+}
diff --git a/PocketFanController/MainWindow.xaml b/PocketFanController/MainWindow.xaml
new file mode 100644
index 0000000..7676f68
--- /dev/null
+++ b/PocketFanController/MainWindow.xaml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/PocketFanController/MainWindow.xaml.cs b/PocketFanController/MainWindow.xaml.cs
new file mode 100644
index 0000000..fc7b5ce
--- /dev/null
+++ b/PocketFanController/MainWindow.xaml.cs
@@ -0,0 +1,15 @@
+using System.Windows;
+
+namespace PocketFanController
+{
+ ///
+ /// MainWindow.xaml の相互作用ロジック
+ ///
+ public partial class MainWindow : Window
+ {
+ public MainWindow()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/PocketFanController/Model.cs b/PocketFanController/Model.cs
new file mode 100644
index 0000000..75b9f53
--- /dev/null
+++ b/PocketFanController/Model.cs
@@ -0,0 +1,115 @@
+using System;
+using System.Linq;
+using System.Diagnostics;
+using Microsoft.Win32;
+
+namespace PocketFanController
+{
+ public sealed class Model
+ {
+ // Singleton instance.
+ public static Model Instance { get; } = new Model();
+ private Model(){}
+
+ public int CurrentState { get; set; } = 0;
+
+ public void GetCurrentStatus()
+ {
+ var state0 = new[] {40, 60, 75};
+ var state1 = new[] {99, 99, 10};
+ var state2 = new[] {99, 10, 99};
+ var state3 = new[] {10, 99, 99};
+ var states = new[] {state0, state1, state2, state3};
+
+ var t0 = ReadReg(@"SYSTEM\CurrentControlSet\Services\wfan0109", "t0");
+ var t1 = ReadReg(@"SYSTEM\CurrentControlSet\Services\wfan0109", "t1");
+ var t2 = ReadReg(@"SYSTEM\CurrentControlSet\Services\wfan0109", "t2");
+ var current = new[] {t0, t1, t2};
+
+ foreach (var s in states.Select((value, index) => new {Value = value, Index = index}))
+ {
+ if (s.Value.SequenceEqual(current))
+ {
+ CurrentState = s.Index;
+ }
+ }
+ }
+
+ public void SetDefault()
+ {
+ WriteReg(@"SYSTEM\CurrentControlSet\Services\wfan0109", "t0", 40);
+ WriteReg(@"SYSTEM\CurrentControlSet\Services\wfan0109", "t1", 60);
+ WriteReg(@"SYSTEM\CurrentControlSet\Services\wfan0109", "t2", 75);
+ RestartService();
+ }
+
+ public void SetLow()
+ {
+ WriteReg(@"SYSTEM\CurrentControlSet\Services\wfan0109", "t0", 10);
+ WriteReg(@"SYSTEM\CurrentControlSet\Services\wfan0109", "t1", 99);
+ WriteReg(@"SYSTEM\CurrentControlSet\Services\wfan0109", "t2", 99);
+ RestartService();
+ }
+
+ public void SetMiddle()
+ {
+ WriteReg(@"SYSTEM\CurrentControlSet\Services\wfan0109", "t0", 99);
+ WriteReg(@"SYSTEM\CurrentControlSet\Services\wfan0109", "t1", 10);
+ WriteReg(@"SYSTEM\CurrentControlSet\Services\wfan0109", "t2", 99);
+ RestartService();
+ }
+
+ public void SetFast()
+ {
+ WriteReg(@"SYSTEM\CurrentControlSet\Services\wfan0109", "t0", 99);
+ WriteReg(@"SYSTEM\CurrentControlSet\Services\wfan0109", "t1", 99);
+ WriteReg(@"SYSTEM\CurrentControlSet\Services\wfan0109", "t2", 10);
+ RestartService();
+ }
+
+ public void WriteReg(string subKey, string keyName, int value)
+ {
+ var key = Registry.LocalMachine.CreateSubKey(subKey);
+ key?.SetValue(keyName, value, RegistryValueKind.DWord);
+ key?.Close();
+ }
+
+ public int ReadReg(string subKey, string keyName)
+ {
+ try
+ {
+ var key = Registry.LocalMachine.OpenSubKey(subKey);
+ if (key != null) return (int)key.GetValue(keyName);
+ }
+ catch
+ {
+ return 0;
+
+ }
+ return 0;
+ }
+
+ public void RestartService()
+ {
+ //サービスを停止したり再起動できないので、exeをkillする
+ var oldProcessesprocess = Process.GetProcessesByName("FanMonitorService");
+ foreach (var p in oldProcessesprocess)
+ {
+ p.Kill();
+ }
+
+ //サービスのスタートがアプリ側からできないので、コマンドプロンプトからスタートさせる
+ var cmd = new Process
+ {
+ StartInfo =
+ {
+ FileName = Environment.GetEnvironmentVariable("ComSpec"),
+ CreateNoWindow = true,
+ UseShellExecute = false,
+ Arguments = @"/c net start ""Fan Monitor"""
+ }
+ };
+ cmd.Start();
+ }
+ }
+}
\ No newline at end of file
diff --git a/PocketFanController/PocketFanController.csproj b/PocketFanController/PocketFanController.csproj
new file mode 100644
index 0000000..4270b09
--- /dev/null
+++ b/PocketFanController/PocketFanController.csproj
@@ -0,0 +1,106 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {8623A908-1563-46EE-98E5-0539DF3ED417}
+ WinExe
+ PocketFanController
+ PocketFanController
+ v4.5.2
+ 512
+ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ 4
+ true
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+ app.manifest
+
+
+
+
+
+
+
+
+
+
+
+
+ 4.0
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+ App.xaml
+ Code
+
+
+ MainWindow.xaml
+ Code
+
+
+
+
+
+ Code
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ Settings.settings
+ True
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/PocketFanController/Properties/AssemblyInfo.cs b/PocketFanController/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..826f1b4
--- /dev/null
+++ b/PocketFanController/Properties/AssemblyInfo.cs
@@ -0,0 +1,57 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。
+// アセンブリに関連付けられている情報を変更するには、
+// これらの属性値を変更してください。
+[assembly: AssemblyTitle("Pocket Fan Controller")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Pocket Fan Controller")]
+[assembly: AssemblyCopyright("Copyright © Takafumi Miyake 2017")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// ComVisible を false に設定すると、このアセンブリ内の型は COM コンポーネントから
+// 参照できなくなります。COM からこのアセンブリ内の型にアクセスする必要がある場合は、
+// その型の ComVisible 属性を true に設定してください。
+[assembly: ComVisible(false)]
+
+//ローカライズ可能なアプリケーションのビルドを開始するには、
+//.csproj ファイルの CultureYouAreCodingWith を
+// 内部で設定します。たとえば、
+//ソース ファイルで英語を使用している場合、 を en-US に設定します。次に、
+//下の NeutralResourceLanguage 属性のコメントを解除します。下の行の "en-US" を
+//プロジェクト ファイルの UICulture 設定と一致するよう更新します。
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //テーマ固有のリソース ディクショナリが置かれている場所
+ //(リソースがページ、
+ //またはアプリケーション リソース ディクショナリに見つからない場合に使用されます)
+ ResourceDictionaryLocation.SourceAssembly //汎用リソース ディクショナリが置かれている場所
+ //(リソースがページ、
+ //アプリケーション、またはいずれのテーマ固有のリソース ディクショナリにも見つからない場合に使用されます)
+)]
+
+
+// アセンブリのバージョン情報は次の 4 つの値で構成されています:
+//
+// メジャー バージョン
+// マイナー バージョン
+// ビルド番号
+// Revision
+//
+// すべての値を指定するか、次を使用してビルド番号とリビジョン番号を既定に設定できます
+// 既定値にすることができます:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("0.1.0.0")]
+[assembly: AssemblyFileVersion("0.1.0.0")]
+[assembly: NeutralResourcesLanguage("en")]
+
diff --git a/PocketFanController/Properties/Resources.Designer.cs b/PocketFanController/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..d218736
--- /dev/null
+++ b/PocketFanController/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+//
+// このコードはツールによって生成されました。
+// ランタイム バージョン:4.0.30319.42000
+//
+// このファイルへの変更は、以下の状況下で不正な動作の原因になったり、
+// コードが再生成されるときに損失したりします
+//
+//------------------------------------------------------------------------------
+
+namespace PocketFanController.Properties
+{
+
+
+ ///
+ /// ローカライズされた文字列などを検索するための、厳密に型指定されたリソース クラスです。
+ ///
+ // このクラスは StronglyTypedResourceBuilder クラスによって ResGen
+ // または Visual Studio のようなツールを使用して自動生成されました。
+ // メンバーを追加または削除するには、.ResX ファイルを編集して、/str オプションと共に
+ // ResGen を実行し直すか、または VS プロジェクトをリビルドします。
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ ///
+ /// このクラスで使用されるキャッシュされた ResourceManager インスタンスを返します。
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PocketFanController.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// 厳密に型指定されたこのリソース クラスを使用して、すべての検索リソースに対し、
+ /// 現在のスレッドの CurrentUICulture プロパティをオーバーライドします。
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/PocketFanController/Properties/Resources.resx b/PocketFanController/Properties/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/PocketFanController/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/PocketFanController/Properties/Settings.Designer.cs b/PocketFanController/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..2148ac1
--- /dev/null
+++ b/PocketFanController/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace PocketFanController.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/PocketFanController/Properties/Settings.settings b/PocketFanController/Properties/Settings.settings
new file mode 100644
index 0000000..033d7a5
--- /dev/null
+++ b/PocketFanController/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/PocketFanController/RelayCommand.cs b/PocketFanController/RelayCommand.cs
new file mode 100644
index 0000000..a2902f8
--- /dev/null
+++ b/PocketFanController/RelayCommand.cs
@@ -0,0 +1,39 @@
+using System;
+using System.Windows.Input;
+
+namespace PocketFanController
+{
+ public class RelayCommand : ICommand
+ {
+ private readonly Action _execute;
+ private readonly Func _canExecute;
+
+ public event EventHandler CanExecuteChanged;
+
+ public RelayCommand(Action execute) : this(execute, null)
+ {
+ }
+
+ public RelayCommand(Action execute, Func canExecute)
+ {
+ _execute = execute ?? throw new ArgumentNullException(nameof(execute));
+ _canExecute = canExecute;
+ }
+
+ public bool CanExecute(object parameter)
+ {
+ return _canExecute?.Invoke() ?? true;
+ }
+
+ public void Execute(object parameter)
+ {
+ _execute();
+ }
+
+ public void RaiseCanExecuteChanged()
+ {
+ var handler = CanExecuteChanged;
+ handler?.Invoke(this, EventArgs.Empty);
+ }
+ }
+}
\ No newline at end of file
diff --git a/PocketFanController/ViewModel.cs b/PocketFanController/ViewModel.cs
new file mode 100644
index 0000000..d7ea7ad
--- /dev/null
+++ b/PocketFanController/ViewModel.cs
@@ -0,0 +1,74 @@
+using System.Windows.Input;
+
+namespace PocketFanController
+{
+ public class ViewModel:ViewModelBase
+ {
+ private Model Model = Model.Instance;
+
+ public ICommand SetDefault { get; }
+ public ICommand SetLow { get; }
+ public ICommand SetMiddle { get; }
+ public ICommand SetFast { get; }
+
+ public ViewModel()
+ {
+ SetDefault = new RelayCommand(()=>
+ {
+ Model.SetDefault();
+ CurrentState = 0;
+ });
+
+ SetLow = new RelayCommand(() =>
+ {
+ Model.SetLow();
+ CurrentState = 3;
+ });
+
+ SetMiddle = new RelayCommand(() =>
+ {
+ Model.SetMiddle();
+ CurrentState = 2;
+ });
+
+ SetFast = new RelayCommand(() =>
+ {
+ Model.SetFast();
+ CurrentState = 1;
+ });
+
+ Model.GetCurrentStatus();
+ }
+
+ public int CurrentState
+ {
+ get => Model.CurrentState;
+ set
+ {
+ Model.CurrentState = value;
+ OnPropertyChanged("CurrentStateText");
+ }
+ }
+
+ public string CurrentStateText
+ {
+ get
+ {
+ switch (CurrentState)
+ {
+ case 0:
+ return "Current status : Auto (Default)";
+ case 1:
+ return "Current status : Fastest";
+ case 2:
+ return "Current status : Fast";
+ case 3:
+ return "Current status : Slow";
+ default:
+ return "Current status : Auto (Default)";
+ }
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/PocketFanController/ViewModelBase.cs b/PocketFanController/ViewModelBase.cs
new file mode 100644
index 0000000..f5ccdc0
--- /dev/null
+++ b/PocketFanController/ViewModelBase.cs
@@ -0,0 +1,14 @@
+using System.ComponentModel;
+
+namespace PocketFanController
+{
+ public class ViewModelBase : INotifyPropertyChanged
+ {
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ protected virtual void OnPropertyChanged(string propertyName)
+ {
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
+ }
+ }
+}
\ No newline at end of file
diff --git a/PocketFanController/app.manifest b/PocketFanController/app.manifest
new file mode 100644
index 0000000..2b2b996
--- /dev/null
+++ b/PocketFanController/app.manifest
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..b1eb0a2
--- /dev/null
+++ b/README.md
@@ -0,0 +1,10 @@
+# Pocket Fan Controller
+
+Manually set the fan speed of "GPD Pocket".
+It can be set in 3 stages.
+For safety reasons, it returns to the default (automatic) at the end of the application.
+
+In the unlikely event the hardware may break down.
+Please use at your own risk.
+
+![Screenshot](https://github.com/t-miyake/PocketFanController/blob/master/Screenshot.png)
\ No newline at end of file
diff --git a/Screenshot.png b/Screenshot.png
new file mode 100644
index 0000000..7c2db21
Binary files /dev/null and b/Screenshot.png differ