Skip to content

Commit

Permalink
code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
borseno committed Apr 24, 2019
1 parent db61679 commit 99266fe
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 19 deletions.
1 change: 0 additions & 1 deletion App_Start/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Net.Mime;
using System.Windows.Forms;
using BorsenoTextEditor.Forms;

Expand Down
23 changes: 9 additions & 14 deletions File_Work/Implementors/Database/DBFileManager.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using System;
using System.Data.SQLite;
using System.Linq;
using System.Data.SQLite;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using BorsenoTextEditor.File_Work.Helper_Classes;
Expand Down Expand Up @@ -70,8 +67,6 @@ public async Task Save(string name, string value)

public async Task Load(string name, TextBoxBase textBox)
{
StringBuilder value = new StringBuilder(32);

using (var connection = new SQLiteConnection(_connectionString))
{
await connection.OpenAsync();
Expand All @@ -86,19 +81,19 @@ public async Task Load(string name, TextBoxBase textBox)

using (var reader = await command.ExecuteReaderAsync())
{
textBox.Text = "";
textBox.Clear();

if (reader.HasRows)
{
while (reader.Read())
{
string temp = await Task.Run( () => _valueEncoding.GetString((byte[])reader[_valueColumnName]));
textBox.Text += temp;
}
{
await reader.ReadAsync(); // read only the first row

string temp = await Task.Run(() => _valueEncoding.GetString((byte[])reader[_valueColumnName]));

textBox.AppendText(temp);
}
}
}
}
}
}
}
}
2 changes: 0 additions & 2 deletions Logging.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

Expand Down
1 change: 0 additions & 1 deletion Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.Drawing;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using BorsenoTextEditor.Extensions;

namespace BorsenoTextEditor.TextProcessors
Expand Down

0 comments on commit 99266fe

Please sign in to comment.