Skip to content

Commit e3b41ec

Browse files
committed
Added configurationmanager stub
1 parent 5a419e7 commit e3b41ec

6 files changed

+62
-1
lines changed
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.IO;
4+
using System.Linq;
5+
using System.Text;
6+
using System.Windows.Forms;
7+
8+
namespace spectacle_windows
9+
{
10+
class ConfigurationManager
11+
{
12+
private string configLocation = Application.UserAppDataPath + "\\neat-windows";
13+
14+
public ConfigurationManager()
15+
{
16+
Directory.CreateDirectory(this.configLocation);
17+
}
18+
19+
public void SaveHotkey(Hotkey hotkey)
20+
{
21+
}
22+
23+
24+
25+
}
26+
}

spectacle-windows/HotkeyHandler.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Collections.Generic;
2+
using System.Configuration;
23
using System.Windows.Forms;
34

45
namespace spectacle_windows
@@ -37,6 +38,7 @@ public void MapHotkey(Form form, WindowConstants.WindowSizePosition windowSizePo
3738
if (!hotkey.Registered) hotkey.Register(form);
3839

3940
this.hotkeys[windowSizePosition] = hotkey;
41+
4042
}
4143

4244
public void InitializeDefaultHotkeys()

spectacle-windows/Settings.cs

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
namespace spectacle_windows.Properties {
2+
3+
4+
// This class allows you to handle specific events on the settings class:
5+
// The SettingChanging event is raised before a setting's value is changed.
6+
// The PropertyChanged event is raised after a setting's value is changed.
7+
// The SettingsLoaded event is raised after the setting values are loaded.
8+
// The SettingsSaving event is raised before the setting values are saved.
9+
internal sealed partial class Settings {
10+
11+
public Settings() {
12+
// // To add event handlers for saving and changing settings, uncomment the lines below:
13+
//
14+
// this.SettingChanging += this.SettingChangingEventHandler;
15+
//
16+
// this.SettingsSaving += this.SettingsSavingEventHandler;
17+
//
18+
}
19+
20+
private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) {
21+
// Add code to handle the SettingChangingEvent event here.
22+
}
23+
24+
private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) {
25+
// Add code to handle the SettingsSaving event here.
26+
}
27+
}
28+
}

spectacle-windows/SettingsForm.cs

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ namespace spectacle_windows
66
public partial class SettingsForm : Form
77
{
88
private HotkeyHandler hotkeyHandler;
9+
private ConfigurationManager configurationManager;
910

1011
public SettingsForm()
1112
{
@@ -16,6 +17,8 @@ public SettingsForm()
1617
this.Resize += delegate { this.SettingsForm_Resize(); };
1718

1819
this.MapTextBoxTags();
20+
21+
this.configurationManager = new ConfigurationManager();
1922
}
2023

2124
#region Minimizing, notifyicon

spectacle-windows/WindowResizer.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ namespace spectacle_windows
55
{
66
class WindowResizer
77
{
8-
98
private IntPtr foregroundWindowHandle;
109
private Rectangle foregroundWindowBounds;
1110
private ScreenSizePosition screenSizePosition;
1211

12+
1313
public void ResizeTo(WindowConstants.WindowSizePosition windowSizePosition)
1414
{
1515
this.foregroundWindowHandle = NativeMethods.GetForegroundWindow();

spectacle-windows/spectacle-windows.csproj

+2
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,12 @@
7272
<Reference Include="System.Xml" />
7373
</ItemGroup>
7474
<ItemGroup>
75+
<Compile Include="ConfigurationManager.cs" />
7576
<Compile Include="GlobalSuppressions.cs" />
7677
<Compile Include="Hotkey.cs" />
7778
<Compile Include="HotkeyHandler.cs" />
7879
<Compile Include="NativeMethods.cs" />
80+
<Compile Include="Settings.cs" />
7981
<Compile Include="WindowResizer.cs" />
8082
<Compile Include="ScreenSizePosition.cs" />
8183
<Compile Include="WindowConstants.cs" />

0 commit comments

Comments
 (0)