├── Egorka
├── Properties
│ ├── Resources.ru.Designer.cs
│ ├── Settings.settings
│ ├── Settings.Designer.cs
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ └── Resources.ru.resx
├── MainGameController.cs
├── packages.config
├── CharData.cs
├── App.config
├── IEgorkaSettings.cs
├── IMainGameView.cs
├── Program.cs
├── Resources
│ ├── keys.ru.txt
│ └── keys.txt
├── EgorkaSettings.cs
├── FullScreenForm.Designer.cs
├── FullScreenForm.resx
├── Egorka.csproj
└── FullScreenForm.cs
├── .nuget
├── NuGet.exe
├── NuGet.Config
└── NuGet.targets
├── BuildDictionary
├── App.config
├── Properties
│ ├── Settings.settings
│ ├── Settings.Designer.cs
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── Program.cs
├── KeyLoggingForm.cs
├── BuildDictionary.csproj
├── KeyLoggingForm.Designer.cs
└── KeyLoggingForm.resx
├── EgorkaTestProject
├── packages.config
├── app.config
├── Properties
│ └── AssemblyInfo.cs
├── EgorkaTestProject.csproj
└── EgorkaUnitTest.cs
├── README.md
├── LICENSE
├── EgorkaGame.sln
├── .gitignore
└── EgorkaGame.sln.DotSettings
/Egorka/Properties/Resources.ru.Designer.cs:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.nuget/NuGet.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/igolets/EgorkaGame/HEAD/.nuget/NuGet.exe
--------------------------------------------------------------------------------
/Egorka/MainGameController.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/igolets/EgorkaGame/HEAD/Egorka/MainGameController.cs
--------------------------------------------------------------------------------
/Egorka/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.nuget/NuGet.Config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/BuildDictionary/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/EgorkaTestProject/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Egorka/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/BuildDictionary/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/EgorkaTestProject/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Egorka/CharData.cs:
--------------------------------------------------------------------------------
1 | using System.Drawing;
2 |
3 | namespace EgorkaGame.Egorka
4 | {
5 | public struct CharData
6 | {
7 | #region Properties
8 |
9 | public int BeepFrequency
10 | {
11 | get;
12 | set;
13 | }
14 |
15 | public char Character
16 | {
17 | get;
18 | set;
19 | }
20 |
21 | public Color Color
22 | {
23 | get;
24 | set;
25 | }
26 |
27 | #endregion
28 | }
29 | }
--------------------------------------------------------------------------------
/Egorka/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/BuildDictionary/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 |
4 | namespace EgorkaGame.BuildDictionary
5 | {
6 | static class Program
7 | {
8 | ///
9 | /// The main entry point for the application.
10 | ///
11 | [STAThread]
12 | static void Main()
13 | {
14 | Application.EnableVisualStyles();
15 | Application.SetCompatibleTextRenderingDefault(false);
16 | Application.Run(new KeyLoggingForm());
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Egorka/IEgorkaSettings.cs:
--------------------------------------------------------------------------------
1 | using System.Globalization;
2 |
3 | namespace EgorkaGame.Egorka
4 | {
5 | public interface IEgorkaSettings
6 | {
7 | CultureInfo CultureInfo
8 | {
9 | get;
10 | }
11 |
12 | bool IsSpeechEnabled
13 | {
14 | get;
15 | }
16 |
17 | int SpeechVolume
18 | {
19 | get;
20 | }
21 |
22 | int SpeechRate
23 | {
24 | get;
25 | }
26 |
27 | string SpeechIntro
28 | {
29 | get;
30 | }
31 | }
32 | }
--------------------------------------------------------------------------------
/Egorka/IMainGameView.cs:
--------------------------------------------------------------------------------
1 | using System.Drawing;
2 |
3 | namespace EgorkaGame.Egorka
4 | {
5 | ///
6 | /// View interface implementing MVC pattern
7 | ///
8 | public interface IMainGameView
9 | {
10 | Color ScreenColor
11 | {
12 | get;
13 | set;
14 | }
15 |
16 | string DisplayText
17 | {
18 | get;
19 | set;
20 | }
21 |
22 | void PlaySound(int beepFrequency, int beepDurationInMs);
23 |
24 | void ReadAloud(char character);
25 |
26 | void SubscribeGlobalEvents();
27 |
28 | }
29 | }
--------------------------------------------------------------------------------
/Egorka/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading;
3 | using System.Windows.Forms;
4 |
5 | namespace EgorkaGame.Egorka
6 | {
7 | static class Program
8 | {
9 | ///
10 | /// The main entry point for the application.
11 | ///
12 | [STAThread]
13 | static void Main()
14 | {
15 | Application.EnableVisualStyles();
16 | Application.SetCompatibleTextRenderingDefault(false);
17 | Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture = EgorkaSettings.Instance.CultureInfo;
18 |
19 | Application.Run(new FullScreenForm());
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # A simple game to entertain a baby of 0-1 year
2 |
3 | ## Features
4 |
5 | * Runs in full screen
6 | * Blocks mouse events
7 | * Blocks simple keys that can close game or switch task (Use Alt-F4 to exit)
8 | * Changes screen color on key down
9 | * Displays key char on key down (**Localizable!** EN and RU are supported)
10 | * Plays a tone (euivalents to piano keys #25 and higher)
11 |
12 | ## Requirements
13 |
14 | * .Net 4.5 or higher (could be re-compiled to lower versions if needed)
15 | * Keyboard
16 | * Monitor of any resolution
17 | * (Optional) speakers
18 |
19 | ## Uses third-party tools
20 |
21 | * [Moq](https://github.com/Moq/moq4)
22 | * [MouseKeyHook](https://github.com/gmamaladze/globalmousekeyhook)
23 | * [Shouldly](https://github.com/shouldly/shouldly)
24 |
25 | ## Author
26 | Ilya Golets (ilya@golets.ru)
27 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Ilya Golets
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/Egorka/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace EgorkaGame.Egorka.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/BuildDictionary/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace EgorkaGame.BuildDictionary.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Egorka/Resources/keys.ru.txt:
--------------------------------------------------------------------------------
1 | Oemtilde ` BlanchedAlmond
2 | D1 1 Blue
3 | D2 2 BlueViolet
4 | D3 3 Brown
5 | D4 4 BurlyWood
6 | D5 5 CadetBlue
7 | D6 6 Chartreuse
8 | D7 7 Chocolate
9 | D8 8 Coral
10 | D9 ( CornflowerBlue
11 | D0 ) LightSteelBlue
12 | OemMinus - Crimson
13 | Oemplus = Cyan
14 | Tab → DarkBlue
15 | Q Й DarkCyan
16 | W Ц DarkGoldenrod
17 | E У Lime
18 | R К DarkGreen
19 | T Е DarkKhaki
20 | Y Н DarkMagenta
21 | U Г DarkOliveGreen
22 | I Ш DarkOrange
23 | O Щ DarkOrchid
24 | P З DarkRed
25 | OemOpenBrackets Х DarkSalmon
26 | Oem6 Ъ DarkSeaGreen
27 | Oem5 \ DarkSlateBlue
28 | A Ф DarkSlateGray
29 | S Ы DarkTurquoise
30 | D В DarkViolet
31 | F А DeepPink
32 | G П DeepSkyBlue
33 | H Р LimeGreen
34 | J О DodgerBlue
35 | K Л Firebrick
36 | L Д Linen
37 | Oem1 Ж ForestGreen
38 | Oem7 Э Fuchsia
39 | Z Я Magenta
40 | X Ч GhostWhite
41 | C С Gold
42 | V М Goldenrod
43 | B И Maroon
44 | N Т Green
45 | M Ь GreenYellow
46 | Oemcomma Б MediumAquamarine
47 | OemPeriod Ю HotPink
48 | OemQuestion / IndianRed
49 | Space ҉ Indigo
50 | Back ← LightYellow
51 | Divide / Khaki
52 | Multiply * MediumBlue
53 | Subtract - MediumOrchid
54 | NumPad7 7 LawnGreen
55 | NumPad8 8 MediumPurple
56 | NumPad9 9 LightBlue
57 | NumPad4 4 LightCoral
58 | NumPad5 5 MediumSeaGreen
59 | NumPad6 6 LightGoldenrodYellow
60 | NumPad1 1 MediumSlateBlue
61 | NumPad2 2 LightGreen
62 | NumPad3 3 LightPink
63 | NumPad0 0 LightSalmon
64 | Decimal . LightSeaGreen
65 | Add + LightSkyBlue
66 | Return ¶ MediumSpringGreen
--------------------------------------------------------------------------------
/Egorka/Resources/keys.txt:
--------------------------------------------------------------------------------
1 | Oemtilde ` BlanchedAlmond
2 | D1 1 Blue
3 | D2 2 BlueViolet
4 | D3 3 Brown
5 | D4 4 BurlyWood
6 | D5 5 CadetBlue
7 | D6 6 Chartreuse
8 | D7 7 Chocolate
9 | D8 8 Coral
10 | D9 ( CornflowerBlue
11 | D0 ) LightSteelBlue
12 | OemMinus - Crimson
13 | Oemplus = Cyan
14 | Tab → DarkBlue
15 | Q Q DarkCyan
16 | W W DarkGoldenrod
17 | E E Lime
18 | R R DarkGreen
19 | T T DarkKhaki
20 | Y Y DarkMagenta
21 | U U DarkOliveGreen
22 | I I DarkOrange
23 | O O DarkOrchid
24 | P P DarkRed
25 | OemOpenBrackets [ DarkSalmon
26 | Oem6 ] DarkSeaGreen
27 | Oem5 \ DarkSlateBlue
28 | A A DarkSlateGray
29 | S S DarkTurquoise
30 | D D DarkViolet
31 | F F DeepPink
32 | G G DeepSkyBlue
33 | H H LimeGreen
34 | J J DodgerBlue
35 | K K Firebrick
36 | L L Linen
37 | Oem1 ; ForestGreen
38 | Oem7 ' Fuchsia
39 | Z Z Magenta
40 | X X GhostWhite
41 | C C Gold
42 | V V Goldenrod
43 | B B Maroon
44 | N N Green
45 | M M GreenYellow
46 | Oemcomma , MediumAquamarine
47 | OemPeriod . HotPink
48 | OemQuestion / IndianRed
49 | Space ҉ Indigo
50 | Back ← LightYellow
51 | Divide / Khaki
52 | Multiply * MediumBlue
53 | Subtract - MediumOrchid
54 | NumPad7 7 LawnGreen
55 | NumPad8 8 MediumPurple
56 | NumPad9 9 LightBlue
57 | NumPad4 4 LightCoral
58 | NumPad5 5 MediumSeaGreen
59 | NumPad6 6 LightGoldenrodYellow
60 | NumPad1 1 MediumSlateBlue
61 | NumPad2 2 LightGreen
62 | NumPad3 3 LightPink
63 | NumPad0 0 LightSalmon
64 | Decimal . LightSeaGreen
65 | Add + LightSkyBlue
66 | Return ¶ MediumSpringGreen
--------------------------------------------------------------------------------
/EgorkaTestProject/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("EgorkaTestProject")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("EgorkaTestProject")]
13 | [assembly: AssemblyCopyright("Copyright © 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("72033bfe-7673-462d-b9e7-2d262854d8a8")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Egorka/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("Egorka game")]
8 | [assembly: AssemblyDescription("Simple visual game for kids")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("Egorka")]
12 | [assembly: AssemblyCopyright("Copyright © Ilya Golets 2015")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Setting ComVisible to false makes the types in this assembly not visible
17 | // to COM components. If you need to access a type in this assembly from
18 | // COM, set the ComVisible attribute to true on that type.
19 | [assembly: ComVisible(false)]
20 |
21 | // The following GUID is for the ID of the typelib if this project is exposed to COM
22 | [assembly: Guid("310a93df-2044-4ea8-9147-0a10a4fb3e00")]
23 |
24 | // Version information for an assembly consists of the following four values:
25 | //
26 | // Major Version
27 | // Minor Version
28 | // Build Number
29 | // Revision
30 | //
31 | // You can specify all the values or you can default the Build and Revision Numbers
32 | // by using the '*' as shown below:
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 | [assembly: System.Resources.NeutralResourcesLanguage("en-US")]
--------------------------------------------------------------------------------
/BuildDictionary/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("Dictionary builder")]
8 | [assembly: AssemblyDescription("Build dictionary for Egorka game")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("Egorka")]
12 | [assembly: AssemblyCopyright("Copyright © Ilya Golets 2015")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Setting ComVisible to false makes the types in this assembly not visible
17 | // to COM components. If you need to access a type in this assembly from
18 | // COM, set the ComVisible attribute to true on that type.
19 | [assembly: ComVisible(false)]
20 |
21 | // The following GUID is for the ID of the typelib if this project is exposed to COM
22 | [assembly: Guid("655c2c62-ccc5-42d9-9072-ec69916fb25c")]
23 |
24 | // Version information for an assembly consists of the following four values:
25 | //
26 | // Major Version
27 | // Minor Version
28 | // Build Number
29 | // Revision
30 | //
31 | // You can specify all the values or you can default the Build and Revision Numbers
32 | // by using the '*' as shown below:
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 | [assembly: System.Resources.NeutralResourcesLanguage("en-US")]
--------------------------------------------------------------------------------
/Egorka/EgorkaSettings.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Configuration;
3 | using System.Globalization;
4 |
5 | namespace EgorkaGame.Egorka
6 | {
7 | public class EgorkaSettings : ConfigurationSection, IEgorkaSettings
8 | {
9 | #region Statics
10 |
11 | #region Properties
12 |
13 | public static EgorkaSettings Instance
14 | {
15 | get
16 | {
17 | // read http://csharpindepth.com/articles/general/singleton.aspx for more info
18 | return Lazy.Value;
19 | }
20 | }
21 |
22 | #endregion
23 |
24 | #region Fields
25 |
26 | private static readonly Lazy Lazy = new Lazy(() => (EgorkaSettings)ConfigurationManager.GetSection("egorkaSettings"));
27 |
28 | #endregion
29 |
30 | #endregion
31 |
32 | #region Constructors
33 |
34 | private EgorkaSettings()
35 | {
36 | }
37 |
38 | #endregion
39 |
40 | #region Public properties
41 |
42 | [ConfigurationProperty("culture")]
43 | public CultureInfo CultureInfo
44 | {
45 | get
46 | {
47 | return (CultureInfo)this["culture"];
48 | }
49 | set
50 | {
51 | }
52 | }
53 |
54 | [ConfigurationProperty("IsSpeechEnabled")]
55 | public bool IsSpeechEnabled
56 | {
57 | get
58 | {
59 | return (bool)this["IsSpeechEnabled"];
60 | }
61 | }
62 |
63 | [ConfigurationProperty("SpeechVolume")]
64 | public int SpeechVolume
65 | {
66 | get
67 | {
68 | return (int)this["SpeechVolume"];
69 | }
70 | }
71 |
72 | [ConfigurationProperty("SpeechRate")]
73 | public int SpeechRate
74 | {
75 | get
76 | {
77 | return (int)this["SpeechRate"];
78 | }
79 | }
80 |
81 | [ConfigurationProperty("SpeechIntro")]
82 | public string SpeechIntro
83 | {
84 | get
85 | {
86 | return (string)this["SpeechIntro"];
87 | }
88 | }
89 |
90 | #endregion
91 | }
92 | }
--------------------------------------------------------------------------------
/EgorkaGame.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2012
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BuildDictionary", "BuildDictionary\BuildDictionary.csproj", "{D98607B6-B9DF-4B2D-8D6B-470FFEC332DC}"
5 | EndProject
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Egorka", "Egorka\Egorka.csproj", "{7B362EFC-21BE-4004-9EC0-8EE93EEA5624}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EgorkaTestProject", "EgorkaTestProject\EgorkaTestProject.csproj", "{366023F8-7687-4AE7-8EA0-ED7070A40CDF}"
9 | EndProject
10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{5DD1441E-D7E8-4199-9752-99FE77E769CE}"
11 | ProjectSection(SolutionItems) = preProject
12 | .nuget\NuGet.Config = .nuget\NuGet.Config
13 | .nuget\NuGet.exe = .nuget\NuGet.exe
14 | .nuget\NuGet.targets = .nuget\NuGet.targets
15 | EndProjectSection
16 | EndProject
17 | Global
18 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
19 | Debug|Any CPU = Debug|Any CPU
20 | Release|Any CPU = Release|Any CPU
21 | EndGlobalSection
22 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
23 | {D98607B6-B9DF-4B2D-8D6B-470FFEC332DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
24 | {D98607B6-B9DF-4B2D-8D6B-470FFEC332DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
25 | {D98607B6-B9DF-4B2D-8D6B-470FFEC332DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
26 | {D98607B6-B9DF-4B2D-8D6B-470FFEC332DC}.Release|Any CPU.Build.0 = Release|Any CPU
27 | {7B362EFC-21BE-4004-9EC0-8EE93EEA5624}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
28 | {7B362EFC-21BE-4004-9EC0-8EE93EEA5624}.Debug|Any CPU.Build.0 = Debug|Any CPU
29 | {7B362EFC-21BE-4004-9EC0-8EE93EEA5624}.Release|Any CPU.ActiveCfg = Release|Any CPU
30 | {7B362EFC-21BE-4004-9EC0-8EE93EEA5624}.Release|Any CPU.Build.0 = Release|Any CPU
31 | {366023F8-7687-4AE7-8EA0-ED7070A40CDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
32 | {366023F8-7687-4AE7-8EA0-ED7070A40CDF}.Debug|Any CPU.Build.0 = Debug|Any CPU
33 | {366023F8-7687-4AE7-8EA0-ED7070A40CDF}.Release|Any CPU.ActiveCfg = Release|Any CPU
34 | {366023F8-7687-4AE7-8EA0-ED7070A40CDF}.Release|Any CPU.Build.0 = Release|Any CPU
35 | EndGlobalSection
36 | GlobalSection(SolutionProperties) = preSolution
37 | HideSolutionNode = FALSE
38 | EndGlobalSection
39 | EndGlobal
40 |
--------------------------------------------------------------------------------
/Egorka/FullScreenForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace EgorkaGame.Egorka
2 | {
3 | partial class FullScreenForm
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.lblLetter = new System.Windows.Forms.Label();
32 | this.SuspendLayout();
33 | //
34 | // lblLetter
35 | //
36 | this.lblLetter.Dock = System.Windows.Forms.DockStyle.Fill;
37 | this.lblLetter.Font = new System.Drawing.Font("Arial", 120F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
38 | this.lblLetter.Location = new System.Drawing.Point(0, 0);
39 | this.lblLetter.Name = "lblLetter";
40 | this.lblLetter.Size = new System.Drawing.Size(963, 941);
41 | this.lblLetter.TabIndex = 0;
42 | this.lblLetter.Text = "A";
43 | this.lblLetter.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
44 | //
45 | // FullScreenForm
46 | //
47 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
48 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
49 | this.ClientSize = new System.Drawing.Size(963, 941);
50 | this.Controls.Add(this.lblLetter);
51 | this.Name = "FullScreenForm";
52 | this.Text = "Form1";
53 | this.Load += new System.EventHandler(this.Form1_Load);
54 | this.ResumeLayout(false);
55 |
56 | }
57 |
58 | #endregion
59 |
60 | private System.Windows.Forms.Label lblLetter;
61 | }
62 | }
63 |
64 |
--------------------------------------------------------------------------------
/BuildDictionary/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace EgorkaGame.BuildDictionary.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("EgorkaGame.BuildDictionary.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/BuildDictionary/KeyLoggingForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Drawing;
4 | using System.IO;
5 | using System.Windows.Forms;
6 |
7 | namespace EgorkaGame.BuildDictionary
8 | {
9 | public partial class KeyLoggingForm : Form
10 | {
11 | #region Constructors
12 |
13 | public KeyLoggingForm()
14 | {
15 | InitializeComponent();
16 | ActiveControl = null;
17 | }
18 |
19 | #endregion Constructors
20 |
21 | #region Private methods
22 |
23 | private void Form1_KeyDown(object sender, KeyEventArgs e)
24 | {
25 | _keyCode = e.KeyCode;
26 | }
27 |
28 | private void Form1_KeyPress(object sender, KeyPressEventArgs e)
29 | {
30 | var character = e.KeyChar.ToString().ToUpper()[0];
31 | _chars[_keyCode] = character;
32 | lblDicSize.Text = _chars.Count.ToString();
33 | lblLastPair.Text = String.Format("{0} - {1}", _keyCode, character);
34 | }
35 |
36 | private void btnReset_Click(object sender, EventArgs e)
37 | {
38 | _chars.Clear();
39 | lblDicSize.Text = lblLastPair.Text = "";
40 | ActiveControl = null;
41 | }
42 |
43 | private void btnSave_Click(object sender, EventArgs e)
44 | {
45 | SaveData();
46 | ActiveControl = null;
47 | }
48 |
49 | private bool SaveData()
50 | {
51 | if (saveFileDialog1.ShowDialog() != DialogResult.OK)
52 | {
53 | return false;
54 | }
55 |
56 | var colorsArray = Enum.GetValues(typeof(KnownColor));
57 | var allColors = new KnownColor[colorsArray.Length];
58 | Array.Copy(colorsArray, allColors, colorsArray.Length);
59 | var startInd = Array.IndexOf(allColors, KnownColor.Black) + 1;
60 |
61 | using (var file = File.CreateText(saveFileDialog1.FileName))
62 | {
63 | foreach (var pair in _chars)
64 | {
65 | file.WriteLine("{0}\0{1}\0{2}", pair.Key, pair.Value, allColors[startInd++]);
66 | }
67 | file.Close();
68 | }
69 | return true;
70 | }
71 |
72 | private void Form1_FormClosing(object sender, FormClosingEventArgs e)
73 | {
74 | if (_chars.Count > 0)
75 | {
76 | if (MessageBox.Show(
77 | @"Сохранить введенные данные?",
78 | @"Подтвердите закрытие",
79 | MessageBoxButtons.YesNo,
80 | MessageBoxIcon.Question) == DialogResult.No)
81 | {
82 | return;
83 | }
84 |
85 | if (!SaveData())
86 | {
87 | e.Cancel = true;
88 | }
89 | }
90 | }
91 |
92 | #endregion Private methods
93 |
94 | #region Fields
95 |
96 | private Keys _keyCode;
97 | private readonly Dictionary _chars = new Dictionary();
98 |
99 | #endregion Fields
100 | }
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 Studo 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 | *_i.c
42 | *_p.c
43 | *_i.h
44 | *.ilk
45 | *.meta
46 | *.obj
47 | *.pch
48 | *.pdb
49 | *.pgc
50 | *.pgd
51 | *.rsp
52 | *.sbr
53 | *.tlb
54 | *.tli
55 | *.tlh
56 | *.tmp
57 | *.tmp_proj
58 | *.log
59 | *.vspscc
60 | *.vssscc
61 | .builds
62 | *.pidb
63 | *.svclog
64 | *.scc
65 |
66 | # Chutzpah Test files
67 | _Chutzpah*
68 |
69 | # Visual C++ cache files
70 | ipch/
71 | *.aps
72 | *.ncb
73 | *.opensdf
74 | *.sdf
75 | *.cachefile
76 |
77 | # Visual Studio profiler
78 | *.psess
79 | *.vsp
80 | *.vspx
81 |
82 | # TFS 2012 Local Workspace
83 | $tf/
84 |
85 | # Guidance Automation Toolkit
86 | *.gpState
87 |
88 | # ReSharper is a .NET coding add-in
89 | _ReSharper*/
90 | *.[Rr]e[Ss]harper
91 | *.DotSettings.user
92 |
93 | # JustCode is a .NET coding addin-in
94 | .JustCode
95 |
96 | # TeamCity is a build add-in
97 | _TeamCity*
98 |
99 | # DotCover is a Code Coverage Tool
100 | *.dotCover
101 |
102 | # NCrunch
103 | _NCrunch_*
104 | .*crunch*.local.xml
105 |
106 | # MightyMoose
107 | *.mm.*
108 | AutoTest.Net/
109 |
110 | # Web workbench (sass)
111 | .sass-cache/
112 |
113 | # Installshield output folder
114 | [Ee]xpress/
115 |
116 | # DocProject is a documentation generator add-in
117 | DocProject/buildhelp/
118 | DocProject/Help/*.HxT
119 | DocProject/Help/*.HxC
120 | DocProject/Help/*.hhc
121 | DocProject/Help/*.hhk
122 | DocProject/Help/*.hhp
123 | DocProject/Help/Html2
124 | DocProject/Help/html
125 |
126 | # Click-Once directory
127 | publish/
128 |
129 | # Publish Web Output
130 | *.[Pp]ublish.xml
131 | *.azurePubxml
132 | # TODO: Comment the next line if you want to checkin your web deploy settings
133 | # but database connection strings (with potential passwords) will be unencrypted
134 | *.pubxml
135 | *.publishproj
136 |
137 | # NuGet Packages
138 | *.nupkg
139 | # The packages folder can be ignored because of Package Restore
140 | **/packages/*
141 | # except build/, which is used as an MSBuild target.
142 | !**/packages/build/
143 | # Uncomment if necessary however generally it will be regenerated when needed
144 | #!**/packages/repositories.config
145 |
146 | # Windows Azure Build Output
147 | csx/
148 | *.build.csdef
149 |
150 | # Windows Store app package directory
151 | AppPackages/
152 |
153 | # Others
154 | *.[Cc]ache
155 | ClientBin/
156 | [Ss]tyle[Cc]op.*
157 | ~$*
158 | *~
159 | *.dbmdl
160 | *.dbproj.schemaview
161 | *.pfx
162 | *.publishsettings
163 | node_modules/
164 | bower_components/
165 |
166 | # RIA/Silverlight projects
167 | Generated_Code/
168 |
169 | # Backup & report files from converting an old project file
170 | # to a newer Visual Studio version. Backup files are not needed,
171 | # because we have git ;-)
172 | _UpgradeReport_Files/
173 | Backup*/
174 | UpgradeLog*.XML
175 | UpgradeLog*.htm
176 |
177 | # SQL Server files
178 | *.mdf
179 | *.ldf
180 |
181 | # Business Intelligence projects
182 | *.rdl.data
183 | *.bim.layout
184 | *.bim_*.settings
185 |
186 | # Microsoft Fakes
187 | FakesAssemblies/
188 |
189 | # Node.js Tools for Visual Studio
190 | .ntvs_analysis.dat
191 |
192 | # Visual Studio 6 build log
193 | *.plg
194 |
195 | # Visual Studio 6 workspace options file
196 | *.opt
197 |
--------------------------------------------------------------------------------
/BuildDictionary/BuildDictionary.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {D98607B6-B9DF-4B2D-8D6B-470FFEC332DC}
8 | WinExe
9 | Properties
10 | EgorkaGame.BuildDictionary
11 | BuildDictionary
12 | v4.5
13 | 512
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 | Form
49 |
50 |
51 | KeyLoggingForm.cs
52 |
53 |
54 |
55 |
56 | KeyLoggingForm.cs
57 |
58 |
59 | ResXFileCodeGenerator
60 | Resources.Designer.cs
61 | Designer
62 |
63 |
64 | True
65 | Resources.resx
66 | True
67 |
68 |
69 | SettingsSingleFileGenerator
70 | Settings.Designer.cs
71 |
72 |
73 | True
74 | Settings.settings
75 | True
76 |
77 |
78 |
79 |
80 |
81 |
82 |
89 |
--------------------------------------------------------------------------------
/Egorka/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace EgorkaGame.Egorka.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("EgorkaGame.Egorka.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Looks up a localized string similar to Oemtilde`BlanchedAlmond
65 | ///D11Blue
66 | ///D22BlueViolet
67 | ///D33Brown
68 | ///D44BurlyWood
69 | ///D55CadetBlue
70 | ///D66Chartreuse
71 | ///D77Chocolate
72 | ///D88Coral
73 | ///D9(CornflowerBlue
74 | ///D0)Cornsilk
75 | ///OemMinus-Crimson
76 | ///Oemplus=Cyan
77 | ///Tab→DarkBlue
78 | ///QQDarkCyan
79 | ///WWDarkGoldenrod
80 | ///EEDarkGray
81 | ///RRDarkGreen
82 | ///TTDarkKhaki
83 | ///YYDarkMagenta
84 | ///UUDarkOliveGreen
85 | ///IIDarkOrange
86 | ///OODarkOrchid
87 | ///PPDarkRed
88 | ///OemOpenBrackets[DarkSalmon
89 | ///Oem6]DarkSeaGreen
90 | ///Oem5\DarkSlateBlue
91 | ///AADarkSlateGray
92 | ///SSDarkTurquoise
93 | ///DDDarkVi [rest of string was truncated]";.
94 | ///
95 | internal static string keys {
96 | get {
97 | return ResourceManager.GetString("keys", resourceCulture);
98 | }
99 | }
100 |
101 | ///
102 | /// Looks up a localized string similar to test.
103 | ///
104 | internal static string String1 {
105 | get {
106 | return ResourceManager.GetString("String1", resourceCulture);
107 | }
108 | }
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/BuildDictionary/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/BuildDictionary/KeyLoggingForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace EgorkaGame.BuildDictionary
2 | {
3 | partial class KeyLoggingForm
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.label1 = new System.Windows.Forms.Label();
32 | this.label2 = new System.Windows.Forms.Label();
33 | this.lblLastPair = new System.Windows.Forms.Label();
34 | this.lblDicSize = new System.Windows.Forms.Label();
35 | this.btnReset = new System.Windows.Forms.Button();
36 | this.btnSave = new System.Windows.Forms.Button();
37 | this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
38 | this.SuspendLayout();
39 | //
40 | // label1
41 | //
42 | this.label1.AutoSize = true;
43 | this.label1.Location = new System.Drawing.Point(18, 49);
44 | this.label1.Name = "label1";
45 | this.label1.Size = new System.Drawing.Size(94, 13);
46 | this.label1.TabIndex = 0;
47 | this.label1.Text = "Размер словаря:";
48 | //
49 | // label2
50 | //
51 | this.label2.AutoSize = true;
52 | this.label2.Location = new System.Drawing.Point(19, 77);
53 | this.label2.Name = "label2";
54 | this.label2.Size = new System.Drawing.Size(93, 13);
55 | this.label2.TabIndex = 1;
56 | this.label2.Text = "Последняя пара:";
57 | //
58 | // lblLastPair
59 | //
60 | this.lblLastPair.AutoSize = true;
61 | this.lblLastPair.Location = new System.Drawing.Point(119, 77);
62 | this.lblLastPair.Name = "lblLastPair";
63 | this.lblLastPair.Size = new System.Drawing.Size(10, 13);
64 | this.lblLastPair.TabIndex = 2;
65 | this.lblLastPair.Text = " ";
66 | //
67 | // lblDicSize
68 | //
69 | this.lblDicSize.AutoSize = true;
70 | this.lblDicSize.Location = new System.Drawing.Point(122, 48);
71 | this.lblDicSize.Name = "lblDicSize";
72 | this.lblDicSize.Size = new System.Drawing.Size(10, 13);
73 | this.lblDicSize.TabIndex = 3;
74 | this.lblDicSize.Text = " ";
75 | //
76 | // btnReset
77 | //
78 | this.btnReset.Location = new System.Drawing.Point(54, 151);
79 | this.btnReset.Name = "btnReset";
80 | this.btnReset.Size = new System.Drawing.Size(75, 23);
81 | this.btnReset.TabIndex = 4;
82 | this.btnReset.TabStop = false;
83 | this.btnReset.Text = "Сброс";
84 | this.btnReset.UseVisualStyleBackColor = true;
85 | this.btnReset.Click += new System.EventHandler(this.btnReset_Click);
86 | //
87 | // btnSave
88 | //
89 | this.btnSave.Location = new System.Drawing.Point(162, 151);
90 | this.btnSave.Name = "btnSave";
91 | this.btnSave.Size = new System.Drawing.Size(75, 23);
92 | this.btnSave.TabIndex = 5;
93 | this.btnSave.TabStop = false;
94 | this.btnSave.Text = "Сохранить";
95 | this.btnSave.UseVisualStyleBackColor = true;
96 | this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
97 | //
98 | // Form1
99 | //
100 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
101 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
102 | this.ClientSize = new System.Drawing.Size(284, 193);
103 | this.Controls.Add(this.btnSave);
104 | this.Controls.Add(this.btnReset);
105 | this.Controls.Add(this.lblDicSize);
106 | this.Controls.Add(this.lblLastPair);
107 | this.Controls.Add(this.label2);
108 | this.Controls.Add(this.label1);
109 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
110 | this.KeyPreview = true;
111 | this.MaximizeBox = false;
112 | this.MinimizeBox = false;
113 | this.Name = "Form1";
114 | this.Text = "Ввод словаря";
115 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
116 | this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown);
117 | this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.Form1_KeyPress);
118 | this.ResumeLayout(false);
119 | this.PerformLayout();
120 |
121 | }
122 |
123 | #endregion
124 |
125 | private System.Windows.Forms.Label label1;
126 | private System.Windows.Forms.Label label2;
127 | private System.Windows.Forms.Label lblLastPair;
128 | private System.Windows.Forms.Label lblDicSize;
129 | private System.Windows.Forms.Button btnReset;
130 | private System.Windows.Forms.Button btnSave;
131 | private System.Windows.Forms.SaveFileDialog saveFileDialog1;
132 | }
133 | }
134 |
135 |
--------------------------------------------------------------------------------
/Egorka/FullScreenForm.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 |
--------------------------------------------------------------------------------
/Egorka/Egorka.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {7B362EFC-21BE-4004-9EC0-8EE93EEA5624}
8 | WinExe
9 | Properties
10 | EgorkaGame.Egorka
11 | Egorka
12 | v4.5
13 | 512
14 | ..\
15 | true
16 |
17 |
18 | AnyCPU
19 | true
20 | full
21 | false
22 | bin\Debug\
23 | DEBUG;TRACE
24 | prompt
25 | 4
26 |
27 |
28 | AnyCPU
29 | pdbonly
30 | true
31 | bin\Release\
32 | TRACE
33 | prompt
34 | 4
35 |
36 |
37 |
38 | ..\packages\MouseKeyHook.5.3.0\lib\net40\Gma.System.MouseKeyHook.dll
39 | True
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | Form
59 |
60 |
61 | FullScreenForm.cs
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | FullScreenForm.cs
70 |
71 |
72 | ResXFileCodeGenerator
73 | Resources.Designer.cs
74 | Designer
75 |
76 |
77 | True
78 | Resources.resx
79 | True
80 |
81 |
82 | ResXFileCodeGenerator
83 | Resources.ru.Designer.cs
84 |
85 |
86 |
87 | SettingsSingleFileGenerator
88 | Settings.Designer.cs
89 |
90 |
91 | True
92 | True
93 | Resources.ru.resx
94 |
95 |
96 | True
97 | Settings.settings
98 | True
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 | This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
115 |
116 |
117 |
118 |
125 |
--------------------------------------------------------------------------------
/BuildDictionary/KeyLoggingForm.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 | 17, 17
122 |
123 |
--------------------------------------------------------------------------------
/EgorkaTestProject/EgorkaTestProject.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | {366023F8-7687-4AE7-8EA0-ED7070A40CDF}
7 | Library
8 | Properties
9 | EgorkaGame.EgorkaTestProject
10 | EgorkaTestProject
11 | v4.5
12 | 512
13 | {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
14 | 10.0
15 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
16 | $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages
17 | False
18 | UnitTest
19 | ..\
20 | true
21 |
22 |
23 | true
24 | full
25 | false
26 | bin\Debug\
27 | DEBUG;TRACE
28 | prompt
29 | 4
30 |
31 |
32 | pdbonly
33 | true
34 | bin\Release\
35 | TRACE
36 | prompt
37 | 4
38 |
39 |
40 |
41 | ..\packages\Moq.4.2.1507.0118\lib\net40\Moq.dll
42 | True
43 |
44 |
45 | ..\packages\Shouldly.2.5.0\lib\net40\Shouldly.dll
46 | True
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 | {7B362EFC-21BE-4004-9EC0-8EE93EEA5624}
75 | Egorka
76 |
77 |
78 |
79 |
80 |
81 |
82 | False
83 |
84 |
85 | False
86 |
87 |
88 | False
89 |
90 |
91 | False
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 | This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
102 |
103 |
104 |
105 |
112 |
--------------------------------------------------------------------------------
/Egorka/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | ..\Resources\keys.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8
123 |
124 |
125 | test
126 |
127 |
--------------------------------------------------------------------------------
/Egorka/Properties/Resources.ru.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | тест
122 |
123 |
124 |
125 | ..\Resources\keys.ru.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8
126 |
127 |
--------------------------------------------------------------------------------
/EgorkaTestProject/EgorkaUnitTest.cs:
--------------------------------------------------------------------------------
1 | using System.Drawing;
2 | using System.Windows.Forms;
3 | using EgorkaGame.Egorka;
4 | using Microsoft.VisualStudio.TestTools.UnitTesting;
5 | using Moq;
6 | using Shouldly;
7 |
8 | namespace EgorkaGame.EgorkaTestProject
9 | {
10 | [TestClass]
11 | public class EgorkaUnitTest
12 | {
13 | #region Consts
14 |
15 | private const string TestKeyFileResource =
16 | "Q\0Й\0DarkCyan\n" +
17 | "W\0Ц\0DarkGoldenrod\n" +
18 | "E\0У\0DarkGray\n" +
19 | "R\0К\0DarkGreen\n" +
20 | "T\0Е\0DarkKhaki\n" +
21 | "Y\0Н\0DarkMagenta\n" +
22 | "U\0Г\0DarkOliveGreen\n" +
23 | "I\0Ш\0DarkOrange\n" +
24 | "O\0Щ\0DarkOrchid\n" +
25 | "P\0З\0DarkRed\n";
26 |
27 | #endregion
28 |
29 | #region Public methods
30 |
31 | [TestMethod]
32 | public void SubscribeToEventsTest()
33 | {
34 | var view = new Mock();
35 | view.Setup(x => x.SubscribeGlobalEvents());
36 | var controller = new MainGameController(view.Object);
37 | view.VerifyAll();
38 | }
39 |
40 |
41 | [TestMethod]
42 | public void LoadKeysEmptyFileTest()
43 | {
44 | var view = new Mock();
45 | var controller = new MainGameController(view.Object);
46 | controller.LoadKeysResources("");
47 |
48 | controller.Chars.Count.ShouldBe(0);
49 | }
50 |
51 | [TestMethod]
52 | public void LoadKeysFileTest()
53 | {
54 | var view = new Mock();
55 | var controller = new MainGameController(view.Object);
56 | controller.LoadKeysResources(TestKeyFileResource);
57 |
58 | controller.Chars.Count.ShouldBe(10);
59 | var test = controller.Chars[Keys.Q];
60 | test.Color.ShouldBe(Color.FromKnownColor(KnownColor.DarkCyan));
61 | test.Character.ShouldBe('Й');
62 | test = controller.Chars[Keys.P];
63 | test.Color.ShouldBe(Color.FromKnownColor(KnownColor.DarkRed));
64 | test.Character.ShouldBe('З');
65 | }
66 |
67 | [TestMethod]
68 | public void ProcessKeyTest()
69 | {
70 | var view = new Mock();
71 | view.Setup(x => x.PlaySound(It.IsAny(), 100));
72 |
73 | var controller = new MainGameController(view.Object);
74 | controller.LoadKeysResources(TestKeyFileResource);
75 |
76 | controller.ProcessKey(Keys.R);
77 | view.VerifyAll();
78 | }
79 |
80 | [TestMethod]
81 | public void CalculateFrequencyTest()
82 | {
83 | var view = new Mock();
84 |
85 | var controller = new MainGameController(view.Object);
86 | controller.LoadKeysResources(TestKeyFileResource);
87 |
88 | view.Setup(x => x.PlaySound(It.Is(f => f == 110), 100));
89 | controller.ProcessKey(Keys.Q); //key#0
90 | view.VerifyAll();
91 |
92 | view.Reset();
93 | view.Setup(x => x.PlaySound(It.Is(f => f == 117), 100));
94 | controller.ProcessKey(Keys.W); //key#0
95 | view.VerifyAll();
96 |
97 | view.Reset();
98 | view.Setup(x => x.PlaySound(It.Is(f => f == 175), 100));
99 | controller.ProcessKey(Keys.O); //key#8
100 | view.VerifyAll();
101 |
102 | view.Reset();
103 | view.Setup(x => x.PlaySound(It.Is(f => f == 185), 100));
104 | controller.ProcessKey(Keys.P); //key#9
105 | view.VerifyAll();
106 | }
107 |
108 | [TestMethod]
109 | public void SupressMouseWheelTest()
110 | {
111 | var view = new Mock();
112 | var controller = new MainGameController(view.Object);
113 |
114 | controller.IsShouldSupressMouseWheel().ShouldBe(true);
115 | }
116 |
117 | [TestMethod]
118 | public void SupressRightMouseClickTest()
119 | {
120 | var view = new Mock();
121 | var controller = new MainGameController(view.Object);
122 |
123 | controller.IsShouldSupressMouse(MouseButtons.Left).ShouldBe(false);
124 | controller.IsShouldSupressMouse(MouseButtons.Middle).ShouldBe(false);
125 | controller.IsShouldSupressMouse(MouseButtons.Right).ShouldBe(true);
126 | controller.IsShouldSupressMouse(MouseButtons.Middle).ShouldBe(false);
127 | controller.IsShouldSupressMouse(MouseButtons.None).ShouldBe(false);
128 | controller.IsShouldSupressMouse(MouseButtons.XButton1).ShouldBe(false);
129 | controller.IsShouldSupressMouse(MouseButtons.XButton2).ShouldBe(false);
130 | }
131 |
132 | [TestMethod]
133 | public void SupressTaskManagerTest()
134 | {
135 | var view = new Mock();
136 | var controller = new MainGameController(view.Object);
137 |
138 | controller.IsShouldSupressKey(Keys.Escape, true, true).ShouldBe(true);
139 | controller.IsShouldSupressKey(Keys.Escape, false, true).ShouldBe(true);
140 | controller.IsShouldSupressKey(Keys.Escape, true, false).ShouldBe(true);
141 | controller.IsShouldSupressKey(Keys.Escape, false, false).ShouldBe(false);
142 | }
143 |
144 | [TestMethod]
145 | public void SupressTaskSwitchTest()
146 | {
147 | var view = new Mock();
148 | var controller = new MainGameController(view.Object);
149 |
150 | controller.IsShouldSupressKey(Keys.Tab, true, true).ShouldBe(true);
151 | controller.IsShouldSupressKey(Keys.Tab, true, false).ShouldBe(true);
152 | controller.IsShouldSupressKey(Keys.Tab, false, true).ShouldBe(false);
153 | controller.IsShouldSupressKey(Keys.Tab, false, false).ShouldBe(false);
154 | }
155 |
156 | [TestMethod]
157 | public void SupressWindowsKeyTest()
158 | {
159 | var view = new Mock();
160 | var controller = new MainGameController(view.Object);
161 |
162 | controller.IsShouldSupressKey(Keys.LWin, true, true).ShouldBe(true);
163 | controller.IsShouldSupressKey(Keys.LWin, true, false).ShouldBe(true);
164 | controller.IsShouldSupressKey(Keys.LWin, false, true).ShouldBe(true);
165 | controller.IsShouldSupressKey(Keys.LWin, false, false).ShouldBe(true);
166 |
167 | controller.IsShouldSupressKey(Keys.RWin, true, true).ShouldBe(true);
168 | controller.IsShouldSupressKey(Keys.RWin, true, false).ShouldBe(true);
169 | controller.IsShouldSupressKey(Keys.RWin, false, true).ShouldBe(true);
170 | controller.IsShouldSupressKey(Keys.RWin, false, false).ShouldBe(true);
171 | }
172 |
173 | #endregion
174 | }
175 | }
--------------------------------------------------------------------------------
/.nuget/NuGet.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(MSBuildProjectDirectory)\..\
5 |
6 |
7 | false
8 |
9 |
10 | false
11 |
12 |
13 | true
14 |
15 |
16 | false
17 |
18 |
19 |
20 |
21 |
22 |
26 |
27 |
28 |
29 |
30 | $([System.IO.Path]::Combine($(SolutionDir), ".nuget"))
31 |
32 |
33 |
34 |
35 | $(SolutionDir).nuget
36 |
37 |
38 |
39 | $(MSBuildProjectDirectory)\packages.$(MSBuildProjectName.Replace(' ', '_')).config
40 | $(MSBuildProjectDirectory)\packages.$(MSBuildProjectName).config
41 |
42 |
43 |
44 | $(MSBuildProjectDirectory)\packages.config
45 | $(PackagesProjectConfig)
46 |
47 |
48 |
49 |
50 | $(NuGetToolsPath)\NuGet.exe
51 | @(PackageSource)
52 |
53 | "$(NuGetExePath)"
54 | mono --runtime=v4.0.30319 "$(NuGetExePath)"
55 |
56 | $(TargetDir.Trim('\\'))
57 |
58 | -RequireConsent
59 | -NonInteractive
60 |
61 | "$(SolutionDir) "
62 | "$(SolutionDir)"
63 |
64 |
65 | $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)
66 | $(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols
67 |
68 |
69 |
70 | RestorePackages;
71 | $(BuildDependsOn);
72 |
73 |
74 |
75 |
76 | $(BuildDependsOn);
77 | BuildPackage;
78 |
79 |
80 |
81 |
82 |
83 |
84 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
99 |
100 |
103 |
104 |
105 |
106 |
108 |
109 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
141 |
142 |
143 |
144 |
145 |
--------------------------------------------------------------------------------
/Egorka/FullScreenForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.Drawing;
4 | using System.Globalization;
5 | using System.Speech.Synthesis;
6 | using System.Threading;
7 | using System.Windows.Forms;
8 | using EgorkaGame.Egorka.Properties;
9 | using Gma.System.MouseKeyHook;
10 |
11 | namespace EgorkaGame.Egorka
12 | {
13 | ///
14 | /// Main fullscreen form, implements View
15 | ///
16 | public partial class FullScreenForm : Form, IMainGameView
17 | {
18 | #region Statics
19 |
20 | #region Fields
21 |
22 | private static readonly object Locker = new object();
23 |
24 | #endregion Fields
25 |
26 | #endregion Statics
27 |
28 | #region Constructors
29 |
30 | public FullScreenForm()
31 | {
32 | InitializeComponent();
33 | lblLetter.Text = string.Empty;
34 |
35 | _synthesizer = new SpeechSynthesizer();
36 | _synthesizer.SelectVoiceByHints(VoiceGender.NotSet, VoiceAge.Adult, 0, EgorkaSettings.Instance.CultureInfo);
37 | _synthesizer.Volume = EgorkaSettings.Instance.SpeechVolume; // 0...100
38 | _synthesizer.Rate = EgorkaSettings.Instance.SpeechRate; // -10...10
39 | }
40 |
41 | #endregion Constructors
42 |
43 | #region Public properties
44 |
45 | #region IMainGameView implementation
46 |
47 | public Color ScreenColor
48 | {
49 | get
50 | {
51 | return BackColor;
52 | }
53 | set
54 | {
55 | BackColor = value;
56 | }
57 | }
58 |
59 | public string DisplayText
60 | {
61 | get
62 | {
63 | return lblLetter.Text;
64 | }
65 | set
66 | {
67 | lblLetter.Text = value;
68 | }
69 | }
70 |
71 | #endregion IMainGameView implementation
72 |
73 | #endregion
74 |
75 | #region Private methods
76 |
77 | private void Form1_Load(object sender, EventArgs e)
78 | {
79 | // set up full screen mode
80 | FormBorderStyle = FormBorderStyle.None;
81 | WindowState = FormWindowState.Maximized;
82 | var screen = Screen.PrimaryScreen;
83 | Bounds = screen.Bounds;
84 |
85 | // to remove flickering http://stackoverflow.com/questions/9408038/flickering-on-background-colour-change
86 | DoubleBuffered = true;
87 |
88 | _controller = new MainGameController(this);
89 | _controller.LoadKeysResources(Resources.keys);
90 |
91 | if (EgorkaSettings.Instance.IsSpeechEnabled && !string.IsNullOrEmpty(EgorkaSettings.Instance.SpeechIntro))
92 | {
93 | _synthesizer.Speak(EgorkaSettings.Instance.SpeechIntro);
94 | }
95 | }
96 |
97 | ///
98 | /// Logs the specified text to debug log.
99 | ///
100 | /// The text.
101 | private void Log(string text)
102 | {
103 | if (!Debugger.IsAttached || IsDisposed)
104 | {
105 | return;
106 | }
107 | Debug.Write(text);
108 | }
109 |
110 | #region IMainGameView implementation
111 |
112 | void IMainGameView.PlaySound(int beepFrequency, int beepDurationInMs)
113 | {
114 | var soundTask = new Thread(() =>
115 | {
116 | lock (Locker)
117 | {
118 | Console.Beep(beepFrequency, beepDurationInMs);
119 | }
120 | });
121 | soundTask.Start();
122 | }
123 |
124 | void IMainGameView.ReadAloud(char character)
125 | {
126 | _synthesizer.SpeakAsync(character.ToString());
127 | }
128 |
129 | ///
130 | /// Re-Subscribes to all enevts.
131 | ///
132 | void IMainGameView.SubscribeGlobalEvents()
133 | {
134 | Unsubscribe();
135 | Subscribe(Hook.GlobalEvents());
136 | }
137 |
138 | #endregion IMainGameView implementation
139 |
140 | #region Handle input devices
141 |
142 | ///
143 | /// Subscribes the specified events.
144 | ///
145 | /// The events.
146 | private void Subscribe(IKeyboardMouseEvents events)
147 | {
148 | _events = events;
149 | _events.KeyDown += OnKeyDown;
150 | _events.KeyUp += OnKeyUp;
151 | _events.KeyPress += HookManager_KeyPress;
152 |
153 | _events.MouseUp += OnMouseUp;
154 | _events.MouseClick += OnMouseClick;
155 | _events.MouseDoubleClick += OnMouseDoubleClick;
156 |
157 | _events.MouseMove += HookManager_MouseMove;
158 |
159 | _events.MouseWheelExt += HookManager_MouseWheelExt;
160 |
161 | _events.MouseDownExt += HookManager_SupressMouse;
162 | }
163 |
164 | ///
165 | /// Unsubscribes events.
166 | ///
167 | private void Unsubscribe()
168 | {
169 | if (_events == null)
170 | {
171 | return;
172 | }
173 | _events.KeyDown -= OnKeyDown;
174 | _events.KeyUp -= OnKeyUp;
175 | _events.KeyPress -= HookManager_KeyPress;
176 |
177 | _events.MouseUp -= OnMouseUp;
178 | _events.MouseClick -= OnMouseClick;
179 | _events.MouseDoubleClick -= OnMouseDoubleClick;
180 |
181 | _events.MouseMove -= HookManager_MouseMove;
182 |
183 | _events.MouseWheelExt -= HookManager_MouseWheelExt;
184 |
185 | _events.MouseDownExt -= HookManager_SupressMouse;
186 |
187 | _events.Dispose();
188 | _events = null;
189 | }
190 |
191 | ///
192 | /// Suppress mouse keys.
193 | ///
194 | /// The sender.
195 | /// The e.
196 | private void HookManager_SupressMouse(object sender, MouseEventExtArgs e)
197 | {
198 | if (_controller.IsShouldSupressMouse(e.Button))
199 | {
200 | Log(string.Format("MouseDown \t\t {0} Suppressed\n", e.Button));
201 | e.Handled = true;
202 | return;
203 | }
204 |
205 | Log(string.Format("MouseDown \t\t {0}\n", e.Button));
206 | }
207 |
208 | ///
209 | /// Called when [key down].
210 | ///
211 | /// The sender.
212 | /// The instance containing the event data.
213 | private void OnKeyDown(object sender, KeyEventArgs e)
214 | {
215 | Log(string.Format("KeyDown \t\t {0}\n", e.KeyCode));
216 |
217 | if (_controller.IsShouldSupressKey(e.KeyCode, e.Alt, e.Control))
218 | {
219 | e.Handled = true;
220 | return;
221 | }
222 |
223 | _controller.ProcessKey(e.KeyCode);
224 | }
225 |
226 | ///
227 | /// Called when [key up].
228 | ///
229 | /// The sender.
230 | /// The instance containing the event data.
231 | private void OnKeyUp(object sender, KeyEventArgs e)
232 | {
233 | Log(string.Format("KeyUp \t\t {0}\n", e.KeyCode));
234 | }
235 |
236 | ///
237 | /// Handles the KeyPress event of the HookManager control.
238 | ///
239 | /// The source of the event.
240 | /// The instance containing the event data.
241 | private void HookManager_KeyPress(object sender, KeyPressEventArgs e)
242 | {
243 | Log(string.Format("KeyPress \t\t {0}\n", e.KeyChar));
244 | }
245 |
246 | ///
247 | /// Handles the MouseMove event of the HookManager control.
248 | ///
249 | /// The source of the event.
250 | /// The instance containing the event data.
251 | private void HookManager_MouseMove(object sender, MouseEventArgs e)
252 | {
253 | }
254 |
255 | ///
256 | /// Called when [mouse up].
257 | ///
258 | /// The sender.
259 | /// The instance containing the event data.
260 | private void OnMouseUp(object sender, MouseEventArgs e)
261 | {
262 | Log(string.Format("MouseUp \t\t {0}\n", e.Button));
263 | }
264 |
265 | ///
266 | /// Called when [mouse click].
267 | ///
268 | /// The sender.
269 | /// The instance containing the event data.
270 | private void OnMouseClick(object sender, MouseEventArgs e)
271 | {
272 | Log(string.Format("MouseClick \t\t {0}\n", e.Button));
273 | }
274 |
275 | ///
276 | /// Called when [mouse double click].
277 | ///
278 | /// The sender.
279 | /// The instance containing the event data.
280 | private void OnMouseDoubleClick(object sender, MouseEventArgs e)
281 | {
282 | Log(string.Format("MouseDoubleClick \t\t {0}\n", e.Button));
283 | }
284 |
285 | ///
286 | /// Hooks the manager_ mouse wheel ext.
287 | ///
288 | /// The sender.
289 | /// The e.
290 | private void HookManager_MouseWheelExt(object sender, MouseEventExtArgs e)
291 | {
292 | if (_controller.IsShouldSupressMouseWheel())
293 | {
294 | Log("Mouse Wheel Move Suppressed.\n");
295 | e.Handled = true;
296 | }
297 | }
298 |
299 | #endregion Handle input devices
300 |
301 | #endregion Private methods
302 |
303 | #region Fields
304 |
305 | private MainGameController _controller;
306 | private IKeyboardMouseEvents _events;
307 | private readonly SpeechSynthesizer _synthesizer;
308 |
309 | #endregion Fields
310 | }
311 | }
--------------------------------------------------------------------------------
/EgorkaGame.sln.DotSettings:
--------------------------------------------------------------------------------
1 |
2 | True
3 | True
4 | True
5 | True
6 | True
7 | <?xml version="1.0" encoding="utf-16"?><Profile name="Re-Structure"><CSArrangeQualifiers>True</CSArrangeQualifiers><CSUpdateFileHeader>True</CSUpdateFileHeader><CSOptimizeUsings><OptimizeUsings>True</OptimizeUsings><EmbraceInRegion>False</EmbraceInRegion><RegionName></RegionName></CSOptimizeUsings><CSReformatCode>True</CSReformatCode><CSharpFormatDocComments>True</CSharpFormatDocComments><CSReorderTypeMembers>True</CSReorderTypeMembers></Profile>
8 | Re-Structure
9 | ALWAYS_ADD
10 | ALWAYS_ADD
11 | ALWAYS_ADD
12 | ALWAYS_ADD
13 | ALWAYS_ADD
14 | ALWAYS_ADD
15 | False
16 | False
17 | False
18 | False
19 | True
20 | False
21 | True
22 | False
23 | False
24 | <?xml version="1.0" encoding="utf-16"?>
25 | <Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns">
26 | <TypePattern DisplayName="COM interfaces or structs">
27 | <TypePattern.Match>
28 | <Or>
29 | <And>
30 | <Kind Is="Interface" />
31 | <Or>
32 | <HasAttribute Name="System.Runtime.InteropServices.InterfaceTypeAttribute" />
33 | <HasAttribute Name="System.Runtime.InteropServices.ComImport" />
34 | </Or>
35 | </And>
36 | <Kind Is="Struct" />
37 | </Or>
38 | </TypePattern.Match>
39 | </TypePattern>
40 | <TypePattern DisplayName="NUnit Test Fixtures" RemoveRegions="All">
41 | <TypePattern.Match>
42 | <And>
43 | <Kind Is="Class" />
44 | <HasAttribute Name="NUnit.Framework.TestFixtureAttribute" Inherited="True" />
45 | <HasAttribute Name="NUnit.Framework.TestCaseFixtureAttribute" Inherited="True" />
46 | </And>
47 | </TypePattern.Match>
48 | <Entry DisplayName="Setup/Teardown Methods">
49 | <Entry.Match>
50 | <And>
51 | <Kind Is="Method" />
52 | <Or>
53 | <HasAttribute Name="NUnit.Framework.SetUpAttribute" Inherited="True" />
54 | <HasAttribute Name="NUnit.Framework.TearDownAttribute" Inherited="True" />
55 | <HasAttribute Name="NUnit.Framework.FixtureSetUpAttribute" Inherited="True" />
56 | <HasAttribute Name="NUnit.Framework.FixtureTearDownAttribute" Inherited="True" />
57 | </Or>
58 | </And>
59 | </Entry.Match>
60 | </Entry>
61 | <Entry DisplayName="All other members" />
62 | <Entry Priority="100" DisplayName="Test Methods">
63 | <Entry.Match>
64 | <And>
65 | <Kind Is="Method" />
66 | <HasAttribute Name="NUnit.Framework.TestAttribute" />
67 | </And>
68 | </Entry.Match>
69 | <Entry.SortBy>
70 | <Name />
71 | </Entry.SortBy>
72 | </Entry>
73 | </TypePattern>
74 | <TypePattern DisplayName="Default Pattern">
75 | <Region Name="Nested types">
76 | <Entry Priority="100" DisplayName="Public Delegates">
77 | <Entry.Match>
78 | <And>
79 | <Access Is="Public" />
80 | <Kind Is="Delegate" />
81 | </And>
82 | </Entry.Match>
83 | <Entry.SortBy>
84 | <Name />
85 | </Entry.SortBy>
86 | </Entry>
87 | <Entry Priority="100" DisplayName="Public Enums">
88 | <Entry.Match>
89 | <And>
90 | <Access Is="Public" />
91 | <Kind Is="Enum" />
92 | </And>
93 | </Entry.Match>
94 | <Entry.SortBy>
95 | <Name />
96 | </Entry.SortBy>
97 | </Entry>
98 | <Entry DisplayName="Nested Types">
99 | <Entry.Match>
100 | <Kind Is="Type" />
101 | </Entry.Match>
102 | </Entry>
103 | </Region>
104 | <Region Name="Consts">
105 | <Entry DisplayName="Constants">
106 | <Entry.Match>
107 | <Kind Is="Constant" />
108 | </Entry.Match>
109 | <Entry.SortBy>
110 | <Name />
111 | </Entry.SortBy>
112 | </Entry>
113 | </Region>
114 | <Region Name="Statics">
115 | <Region Name="Properties">
116 | <Entry DisplayName="Properties, Indexers">
117 | <Entry.Match>
118 | <And>
119 | <Static />
120 | <Or>
121 | <Kind Is="Property" />
122 | <Kind Is="Indexer" />
123 | </Or>
124 | </And>
125 | </Entry.Match>
126 | <Entry.SortBy>
127 | <Access />
128 | <Name Is="Enter Pattern Here" />
129 | </Entry.SortBy>
130 | </Entry>
131 | </Region>
132 | <Region Name="Methods">
133 | <Entry Priority="100" DisplayName="Interface Implementations">
134 | <Entry.Match>
135 | <And>
136 | <Kind Is="Member" />
137 | <ImplementsInterface />
138 | <Static />
139 | </And>
140 | </Entry.Match>
141 | <Entry.SortBy>
142 | <ImplementsInterface Immediate="True" />
143 | </Entry.SortBy>
144 | </Entry>
145 | <Entry DisplayName="All other members">
146 | <Entry.Match>
147 | <Static />
148 | </Entry.Match>
149 | <Entry.SortBy>
150 | <Name />
151 | </Entry.SortBy>
152 | </Entry>
153 | </Region>
154 | </Region>
155 | <Region Name="Constructors">
156 | <Entry DisplayName="Constructors">
157 | <Entry.Match>
158 | <Kind Is="Constructor" />
159 | </Entry.Match>
160 | <Entry.SortBy>
161 | <Static />
162 | </Entry.SortBy>
163 | </Entry>
164 | </Region>
165 | <Region Name="Public properties">
166 | <Entry DisplayName="Properties, Indexers">
167 | <Entry.Match>
168 | <And>
169 | <Access Is="Public" />
170 | <Or>
171 | <Kind Is="Property" />
172 | <Kind Is="Indexer" />
173 | </Or>
174 | </And>
175 | </Entry.Match>
176 | <Entry.SortBy>
177 | <Access />
178 | <Name Is="Enter Pattern Here" />
179 | </Entry.SortBy>
180 | </Entry>
181 | </Region>
182 | <Region Name="Public methods">
183 | <Entry Priority="100" DisplayName="Interface Implementations">
184 | <Entry.Match>
185 | <And>
186 | <Kind Is="Member" />
187 | <ImplementsInterface />
188 | <Access Is="Public" />
189 | </And>
190 | </Entry.Match>
191 | <Entry.SortBy>
192 | <ImplementsInterface Immediate="True" />
193 | </Entry.SortBy>
194 | </Entry>
195 | <Entry DisplayName="All other members">
196 | <Entry.Match>
197 | <And>
198 | <Kind Is="Method" />
199 | <Access Is="Public" />
200 | </And>
201 | </Entry.Match>
202 | <Entry.SortBy>
203 | <Name />
204 | </Entry.SortBy>
205 | </Entry>
206 | </Region>
207 | <Region Name="Protected properties">
208 | <Entry DisplayName="Properties, Indexers">
209 | <Entry.Match>
210 | <And>
211 | <Access Is="Protected" />
212 | <Or>
213 | <Kind Is="Property" />
214 | <Kind Is="Indexer" />
215 | </Or>
216 | </And>
217 | </Entry.Match>
218 | <Entry.SortBy>
219 | <Access />
220 | <Name Is="Enter Pattern Here" />
221 | </Entry.SortBy>
222 | </Entry>
223 | </Region>
224 | <Region Name="Protected methods">
225 | <Entry Priority="100" DisplayName="Interface Implementations">
226 | <Entry.Match>
227 | <And>
228 | <Kind Is="Member" />
229 | <ImplementsInterface />
230 | <Access Is="Protected" />
231 | </And>
232 | </Entry.Match>
233 | <Entry.SortBy>
234 | <ImplementsInterface Immediate="True" />
235 | </Entry.SortBy>
236 | </Entry>
237 | <Entry DisplayName="All other members">
238 | <Entry.Match>
239 | <And>
240 | <Kind Is="Method" />
241 | <Access Is="Protected" />
242 | </And>
243 | </Entry.Match>
244 | </Entry>
245 | </Region>
246 | <Region Name="Private properties">
247 | <Entry DisplayName="Properties, Indexers">
248 | <Entry.Match>
249 | <And>
250 | <Access Is="Private" />
251 | <Or>
252 | <Kind Is="Property" />
253 | <Kind Is="Indexer" />
254 | </Or>
255 | </And>
256 | </Entry.Match>
257 | <Entry.SortBy>
258 | <Access />
259 | <Name Is="Enter Pattern Here" />
260 | </Entry.SortBy>
261 | </Entry>
262 | </Region>
263 | <Region Name="Private methods">
264 | <Entry Priority="100" DisplayName="Interface Implementations">
265 | <Entry.Match>
266 | <And>
267 | <Kind Is="Member" />
268 | <ImplementsInterface />
269 | <Access Is="Private" />
270 | </And>
271 | </Entry.Match>
272 | <Entry.SortBy>
273 | <ImplementsInterface Immediate="True" />
274 | </Entry.SortBy>
275 | </Entry>
276 | <Entry DisplayName="All other members">
277 | <Entry.Match>
278 | <And>
279 | <Kind Is="Method" />
280 | <Access Is="Private" />
281 | </And>
282 | </Entry.Match>
283 | </Entry>
284 | </Region>
285 | <Region Name="Fields">
286 | <Entry DisplayName="Static Fields">
287 | <Entry.Match>
288 | <And>
289 | <Kind Is="Field" />
290 | <Static />
291 | </And>
292 | </Entry.Match>
293 | <Entry.SortBy>
294 | <Name />
295 | </Entry.SortBy>
296 | </Entry>
297 | <Entry DisplayName="Fields">
298 | <Entry.Match>
299 | <And>
300 | <Kind Is="Field" />
301 | <Not>
302 | <Static />
303 | </Not>
304 | </And>
305 | </Entry.Match>
306 | <Entry.SortBy>
307 | <Readonly />
308 | <Name />
309 | </Entry.SortBy>
310 | </Entry>
311 | </Region>
312 | </TypePattern>
313 | </Patterns>
314 | True
315 | Default body (from options)
316 | MD
317 | True
318 | False
319 | True
320 | True
321 | True
322 | True
323 | True
324 | True
325 | True
326 | [88,-256](1024,768)
327 | CSharpSpacesPage
328 | 300
329 | True
330 | NotOverridden
331 | NotOverridden
--------------------------------------------------------------------------------