Code cleanup
This commit is contained in:
34
.editorconfig
Normal file
34
.editorconfig
Normal file
@@ -0,0 +1,34 @@
|
||||
|
||||
[*]
|
||||
|
||||
# Microsoft .NET properties
|
||||
csharp_new_line_before_members_in_object_initializers = false
|
||||
csharp_preferred_modifier_order = private, protected, public, internal, file, new, override, abstract, virtual, sealed, readonly, static, extern, unsafe, volatile, async, required:suggestion
|
||||
csharp_preserve_single_line_blocks = true
|
||||
csharp_style_var_elsewhere = false:suggestion
|
||||
csharp_style_var_for_built_in_types = false:suggestion
|
||||
csharp_style_var_when_type_is_apparent = false:suggestion
|
||||
|
||||
# ReSharper properties
|
||||
resharper_accessor_owner_body = accessors_with_block_body
|
||||
resharper_align_multiline_argument = true
|
||||
resharper_align_multiline_binary_expressions_chain = false
|
||||
resharper_blank_lines_after_block_statements = 0
|
||||
resharper_blank_lines_around_single_line_property = 1
|
||||
resharper_braces_for_for = required
|
||||
resharper_braces_for_ifelse = not_required
|
||||
resharper_braces_for_using = not_required
|
||||
resharper_braces_redundant = false
|
||||
resharper_csharp_blank_lines_around_invocable = 0
|
||||
resharper_csharp_insert_final_newline = true
|
||||
resharper_csharp_max_line_length = 198
|
||||
resharper_csharp_remove_blank_lines_near_braces_in_declarations = false
|
||||
resharper_default_internal_modifier = implicit
|
||||
resharper_instance_members_qualify_declared_in =
|
||||
resharper_keep_existing_enum_arrangement = false
|
||||
resharper_parentheses_non_obvious_operations = none, multiplicative, additive, arithmetic, shift, bitwise_and, bitwise_exclusive_or, bitwise_inclusive_or, bitwise
|
||||
resharper_parentheses_redundancy_style = remove
|
||||
resharper_place_accessorholder_attribute_on_same_line = false
|
||||
resharper_trailing_comma_in_multiline_lists = true
|
||||
resharper_wrap_chained_binary_expressions = chop_if_long
|
||||
resharper_wrap_object_and_collection_initializer_style = chop_always
|
||||
@@ -7,11 +7,11 @@ namespace CsvView.Code
|
||||
{
|
||||
public class CsvIndexer
|
||||
{
|
||||
private bool _insideString = false;
|
||||
private bool _insideString;
|
||||
|
||||
private char _separator = ',';
|
||||
private char _quoteChar = '"';
|
||||
private char _escapeChar = '\\';
|
||||
private readonly char _separator;
|
||||
private readonly char _quoteChar;
|
||||
private readonly char _escapeChar;
|
||||
|
||||
public CsvIndexer(char separator = ',', char quoteChar = '"', char escapeChar = '\\')
|
||||
{
|
||||
@@ -38,7 +38,7 @@ namespace CsvView.Code
|
||||
_insideString = true;
|
||||
continue;
|
||||
}
|
||||
if (c == _quoteChar && _insideString == true)
|
||||
if (c == _quoteChar && _insideString)
|
||||
{
|
||||
_insideString = false;
|
||||
continue;
|
||||
@@ -53,7 +53,7 @@ namespace CsvView.Code
|
||||
|
||||
private class TrackingTextReader : TextReader
|
||||
{
|
||||
private TextReader _baseReader;
|
||||
private readonly TextReader _baseReader;
|
||||
private int _position;
|
||||
|
||||
public TrackingTextReader(TextReader baseReader)
|
||||
|
||||
@@ -6,11 +6,11 @@ namespace CsvView.Code
|
||||
{
|
||||
public class CsvParser
|
||||
{
|
||||
private bool _insideString = false;
|
||||
private bool _insideString;
|
||||
|
||||
private char _separator = ',';
|
||||
private char _quoteChar = '"';
|
||||
private char _escapeChar = '\\';
|
||||
private readonly char _separator;
|
||||
private readonly char _quoteChar;
|
||||
private readonly char _escapeChar;
|
||||
|
||||
public CsvParser(char separator = ',', char quoteChar = '"', char escapeChar = '\\')
|
||||
{
|
||||
@@ -21,8 +21,8 @@ namespace CsvView.Code
|
||||
|
||||
private List<List<string>> _data = new List<List<string>>();
|
||||
|
||||
private List<string> _currentReg = null;
|
||||
StringBuilder _currentCell = null;
|
||||
private List<string> _currentReg;
|
||||
StringBuilder _currentCell;
|
||||
|
||||
public List<List<string>> Data
|
||||
{
|
||||
@@ -54,7 +54,7 @@ namespace CsvView.Code
|
||||
_insideString = true;
|
||||
continue;
|
||||
}
|
||||
if (c == _quoteChar && _insideString == true)
|
||||
if (c == _quoteChar && _insideString)
|
||||
{
|
||||
_insideString = false;
|
||||
continue;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using CsvView.UI;
|
||||
using System;
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using CsvView.UI;
|
||||
|
||||
namespace CsvView.Net
|
||||
namespace CsvView
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
|
||||
@@ -27,9 +27,9 @@ namespace CsvView.UI
|
||||
}
|
||||
|
||||
private string _loadedFile = string.Empty;
|
||||
private long _currentReg = 0;
|
||||
private long _totalRegs = 0;
|
||||
private List<long> _index = null;
|
||||
private long _currentReg;
|
||||
private long _totalRegs;
|
||||
private List<long> _index;
|
||||
|
||||
private void btnLoad_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -66,7 +66,7 @@ namespace CsvView.UI
|
||||
return csvParser.Data[0];
|
||||
}
|
||||
|
||||
bool _rendering = false;
|
||||
bool _rendering;
|
||||
private void RenderReg(long currentReg)
|
||||
{
|
||||
if (_index == null || _index.Count <= 0)
|
||||
|
||||
Reference in New Issue
Block a user