Skip to content

Commit

Permalink
Fix indents
Browse files Browse the repository at this point in the history
When I upgraded Visual Studio, I forgot to set the auto-indent setting
to tabs
  • Loading branch information
toehead2001 committed Jul 21, 2015
1 parent a170669 commit c56b13d
Show file tree
Hide file tree
Showing 6 changed files with 213 additions and 213 deletions.
48 changes: 24 additions & 24 deletions Hotkeys.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,32 +31,32 @@ public class Hotkeys : Form
private readonly int[] _windowId;
private Thread _worker;
private bool _busyCapturing;
Settings _settings;
Settings _settings;

public Hotkeys()
{
_windowId = new[] { GetHashCode(), GetHashCode() ^ 327 };
WindowsApi.RegisterHotKey(Handle, _windowId[0], MOD_ALT, (int)Keys.PrintScreen);
WindowsApi.RegisterHotKey(Handle, _windowId[1], MOD_ALT | MOD_CONTROL, (int)Keys.PrintScreen);
_windowId = new[] { GetHashCode(), GetHashCode() ^ 327 };
WindowsApi.RegisterHotKey(Handle, _windowId[0], MOD_ALT, (int)Keys.PrintScreen);
WindowsApi.RegisterHotKey(Handle, _windowId[1], MOD_ALT | MOD_CONTROL, (int)Keys.PrintScreen);

this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormClose);
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormClose);
}

private void FormClose(object sender, FormClosingEventArgs e)
{
foreach (var id in _windowId)
private void FormClose(object sender, FormClosingEventArgs e)
{
foreach (var id in _windowId)
{
WindowsApi.UnregisterHotKey(Handle, id);
}
}
}

protected override void WndProc(ref Message m)
{
base.WndProc(ref m);

if (m.Msg == WM_HOTKEY)
{
_settings = new Settings();
_settings = new Settings();

if (_busyCapturing)
return;
Expand Down Expand Up @@ -89,26 +89,26 @@ protected override void WndProc(ref Message m)
private ScreenshotTask GetParamteresFromUI()
{
var type = ScreenshotTask.BackgroundType.Transparent;
if (_settings.opaqueCheckbox && _settings.opaqueType == 0)
if (_settings.opaqueCheckbox && _settings.opaqueType == 0)
type = ScreenshotTask.BackgroundType.Checkerboard;
else if (_settings.opaqueCheckbox && _settings.opaqueType == 1)
else if (_settings.opaqueCheckbox && _settings.opaqueType == 1)
type = ScreenshotTask.BackgroundType.SolidColor;

return
new ScreenshotTask(
WindowsApi.GetForegroundWindow(),
_settings.clipboardButton,
_settings.folderTextBox,
_settings.resizeCheckbox,
_settings.windowWidth,
_settings.windowHeight,
type,
Color.FromArgb(Convert.ToInt32("FF" + _settings.opaqueColorHexBox, 16)),
_settings.checkerValue,
WindowsApi.GetForegroundWindow(),
_settings.clipboardButton,
_settings.folderTextBox,
_settings.resizeCheckbox,
_settings.windowWidth,
_settings.windowHeight,
type,
Color.FromArgb(Convert.ToInt32("FF" + _settings.opaqueColorHexBox, 16)),
_settings.checkerValue,
_settings.aeroColorCheckbox,
Color.FromArgb(Convert.ToInt32("FF" + _settings.aeroColorHexBox, 16)),
_settings.mouseCheckbox,
_settings.mouseCheckbox,
_settings.clearTypeCheckbox);
}
}
}
}
}
104 changes: 52 additions & 52 deletions Main.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 24 additions & 24 deletions Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,29 @@ public sealed partial class MainForm : Form
private const uint SPI_GETFONTSMOOTHINGTYPE = 0x200A;

private readonly RegistryKey _registryKey;
Settings _settings = new Settings();
Settings _settings = new Settings();

