Skip to content

Commit

Permalink
コードの整理
Browse files Browse the repository at this point in the history
  • Loading branch information
toresebu committed Aug 18, 2018
1 parent 76e376c commit b8feb82
Show file tree
Hide file tree
Showing 38 changed files with 441 additions and 440 deletions.
Binary file modified .vs/HouseholdAccountBook/v15/.suo
Binary file not shown.
5 changes: 3 additions & 2 deletions HouseholdAccountBook/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Threading;
using System.Windows;

namespace HouseholdAccountBook
Expand Down Expand Up @@ -137,7 +138,7 @@ private void Application_Startup(object sender, StartupEventArgs e)
obuw.Left = settings.MainWindow_Left + settings.MainWindow_Width / 2 - obuw.Width / 2;
obuw.Topmost = true;
obuw.Show();
CreateBackUpFile();
this.CreateBackUpFile();
obuw.Close();
}
};
Expand All @@ -152,7 +153,7 @@ private void Application_Startup(object sender, StartupEventArgs e)
/// <param name="sender"></param>
/// <param name="e"></param>
private void Application_Exit(object sender, ExitEventArgs e) {
ReleaseMutex();
this.ReleaseMutex();
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ protected override void OnDetaching()
/// </summary>
public object SelectedItem
{
get { return GetValue(SelectedItemProperty); }
set { SetValue(SelectedItemProperty, value); }
get { return this.GetValue(SelectedItemProperty); }
set { this.SetValue(SelectedItemProperty, value); }
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ protected override void OnDetaching()
/// </summary>
public IList SelectedItems
{
get { return (IList)GetValue(SelectedItemsProperty); }
set { SetValue(SelectedItemsProperty, value); }
get { return (IList)this.GetValue(SelectedItemsProperty); }
set { this.SetValue(SelectedItemsProperty, value); }
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion HouseholdAccountBook/Dao/DaoBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ private bool Open()
{
try {
this.connection.Open();
while (this.connection.State == System.Data.ConnectionState.Connecting) {; }
while (this.connection.State == System.Data.ConnectionState.Connecting) { ; }

return this.connection.State == System.Data.ConnectionState.Open;
}
Expand Down
8 changes: 4 additions & 4 deletions HouseholdAccountBook/Dao/DaoNpgsql.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public DaoNpgsql(string uri, int port, string userName, string password, string
public override int ExecNonQuery(string sql, params object[] objects)
{
try {
return CreateCommand(sql, objects).ExecuteNonQuery();
return this.CreateCommand(sql, objects).ExecuteNonQuery();
}
catch (Exception e) {
throw e;
Expand All @@ -55,7 +55,7 @@ public override DaoReader ExecQuery(string sql, params object[] objects)
try {
LinkedList<Dictionary<string, object>> resultSet = new LinkedList<Dictionary<string, object>>();

NpgsqlCommand command = CreateCommand(sql, objects);
NpgsqlCommand command = this.CreateCommand(sql, objects);
using (NpgsqlDataReader reader = command.ExecuteReader()) {
// フィールド名の取得
List<string> fieldList = new List<string>();
Expand All @@ -66,8 +66,8 @@ public override DaoReader ExecQuery(string sql, params object[] objects)
// レコードの取得
while (reader.Read()) {
Dictionary<string, object> result = new Dictionary<string, object>();
for (int i = 0; i < fieldList.Count; ++i) {
result.Add(fieldList[i], reader[fieldList[i]]);
foreach (string fieldName in fieldList) {
result.Add(fieldName, reader[fieldName]);
}
resultSet.AddLast(result);
}
Expand Down
8 changes: 4 additions & 4 deletions HouseholdAccountBook/Dao/DaoOle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ public partial class DaoOle : DaoBase

public override int ExecNonQuery(string sql, params object[] objects)
{
return CreateCommand(sql, objects).ExecuteNonQuery();
return this.CreateCommand(sql, objects).ExecuteNonQuery();
}

public override DaoReader ExecQuery(string sql, params object[] objects)
{
LinkedList<Dictionary<string, object>> resultSet = new LinkedList<Dictionary<string, object>>();

OleDbCommand command = CreateCommand(sql, objects);
OleDbCommand command = this.CreateCommand(sql, objects);
using (OleDbDataReader reader = command.ExecuteReader()) {
// フィールド名の取得
List<string> fieldList = new List<string>();
Expand All @@ -46,8 +46,8 @@ public override DaoReader ExecQuery(string sql, params object[] objects)
// レコードの取得
while (reader.Read()) {
Dictionary<string, object> result = new Dictionary<string, object>();
for (int i = 0; i < fieldList.Count; ++i) {
result.Add(fieldList[i], reader[fieldList[i]]);
foreach (string fieldName in fieldList) {
result.Add(fieldName, reader[fieldName]);
}
resultSet.AddLast(result);
}
Expand Down
8 changes: 4 additions & 4 deletions HouseholdAccountBook/Dao/DaoSQLite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ public partial class DaoSQLite : DaoBase

public override int ExecNonQuery(string sql, params object[] objects)
{
return CreateCommand(sql, objects).ExecuteNonQuery();
return this.CreateCommand(sql, objects).ExecuteNonQuery();
}

public override DaoReader ExecQuery(string sql, params object[] objects)
{
LinkedList<Dictionary<string, object>> resultSet = new LinkedList<Dictionary<string, object>>();

SQLiteCommand command = CreateCommand(sql, objects);
SQLiteCommand command = this.CreateCommand(sql, objects);
using (SQLiteDataReader reader = command.ExecuteReader()) {
// フィールド名の取得
List<string> fieldList = new List<string>();
Expand All @@ -45,8 +45,8 @@ public override DaoReader ExecQuery(string sql, params object[] objects)
// レコードの取得
while (reader.NextResult()) {
Dictionary<string, object> result = new Dictionary<string, object>();
for (int i = 0; i < fieldList.Count; ++i) {
result.Add(fieldList[i], reader[fieldList[i]]);
foreach (string fieldName in fieldList) {
result.Add(fieldName, reader[fieldName]);
}
resultSet.AddLast(result);
}
Expand Down
12 changes: 6 additions & 6 deletions HouseholdAccountBook/UserControls/DateTimePicker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private void TextBox_PreviewKeyDown(object sender, KeyEventArgs e)
case Key.NumPad9: {
int input = e.Key - Key.NumPad0;
textBox.TextChanged -= this.TextBox_TextChanged;
TryToInputNumber(textBox, dateTimePicker, input);
this.TryToInputNumber(textBox, dateTimePicker, input);
textBox.TextChanged += this.TextBox_TextChanged;
e.Handled = true;
}
Expand All @@ -109,7 +109,7 @@ private void TextBox_PreviewKeyDown(object sender, KeyEventArgs e)
case Key.D9: {
int input = e.Key - Key.D0;
textBox.TextChanged -= this.TextBox_TextChanged;
TryToInputNumber(textBox, dateTimePicker, input);
this.TryToInputNumber(textBox, dateTimePicker, input);
textBox.TextChanged += this.TextBox_TextChanged;
e.Handled = true;
}
Expand Down Expand Up @@ -139,15 +139,15 @@ private void TextBox_PreviewKeyDown(object sender, KeyEventArgs e)
case Key.Up: {
// 選択している箇所の数字をインクリメントする
textBox.TextChanged -= this.TextBox_TextChanged;
IncreaceSelectedNumber(textBox, dateTimePicker);
this.IncreaceSelectedNumber(textBox, dateTimePicker);
textBox.TextChanged += this.TextBox_TextChanged;
e.Handled = true;
}
break;
case Key.Down: {
// 選択している箇所の数字をデクリメントする
textBox.TextChanged -= this.TextBox_TextChanged;
DecreaceSelectedNumber(textBox, dateTimePicker);
this.DecreaceSelectedNumber(textBox, dateTimePicker);
textBox.TextChanged += this.TextBox_TextChanged;
e.Handled = true;
}
Expand Down Expand Up @@ -183,10 +183,10 @@ private void TextBox_MouseWheel(object sender, MouseWheelEventArgs e)

textBox.TextChanged -= this.TextBox_TextChanged;
if (e.Delta < 0) {
DecreaceSelectedNumber(textBox, this);
this.DecreaceSelectedNumber(textBox, this);
}
else if (e.Delta > 0) {
IncreaceSelectedNumber(textBox, this);
this.IncreaceSelectedNumber(textBox, this);
}
textBox.TextChanged += this.TextBox_TextChanged;

Expand Down
28 changes: 14 additions & 14 deletions HouseholdAccountBook/UserControls/NumericInputButton.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ public partial class NumericInputButton : UserControl, ICommandSource
/// </summary>
public int? InputedValue
{
get { return (int?)GetValue(InputedValueProperty); }
set { SetValue(InputedValueProperty, value); }
get { return (int?)this.GetValue(InputedValueProperty); }
set { this.SetValue(InputedValueProperty, value); }
}

/// <summary>
Expand All @@ -43,8 +43,8 @@ public partial class NumericInputButton : UserControl, ICommandSource
/// </summary>
public InputKind InputedKind
{
get { return (InputKind)GetValue(InputedKindProperty); }
set { SetValue(InputedKindProperty, value); }
get { return (InputKind)this.GetValue(InputedKindProperty); }
set { this.SetValue(InputedKindProperty, value); }
}

/// <summary>
Expand All @@ -61,8 +61,8 @@ public InputKind InputedKind
/// </summary>
public ICommand Command
{
get { return (ICommand)GetValue(CommandProperty); }
set { SetValue(CommandProperty, value); }
get { return (ICommand)this.GetValue(CommandProperty); }
set { this.SetValue(CommandProperty, value); }
}

/// <summary>
Expand All @@ -79,8 +79,8 @@ public ICommand Command
/// </summary>
public object CommandParameter
{
get { return GetValue(CommandParameterProperty); }
set { SetValue(CommandParameterProperty, value); }
get { return this.GetValue(CommandParameterProperty); }
set { this.SetValue(CommandParameterProperty, value); }
}

/// <summary>
Expand All @@ -97,8 +97,8 @@ public object CommandParameter
/// </summary>
public IInputElement CommandTarget
{
get { return (IInputElement)GetValue(CommandTargetProperty); }
set { SetValue(CommandTargetProperty, value); }
get { return (IInputElement)this.GetValue(CommandTargetProperty); }
set { this.SetValue(CommandTargetProperty, value); }
}
#endregion

Expand All @@ -107,7 +107,7 @@ public IInputElement CommandTarget
/// </summary>
public NumericInputButton()
{
InitializeComponent();
this.InitializeComponent();
}

#region イベントハンドラ
Expand All @@ -124,7 +124,7 @@ private void NumberInputCommand_Executed(object sender, ExecutedRoutedEventArgs

this.InputedValue = value;
this.InputedKind = InputKind.Number;
CallCommandToExecute();
this.CallCommandToExecute();

e.Handled = true;
}
Expand All @@ -137,7 +137,7 @@ private void NumberInputCommand_Executed(object sender, ExecutedRoutedEventArgs
private void BackSpaceInputCommand_Executed(object sender, ExecutedRoutedEventArgs e)
{
this.InputedKind = InputKind.BackSpace;
CallCommandToExecute();
this.CallCommandToExecute();

e.Handled = true;
}
Expand All @@ -150,7 +150,7 @@ private void BackSpaceInputCommand_Executed(object sender, ExecutedRoutedEventAr
private void ClearCommand_Executed(object sender, ExecutedRoutedEventArgs e)
{
this.InputedKind = InputKind.Clear;
CallCommandToExecute();
this.CallCommandToExecute();

e.Handled = true;
}
Expand Down
30 changes: 15 additions & 15 deletions HouseholdAccountBook/UserControls/NumericUpDown.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public partial class NumericUpDown : UserControl
#region Value
public int? Value
{
get { return (int?)GetValue(ValueProperty); }
set { SetValue(ValueProperty, value); }
get { return (int?)this.GetValue(ValueProperty); }
set { this.SetValue(ValueProperty, value); }
}
#endregion

Expand All @@ -50,8 +50,8 @@ public partial class NumericUpDown : UserControl
#region Stride
public int Stride
{
get { return (int)GetValue(StrideProperty); }
set { SetValue(StrideProperty, value); }
get { return (int)this.GetValue(StrideProperty); }
set { this.SetValue(StrideProperty, value); }
}
#endregion

Expand All @@ -71,8 +71,8 @@ public int Stride
#region NullValue
public int NullValue
{
get { return (int)GetValue(NullValueProperty); }
set { SetValue(NullValueProperty, value); }
get { return (int)this.GetValue(NullValueProperty); }
set { this.SetValue(NullValueProperty, value); }
}
#endregion

Expand All @@ -93,8 +93,8 @@ public int NullValue
#region MaxValue
public int MaxValue
{
get { return (int)GetValue(MaxValueProperty); }
set { SetValue(MaxValueProperty, value); }
get { return (int)this.GetValue(MaxValueProperty); }
set { this.SetValue(MaxValueProperty, value); }
}
#endregion

Expand All @@ -115,8 +115,8 @@ public int MaxValue
#region MinValue
public int MinValue
{
get { return (int)GetValue(MinValueProperty); }
set { SetValue(MinValueProperty, value); }
get { return (int)this.GetValue(MinValueProperty); }
set { this.SetValue(MinValueProperty, value); }
}
#endregion
#endregion
Expand All @@ -126,7 +126,7 @@ public int MinValue
/// </summary>
public NumericUpDown()
{
InitializeComponent();
this.InitializeComponent();
}

#region イベントハンドラ
Expand All @@ -148,7 +148,7 @@ private void IncreaseCommand_CanExecute(object sender, CanExecuteRoutedEventArgs
/// <param name="e"></param>
private void IncreaseCommand_Executed(object sender, ExecutedRoutedEventArgs e)
{
IncreaceNumber();
this.IncreaceNumber();
e.Handled = true;
}

Expand All @@ -169,7 +169,7 @@ private void DecreaseCommand_CanExecute(object sender, CanExecuteRoutedEventArgs
/// <param name="e"></param>
private void DecreaseCommand_Executed(object sender, ExecutedRoutedEventArgs e)
{
DecreaceNumber();
this.DecreaceNumber();
e.Handled = true;
}

Expand Down Expand Up @@ -288,10 +288,10 @@ private void TextBox_GotFocus(object sender, RoutedEventArgs e)
private void TextBox_MouseWheel(object sender, MouseWheelEventArgs e)
{
if (e.Delta > 0) {
IncreaceNumber();
this.IncreaceNumber();
}
else if (e.Delta < 0) {
DecreaceNumber();
this.DecreaceNumber();
}
}

Expand Down
4 changes: 2 additions & 2 deletions HouseholdAccountBook/ViewModels/ActionVIewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public class ActionViewModel : BindableBase, IMultiSelectable
public bool IsMatch
{
get { return this._IsMatch; }
set { SetProperty(ref this._IsMatch, value); }
set { this.SetProperty(ref this._IsMatch, value); }
}
private bool _IsMatch = default(bool);
#endregion
Expand All @@ -79,7 +79,7 @@ public bool IsMatch
public bool IsSelected
{
get { return this._IsSelected; }
set { SetProperty(ref this._IsSelected, value); }
set { this.SetProperty(ref this._IsSelected, value); }
}
private bool _IsSelected = default(bool);
#endregion
Expand Down
Loading

0 comments on commit b8feb82

Please sign in to comment.