public MainForm()
{
DoubleBuffered = true;
Icon = new Icon(typeof(MainForm), "icon.ico");
InitializeComponent();

folderTextBox.Text = _settings.folderTextBox;
clipboardButton.Checked = _settings.clipboardButton;
diskButton.Checked = _settings.diskButton;
resizeCheckbox.Checked = _settings.resizeCheckbox;
windowWidth.Value = _settings.windowWidth;
windowHeight.Value = _settings.windowHeight;
opaqueCheckbox.Checked = _settings.opaqueCheckbox;
opaqueType.SelectedIndex = _settings.opaqueType;
checkerValue.Value = _settings.checkerValue;
opaqueColorHexBox.Text = _settings.opaqueColorHexBox;
folderTextBox.Text = _settings.folderTextBox;
clipboardButton.Checked = _settings.clipboardButton;
diskButton.Checked = _settings.diskButton;
resizeCheckbox.Checked = _settings.resizeCheckbox;
windowWidth.Value = _settings.windowWidth;
windowHeight.Value = _settings.windowHeight;
opaqueCheckbox.Checked = _settings.opaqueCheckbox;
opaqueType.SelectedIndex = _settings.opaqueType;
checkerValue.Value = _settings.checkerValue;
opaqueColorHexBox.Text = _settings.opaqueColorHexBox;
aeroColorCheckbox.Checked = _settings.aeroColorCheckbox;
aeroColorHexBox.Text = _settings.aeroColorHexBox;
mouseCheckbox.Checked = _settings.mouseCheckbox;
delayCheckbox.Checked = _settings.delayCheckbox;
delaySeconds.Value = _settings.delaySeconds;
mouseCheckbox.Checked = _settings.mouseCheckbox;
delayCheckbox.Checked = _settings.delayCheckbox;
delaySeconds.Value = _settings.delaySeconds;
clearTypeCheckbox.Checked = _settings.clearTypeCheckbox;

if (!GlassAvailable())
Expand All @@ -74,7 +74,7 @@ public MainForm()
clearTypeGroupBox.Enabled = clearTypeCheckbox.Checked;
aeroColorGroupBox.Enabled = aeroColorCheckbox.Checked;

_registryKey = Registry.CurrentUser.CreateSubKey(@"Software\AeroShot");
_registryKey = Registry.CurrentUser.CreateSubKey(@"Software\AeroShot");
}

private static bool GlassAvailable()
Expand Down Expand Up @@ -109,9 +109,9 @@ private static bool ClearTypeEnabled()
private void BrowseButtonClick(object sender, EventArgs e)
{
if (folderSelectionDialog.ShowDialog() == DialogResult.OK)
{
folderTextBox.Text = folderSelectionDialog.SelectedPath;
}
{
folderTextBox.Text = folderSelectionDialog.SelectedPath;
}
}

private void opaqueColorDisplayClick(object sender, EventArgs e)
Expand Down Expand Up @@ -278,7 +278,7 @@ private void AeroColorTextboxTextChange(object sender, EventArgs e)
aeroColorDialog.Color = Color.FromArgb(Convert.ToInt32("FF" + aeroColorHexBox.Text, 16));
}

private void OkButtonClick(object sender, EventArgs e)
private void OkButtonClick(object sender, EventArgs e)
{
if (clipboardButton.Checked)
_registryKey.SetValue("LastPath", "*" + folderTextBox.Text);
Expand Down Expand Up @@ -342,13 +342,13 @@ private void OkButtonClick(object sender, EventArgs e)
data = BitConverter.ToInt64(b, 0);
_registryKey.SetValue("Delay", data, RegistryValueKind.QWord);

this.Close();
this.Close();
}

private void CancelButtonClick(object sender, EventArgs e)
{
this.Close();
}
private void CancelButtonClick(object sender, EventArgs e)
{
this.Close();
}
}

public class ColorDisplay : UserControl
Expand Down
Loading

0 comments on commit c56b13d

Please sign in to comment.