diff --git a/.editorconfig b/.editorconfig
index 1a659dc5..dedc5722 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,151 +1,138 @@
+# editorconfig.org
+
+# top-most EditorConfig file
root = true
-# All files
+# Default settings:
+# A newline ending every file
+# Use 4 spaces as indentation
[*]
+insert_final_newline = true
indent_style = space
-
-# Xml files
-[*.xml]
-indent_size = 2
+indent_size = 4
+dotnet_style_operator_placement_when_wrapping = beginning_of_line
+tab_width = 4
+end_of_line = crlf
+dotnet_style_coalesce_expression = true:suggestion
+dotnet_style_null_propagation = true:suggestion
+dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
+dotnet_style_prefer_auto_properties = true:silent
+dotnet_style_object_initializer = true:suggestion
+dotnet_style_prefer_collection_expression = true:suggestion
+dotnet_style_collection_initializer = true:suggestion
+dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
+dotnet_style_prefer_conditional_expression_over_assignment = true:silent
+dotnet_style_explicit_tuple_names = true:suggestion
+dotnet_style_prefer_conditional_expression_over_return = true:silent
+dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
+dotnet_style_prefer_inferred_tuple_names = true:suggestion
+dotnet_style_prefer_compound_assignment = true:suggestion
+dotnet_style_prefer_simplified_interpolation = true:suggestion
+dotnet_style_namespace_match_folder = true:suggestion
+dotnet_style_readonly_field = true:suggestion
+dotnet_style_predefined_type_for_member_access = true:suggestion
+dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
+dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
+dotnet_style_allow_multiple_blank_lines_experimental = true:silent
# C# files
[*.cs]
-
-#### Core EditorConfig Options ####
-
-# Indentation and spacing
-indent_size = 4
-tab_width = 4
-
# New line preferences
-end_of_line = crlf
-insert_final_newline = false
-
-#### .NET Coding Conventions ####
-[*.{cs,vb}]
-
-# Organize usings
-dotnet_separate_import_directive_groups = true
-dotnet_sort_system_directives_first = true
-file_header_template = unset
-
-# Namespaces
-dotnet_style_namespace_match_folder = true:suggestion
-csharp_style_namespace_declarations = block_scoped:error
-
-# this. and Me. preferences
-dotnet_style_qualification_for_event = false:silent
-dotnet_style_qualification_for_field = false:silent
-dotnet_style_qualification_for_method = false:silent
-dotnet_style_qualification_for_property = false:silent
-
-# Language keywords vs BCL types preferences
-dotnet_style_predefined_type_for_locals_parameters_members = true:silent
-dotnet_style_predefined_type_for_member_access = true:silent
-
-# Parentheses preferences
-dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
-dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
-dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
-dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
-
-# Modifier preferences
-dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
-
-# Expression-level preferences
-dotnet_style_coalesce_expression = true:suggestion
-dotnet_style_collection_initializer = true:suggestion
-dotnet_style_explicit_tuple_names = true:suggestion
-dotnet_style_null_propagation = true:suggestion
-dotnet_style_object_initializer = true:suggestion
-dotnet_style_operator_placement_when_wrapping = beginning_of_line
-dotnet_style_prefer_auto_properties = true:suggestion
-dotnet_style_prefer_compound_assignment = true:suggestion
-dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
-dotnet_style_prefer_conditional_expression_over_return = true:suggestion
-dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
-dotnet_style_prefer_inferred_tuple_names = true:suggestion
-dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
-dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
-dotnet_style_prefer_simplified_interpolation = true:suggestion
-
-# Field preferences
-dotnet_style_readonly_field = true:warning
-
-# Parameter preferences
-dotnet_code_quality_unused_parameters = all:suggestion
-
-# Suppression preferences
-dotnet_remove_unnecessary_suppression_exclusions = none
-
-#### C# Coding Conventions ####
-[*.cs]
-
-# var preferences
-csharp_style_var_elsewhere = false:silent
-csharp_style_var_for_built_in_types = false:silent
-csharp_style_var_when_type_is_apparent = false:silent
-
-# Expression-bodied members
-csharp_style_expression_bodied_accessors = true:silent
-csharp_style_expression_bodied_constructors = false:silent
-csharp_style_expression_bodied_indexers = true:silent
-csharp_style_expression_bodied_lambdas = true:suggestion
-csharp_style_expression_bodied_local_functions = false:silent
-csharp_style_expression_bodied_methods = false:silent
-csharp_style_expression_bodied_operators = false:silent
-csharp_style_expression_bodied_properties = true:silent
-
-# Pattern matching preferences
-csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
-csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
-csharp_style_prefer_not_pattern = true:suggestion
-csharp_style_prefer_pattern_matching = true:silent
-csharp_style_prefer_switch_expression = true:suggestion
-
-# Null-checking preferences
-csharp_style_conditional_delegate_call = true:suggestion
-
-# Modifier preferences
-csharp_prefer_static_local_function = true:warning
-csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:silent
-
-# Code-block preferences
-csharp_prefer_braces = true:silent
-csharp_prefer_simple_using_statement = true:suggestion
-
-# Expression-level preferences
-csharp_prefer_simple_default_expression = true:suggestion
-csharp_style_deconstructed_variable_declaration = true:suggestion
-csharp_style_inlined_variable_declaration = true:suggestion
-csharp_style_pattern_local_over_anonymous_function = true:suggestion
-csharp_style_prefer_index_operator = true:suggestion
-csharp_style_prefer_range_operator = true:suggestion
-csharp_style_throw_expression = true:suggestion
-csharp_style_unused_value_assignment_preference = discard_variable:suggestion
-csharp_style_unused_value_expression_statement_preference = discard_variable:silent
-
-# 'using' directive preferences
-csharp_using_directive_placement = outside_namespace:silent
-
-#### C# Formatting Rules ####
-
-# New line preferences
-csharp_new_line_before_catch = true
-csharp_new_line_before_else = true
-csharp_new_line_before_finally = true
-csharp_new_line_before_members_in_anonymous_types = true
-csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_open_brace = all
+csharp_new_line_before_else = true
+csharp_new_line_before_catch = true
+csharp_new_line_before_finally = true
+csharp_new_line_before_members_in_object_initializers = true
+csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_between_query_expression_clauses = true
+# trim_trailing_whitespace = true
# Indentation preferences
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
-csharp_indent_case_contents_when_block = true
-csharp_indent_labels = one_less_than_current
csharp_indent_switch_labels = true
+csharp_indent_labels = one_less_than_current
+
+# avoid this. unless absolutely necessary
+dotnet_style_qualification_for_field = false:suggestion
+dotnet_style_qualification_for_property = false:suggestion
+dotnet_style_qualification_for_method = false:suggestion
+dotnet_style_qualification_for_event = false:suggestion
+
+# prefer var
+csharp_style_var_for_built_in_types = true
+csharp_style_var_when_type_is_apparent = true
+csharp_style_var_elsewhere = true:suggestion
+
+# use language keywords instead of BCL types
+dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
+dotnet_style_predefined_type_for_member_access = true:suggestion
+
+# name all constant fields using PascalCase
+dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
+dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
+dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
+
+dotnet_naming_symbols.constant_fields.applicable_kinds = field
+dotnet_naming_symbols.constant_fields.required_modifiers = const
+
+dotnet_naming_style.pascal_case_style.capitalization = pascal_case
+
+# private static fields should have s_ prefix
+dotnet_naming_rule.private_static_fields_should_have_prefix.severity = suggestion
+dotnet_naming_rule.private_static_fields_should_have_prefix.symbols = private_static_fields
+dotnet_naming_rule.private_static_fields_should_have_prefix.style = private_static_prefix_style
+
+dotnet_naming_symbols.private_static_fields.applicable_kinds = field
+dotnet_naming_symbols.private_static_fields.required_modifiers = static
+dotnet_naming_symbols.private_static_fields.applicable_accessibilities = private
+
+dotnet_naming_style.private_static_prefix_style.required_prefix = s_
+dotnet_naming_style.private_static_prefix_style.capitalization = camel_case
+
+# internal and private fields should be _camelCase
+dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion
+dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields
+dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
+
+dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
+dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal
+
+dotnet_naming_style.camel_case_underscore_style.required_prefix = _
+dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
+
+# use accessibility modifiers
+dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
+
+# Code style defaults
+dotnet_sort_system_directives_first = true
+csharp_preserve_single_line_blocks = true
+csharp_preserve_single_line_statements = false
+
+# Expression-level preferences
+dotnet_style_object_initializer = true:suggestion
+dotnet_style_collection_initializer = true:suggestion
+dotnet_style_explicit_tuple_names = true:suggestion
+dotnet_style_coalesce_expression = true:suggestion
+dotnet_style_null_propagation = true:suggestion
+
+# Expression-bodied members
+csharp_style_expression_bodied_methods = false:none
+csharp_style_expression_bodied_constructors = false:none
+csharp_style_expression_bodied_operators = false:none
+csharp_style_expression_bodied_properties = true:none
+csharp_style_expression_bodied_indexers = true:none
+csharp_style_expression_bodied_accessors = true:none
+
+# Pattern matching
+csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
+csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
+csharp_style_inlined_variable_declaration = true:suggestion
+
+# Null checking preferences
+csharp_style_throw_expression = true:suggestion
+csharp_style_conditional_delegate_call = true:suggestion
# Space preferences
csharp_space_after_cast = false
@@ -170,199 +157,138 @@ csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false
+space_within_single_line_array_initializer_braces = true
+
+#Net Analyzer
+dotnet_analyzer_diagnostic.category-Performance.severity = none #error - Uncomment when all violations are fixed.
+
+# CS0649: Field 'field' is never assigned to, and will always have its default value 'value'
+dotnet_diagnostic.CS0649.severity = error
+
+# CS1591: Missing XML comment for publicly visible type or member
+dotnet_diagnostic.CS1591.severity = suggestion
+
+# CS0162: Remove unreachable code
+dotnet_diagnostic.CS0162.severity = error
+# CA1018: Mark attributes with AttributeUsageAttribute
+dotnet_diagnostic.CA1018.severity = error
+# CA1304: Specify CultureInfo
+dotnet_diagnostic.CA1304.severity = warning
+# CA1802: Use literals where appropriate
+dotnet_diagnostic.CA1802.severity = warning
+# CA1813: Avoid unsealed attributes
+dotnet_diagnostic.CA1813.severity = error
+# CA1815: Override equals and operator equals on value types
+dotnet_diagnostic.CA1815.severity = warning
+# CA1820: Test for empty strings using string length
+dotnet_diagnostic.CA1820.severity = warning
+# CA1821: Remove empty finalizers
+dotnet_diagnostic.CA1821.severity = warning
+# CA1822: Mark members as static
+dotnet_diagnostic.CA1822.severity = suggestion
+# CA1823: Avoid unused private fields
+dotnet_diagnostic.CA1823.severity = warning
+dotnet_code_quality.CA1822.api_surface = private, internal
+# CA1825: Avoid zero-length array allocations
+dotnet_diagnostic.CA1825.severity = warning
+# CA1826: Use property instead of Linq Enumerable method
+dotnet_diagnostic.CA1826.severity = suggestion
+# CA1827: Do not use Count/LongCount when Any can be used
+dotnet_diagnostic.CA1827.severity = warning
+# CA1828: Do not use CountAsync/LongCountAsync when AnyAsync can be used
+dotnet_diagnostic.CA1828.severity = warning
+# CA1829: Use Length/Count property instead of Enumerable.Count method
+dotnet_diagnostic.CA1829.severity = warning
+#CA1847: Use string.Contains(char) instead of string.Contains(string) with single characters
+dotnet_diagnostic.CA1847.severity = warning
+#CA1854: Prefer the IDictionary.TryGetValue(TKey, out TValue) method
+dotnet_diagnostic.CA1854.severity = warning
+#CA2211:Non-constant fields should not be visible
+dotnet_diagnostic.CA2211.severity = error
# Wrapping preferences
-csharp_preserve_single_line_blocks = true
-csharp_preserve_single_line_statements = true
+csharp_wrap_before_ternary_opsigns = false
-#### Naming styles ####
-[*.{cs,vb}]
+# Avalonia DevAnalyzer preferences
+dotnet_diagnostic.AVADEV2001.severity = error
-# Naming rules
+# Avalonia PublicAnalyzer preferences
+dotnet_diagnostic.AVP1000.severity = error
+dotnet_diagnostic.AVP1001.severity = error
+dotnet_diagnostic.AVP1002.severity = error
+dotnet_diagnostic.AVP1010.severity = error
+dotnet_diagnostic.AVP1011.severity = error
+dotnet_diagnostic.AVP1012.severity = warning
+dotnet_diagnostic.AVP1013.severity = error
+dotnet_diagnostic.AVP1020.severity = error
+dotnet_diagnostic.AVP1021.severity = error
+dotnet_diagnostic.AVP1022.severity = error
+dotnet_diagnostic.AVP1030.severity = error
+dotnet_diagnostic.AVP1031.severity = error
+dotnet_diagnostic.AVP1032.severity = error
+dotnet_diagnostic.AVP1040.severity = error
+dotnet_diagnostic.AVA2001.severity = error
+csharp_using_directive_placement = outside_namespace:silent
+csharp_prefer_simple_using_statement = true:suggestion
+csharp_prefer_braces = true:silent
+csharp_style_namespace_declarations = block_scoped:silent
+csharp_style_prefer_method_group_conversion = true:silent
+csharp_style_prefer_top_level_statements = true:silent
+csharp_style_prefer_primary_constructors = true:suggestion
+csharp_style_expression_bodied_lambdas = true:silent
+csharp_style_expression_bodied_local_functions = false:silent
+csharp_style_prefer_null_check_over_type_check = true:suggestion
+csharp_prefer_simple_default_expression = true:suggestion
+csharp_style_prefer_local_over_anonymous_function = true:suggestion
+csharp_style_prefer_index_operator = true:suggestion
+csharp_style_prefer_range_operator = true:suggestion
+csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
+csharp_style_prefer_tuple_swap = true:suggestion
+csharp_style_prefer_utf8_string_literals = true:suggestion
+csharp_style_deconstructed_variable_declaration = true:suggestion
+csharp_style_unused_value_assignment_preference = discard_variable:suggestion
+csharp_style_unused_value_expression_statement_preference = discard_variable:silent
+csharp_style_prefer_readonly_struct = true:suggestion
+csharp_prefer_static_local_function = true:suggestion
+csharp_style_prefer_readonly_struct_member = true:suggestion
-dotnet_naming_rule.types_and_namespaces_should_be_pascalcase.severity = suggestion
-dotnet_naming_rule.types_and_namespaces_should_be_pascalcase.symbols = types_and_namespaces
-dotnet_naming_rule.types_and_namespaces_should_be_pascalcase.style = pascalcase
+# Xaml files
+[*.{xaml,axaml}]
+indent_size = 2
+# DuplicateSetterError
+avalonia_xaml_diagnostic.AVLN2203.severity = error
+# StyleInMergedDictionaries
+avalonia_xaml_diagnostic.AVLN2204.severity = error
+# RequiredTemplatePartMissing
+avalonia_xaml_diagnostic.AVLN2205.severity = error
+# OptionalTemplatePartMissing
+avalonia_xaml_diagnostic.AVLN2206.severity = info
+# TemplatePartWrongType
+avalonia_xaml_diagnostic.AVLN2207.severity = error
+# Obsolete
+avalonia_xaml_diagnostic.AVLN5001.severity = error
-dotnet_naming_rule.interfaces_should_be_ipascalcase.severity = suggestion
-dotnet_naming_rule.interfaces_should_be_ipascalcase.symbols = interfaces
-dotnet_naming_rule.interfaces_should_be_ipascalcase.style = ipascalcase
+# Xml project files
+[*.{csproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj}]
+indent_size = 2
-dotnet_naming_rule.type_parameters_should_be_tpascalcase.severity = suggestion
-dotnet_naming_rule.type_parameters_should_be_tpascalcase.symbols = type_parameters
-dotnet_naming_rule.type_parameters_should_be_tpascalcase.style = tpascalcase
+# Xml build files
+[*.builds]
+indent_size = 2
-dotnet_naming_rule.methods_should_be_pascalcase.severity = suggestion
-dotnet_naming_rule.methods_should_be_pascalcase.symbols = methods
-dotnet_naming_rule.methods_should_be_pascalcase.style = pascalcase
+# Xml files
+[*.{xml,stylecop,resx,ruleset}]
+indent_size = 2
-dotnet_naming_rule.properties_should_be_pascalcase.severity = suggestion
-dotnet_naming_rule.properties_should_be_pascalcase.symbols = properties
-dotnet_naming_rule.properties_should_be_pascalcase.style = pascalcase
+# Xml config files
+[*.{props,targets,config,nuspec}]
+indent_size = 2
-dotnet_naming_rule.events_should_be_pascalcase.severity = suggestion
-dotnet_naming_rule.events_should_be_pascalcase.symbols = events
-dotnet_naming_rule.events_should_be_pascalcase.style = pascalcase
-
-dotnet_naming_rule.local_variables_should_be_camelcase.severity = suggestion
-dotnet_naming_rule.local_variables_should_be_camelcase.symbols = local_variables
-dotnet_naming_rule.local_variables_should_be_camelcase.style = camelcase
-
-dotnet_naming_rule.local_constants_should_be_camelcase.severity = suggestion
-dotnet_naming_rule.local_constants_should_be_camelcase.symbols = local_constants
-dotnet_naming_rule.local_constants_should_be_camelcase.style = camelcase
-
-dotnet_naming_rule.parameters_should_be_camelcase.severity = suggestion
-dotnet_naming_rule.parameters_should_be_camelcase.symbols = parameters
-dotnet_naming_rule.parameters_should_be_camelcase.style = camelcase
-
-dotnet_naming_rule.public_fields_should_be_pascalcase.severity = suggestion
-dotnet_naming_rule.public_fields_should_be_pascalcase.symbols = public_fields
-dotnet_naming_rule.public_fields_should_be_pascalcase.style = pascalcase
-
-dotnet_naming_rule.private_fields_should_be__camelcase.severity = suggestion
-dotnet_naming_rule.private_fields_should_be__camelcase.symbols = private_fields
-dotnet_naming_rule.private_fields_should_be__camelcase.style = _camelcase
-
-dotnet_naming_rule.private_static_fields_should_be_s_camelcase.severity = suggestion
-dotnet_naming_rule.private_static_fields_should_be_s_camelcase.symbols = private_static_fields
-dotnet_naming_rule.private_static_fields_should_be_s_camelcase.style = s_camelcase
-
-dotnet_naming_rule.public_constant_fields_should_be_pascalcase.severity = suggestion
-dotnet_naming_rule.public_constant_fields_should_be_pascalcase.symbols = public_constant_fields
-dotnet_naming_rule.public_constant_fields_should_be_pascalcase.style = pascalcase
-
-dotnet_naming_rule.private_constant_fields_should_be_pascalcase.severity = suggestion
-dotnet_naming_rule.private_constant_fields_should_be_pascalcase.symbols = private_constant_fields
-dotnet_naming_rule.private_constant_fields_should_be_pascalcase.style = pascalcase
-
-dotnet_naming_rule.public_static_readonly_fields_should_be_pascalcase.severity = suggestion
-dotnet_naming_rule.public_static_readonly_fields_should_be_pascalcase.symbols = public_static_readonly_fields
-dotnet_naming_rule.public_static_readonly_fields_should_be_pascalcase.style = pascalcase
-
-dotnet_naming_rule.private_static_readonly_fields_should_be_pascalcase.severity = suggestion
-dotnet_naming_rule.private_static_readonly_fields_should_be_pascalcase.symbols = private_static_readonly_fields
-dotnet_naming_rule.private_static_readonly_fields_should_be_pascalcase.style = pascalcase
-
-dotnet_naming_rule.enums_should_be_pascalcase.severity = suggestion
-dotnet_naming_rule.enums_should_be_pascalcase.symbols = enums
-dotnet_naming_rule.enums_should_be_pascalcase.style = pascalcase
-
-dotnet_naming_rule.local_functions_should_be_pascalcase.severity = suggestion
-dotnet_naming_rule.local_functions_should_be_pascalcase.symbols = local_functions
-dotnet_naming_rule.local_functions_should_be_pascalcase.style = pascalcase
-
-dotnet_naming_rule.non_field_members_should_be_pascalcase.severity = suggestion
-dotnet_naming_rule.non_field_members_should_be_pascalcase.symbols = non_field_members
-dotnet_naming_rule.non_field_members_should_be_pascalcase.style = pascalcase
-
-# Symbol specifications
-
-dotnet_naming_symbols.interfaces.applicable_kinds = interface
-dotnet_naming_symbols.interfaces.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
-dotnet_naming_symbols.interfaces.required_modifiers =
-
-dotnet_naming_symbols.enums.applicable_kinds = enum
-dotnet_naming_symbols.enums.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
-dotnet_naming_symbols.enums.required_modifiers =
-
-dotnet_naming_symbols.events.applicable_kinds = event
-dotnet_naming_symbols.events.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
-dotnet_naming_symbols.events.required_modifiers =
-
-dotnet_naming_symbols.methods.applicable_kinds = method
-dotnet_naming_symbols.methods.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
-dotnet_naming_symbols.methods.required_modifiers =
-
-dotnet_naming_symbols.properties.applicable_kinds = property
-dotnet_naming_symbols.properties.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
-dotnet_naming_symbols.properties.required_modifiers =
-
-dotnet_naming_symbols.public_fields.applicable_kinds = field
-dotnet_naming_symbols.public_fields.applicable_accessibilities = public, internal
-dotnet_naming_symbols.public_fields.required_modifiers =
-
-dotnet_naming_symbols.private_fields.applicable_kinds = field
-dotnet_naming_symbols.private_fields.applicable_accessibilities = private, protected, protected_internal, private_protected
-dotnet_naming_symbols.private_fields.required_modifiers =
-
-dotnet_naming_symbols.private_static_fields.applicable_kinds = field
-dotnet_naming_symbols.private_static_fields.applicable_accessibilities = private, protected, protected_internal, private_protected
-dotnet_naming_symbols.private_static_fields.required_modifiers = static
-
-dotnet_naming_symbols.types_and_namespaces.applicable_kinds = namespace, class, struct, interface, enum
-dotnet_naming_symbols.types_and_namespaces.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
-dotnet_naming_symbols.types_and_namespaces.required_modifiers =
-
-dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
-dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
-dotnet_naming_symbols.non_field_members.required_modifiers =
-
-dotnet_naming_symbols.type_parameters.applicable_kinds = namespace
-dotnet_naming_symbols.type_parameters.applicable_accessibilities = *
-dotnet_naming_symbols.type_parameters.required_modifiers =
-
-dotnet_naming_symbols.private_constant_fields.applicable_kinds = field
-dotnet_naming_symbols.private_constant_fields.applicable_accessibilities = private, protected, protected_internal, private_protected
-dotnet_naming_symbols.private_constant_fields.required_modifiers = const
-
-dotnet_naming_symbols.local_variables.applicable_kinds = local
-dotnet_naming_symbols.local_variables.applicable_accessibilities = local
-dotnet_naming_symbols.local_variables.required_modifiers =
-
-dotnet_naming_symbols.local_constants.applicable_kinds = local
-dotnet_naming_symbols.local_constants.applicable_accessibilities = local
-dotnet_naming_symbols.local_constants.required_modifiers = const
-
-dotnet_naming_symbols.parameters.applicable_kinds = parameter
-dotnet_naming_symbols.parameters.applicable_accessibilities = *
-dotnet_naming_symbols.parameters.required_modifiers =
-
-dotnet_naming_symbols.public_constant_fields.applicable_kinds = field
-dotnet_naming_symbols.public_constant_fields.applicable_accessibilities = public, internal
-dotnet_naming_symbols.public_constant_fields.required_modifiers = const
-
-dotnet_naming_symbols.public_static_readonly_fields.applicable_kinds = field
-dotnet_naming_symbols.public_static_readonly_fields.applicable_accessibilities = public, internal
-dotnet_naming_symbols.public_static_readonly_fields.required_modifiers = readonly, static
-
-dotnet_naming_symbols.private_static_readonly_fields.applicable_kinds = field
-dotnet_naming_symbols.private_static_readonly_fields.applicable_accessibilities = private, protected, protected_internal, private_protected
-dotnet_naming_symbols.private_static_readonly_fields.required_modifiers = readonly, static
-
-dotnet_naming_symbols.local_functions.applicable_kinds = local_function
-dotnet_naming_symbols.local_functions.applicable_accessibilities = *
-dotnet_naming_symbols.local_functions.required_modifiers =
-
-# Naming styles
-
-dotnet_naming_style.pascalcase.required_prefix =
-dotnet_naming_style.pascalcase.required_suffix =
-dotnet_naming_style.pascalcase.word_separator =
-dotnet_naming_style.pascalcase.capitalization = pascal_case
-
-dotnet_naming_style.ipascalcase.required_prefix = I
-dotnet_naming_style.ipascalcase.required_suffix =
-dotnet_naming_style.ipascalcase.word_separator =
-dotnet_naming_style.ipascalcase.capitalization = pascal_case
-
-dotnet_naming_style.tpascalcase.required_prefix = T
-dotnet_naming_style.tpascalcase.required_suffix =
-dotnet_naming_style.tpascalcase.word_separator =
-dotnet_naming_style.tpascalcase.capitalization = pascal_case
-
-dotnet_naming_style._camelcase.required_prefix = _
-dotnet_naming_style._camelcase.required_suffix =
-dotnet_naming_style._camelcase.word_separator =
-dotnet_naming_style._camelcase.capitalization = camel_case
-
-dotnet_naming_style.camelcase.required_prefix =
-dotnet_naming_style.camelcase.required_suffix =
-dotnet_naming_style.camelcase.word_separator =
-dotnet_naming_style.camelcase.capitalization = camel_case
-
-dotnet_naming_style.s_camelcase.required_prefix = s_
-dotnet_naming_style.s_camelcase.required_suffix =
-dotnet_naming_style.s_camelcase.word_separator =
-dotnet_naming_style.s_camelcase.capitalization = camel_case
+[*.json]
+indent_size = 2
+# Shell scripts
+[*.sh]
+end_of_line = lf
+[*.{cmd,bat}]
+end_of_line = crlf
diff --git a/README.md b/README.md
index eb73edef..c51ee0d8 100644
--- a/README.md
+++ b/README.md
@@ -1,68 +1,68 @@
-# SourceGit
-
-Opensource Git GUI client.
-
-## Highlights
-
-* Supports Windows/macOS/Linux
-* Opensource/Free
-* Fast
-* English/简体中文
-* Built-in light/dark themes
-* Visual commit graph
-* Supports SSH access with each remote
-* GIT commands with GUI
- * Clone/Fetch/Pull/Push...
- * Branches
- * Remotes
- * Tags
- * Stashes
- * Submodules
- * Archive
- * Diff
- * Save as patch/apply
- * File histories
- * Blame
- * Revision Diffs
-* GitFlow support
-
-> **Linux** only tested on **Ubuntu 22.04** on **X11**.
-
-## How to use
-
-**To use this tool, you need to install Git first.**
-
-You can download the latest stable from [Releases](https://github.com/sourcegit-scm/sourcegit/releases/latest) or download workflow artifacts from [Github Actions](https://github.com/sourcegit-scm/sourcegit/actions) to try this app based on each commits.
-
-For **macOS** users:
-
-* Download `SourceGit.osx-x64.zip` or `SourceGit.osx-arm64.zip` from Releases. `x64` for Intel and `arm64` for Apple Silicon.
-* Move `SourceGit.app` to `Applications` folder.
-* Make sure your mac trusts all software from anywhere. For more information, search `spctl --master-disable`.
-* Make sure [git-credential-manager](https://github.com/git-ecosystem/git-credential-manager/releases) is installed on your mac.
-* You may need to run `sudo xattr -cr /Applications/SourceGit.app` to make sure the software works.
-
-For **Linux** users:
-
-* `xdg-open` must be installed to support open native file manager.
-* Make sure [git-credential-manager](https://github.com/git-ecosystem/git-credential-manager/releases) is installed on your linux, and it requires `ttf-mscorefonts-installer` installed.
-* Maybe you need to set environment variable `AVALONIA_SCREEN_SCALE_FACTORS`. See https://github.com/AvaloniaUI/Avalonia/wiki/Configuring-X11-per-monitor-DPI.
-* Modify `SourceGit.desktop.template` (replace SOURCEGIT_LOCAL_FOLDER with real path) and move it into `~/.local/share/applications`.
-
-## Screen Shots
-
-* Dark Theme
-
-![Theme Dark](./screenshots/theme_dark.png)
-
-* Light Theme
-
-![Theme Light](./screenshots/theme_light.png)
-
-## Contributing
-
-Thanks to all the people who contribute.
-
-
-
-
+# SourceGit
+
+Opensource Git GUI client.
+
+## Highlights
+
+* Supports Windows/macOS/Linux
+* Opensource/Free
+* Fast
+* English/简体中文
+* Built-in light/dark themes
+* Visual commit graph
+* Supports SSH access with each remote
+* GIT commands with GUI
+ * Clone/Fetch/Pull/Push...
+ * Branches
+ * Remotes
+ * Tags
+ * Stashes
+ * Submodules
+ * Archive
+ * Diff
+ * Save as patch/apply
+ * File histories
+ * Blame
+ * Revision Diffs
+* GitFlow support
+
+> **Linux** only tested on **Ubuntu 22.04** on **X11**.
+
+## How to use
+
+**To use this tool, you need to install Git first.**
+
+You can download the latest stable from [Releases](https://github.com/sourcegit-scm/sourcegit/releases/latest) or download workflow artifacts from [Github Actions](https://github.com/sourcegit-scm/sourcegit/actions) to try this app based on each commits.
+
+For **macOS** users:
+
+* Download `SourceGit.osx-x64.zip` or `SourceGit.osx-arm64.zip` from Releases. `x64` for Intel and `arm64` for Apple Silicon.
+* Move `SourceGit.app` to `Applications` folder.
+* Make sure your mac trusts all software from anywhere. For more information, search `spctl --master-disable`.
+* Make sure [git-credential-manager](https://github.com/git-ecosystem/git-credential-manager/releases) is installed on your mac.
+* You may need to run `sudo xattr -cr /Applications/SourceGit.app` to make sure the software works.
+
+For **Linux** users:
+
+* `xdg-open` must be installed to support open native file manager.
+* Make sure [git-credential-manager](https://github.com/git-ecosystem/git-credential-manager/releases) is installed on your linux, and it requires `ttf-mscorefonts-installer` installed.
+* Maybe you need to set environment variable `AVALONIA_SCREEN_SCALE_FACTORS`. See https://github.com/AvaloniaUI/Avalonia/wiki/Configuring-X11-per-monitor-DPI.
+* Modify `SourceGit.desktop.template` (replace SOURCEGIT_LOCAL_FOLDER with real path) and move it into `~/.local/share/applications`.
+
+## Screen Shots
+
+* Dark Theme
+
+![Theme Dark](./screenshots/theme_dark.png)
+
+* Light Theme
+
+![Theme Light](./screenshots/theme_light.png)
+
+## Contributing
+
+Thanks to all the people who contribute.
+
+
+
+
diff --git a/src/SourceGit/App.JsonCodeGen.cs b/src/SourceGit/App.JsonCodeGen.cs
index aa99f697..af73a68e 100644
--- a/src/SourceGit/App.JsonCodeGen.cs
+++ b/src/SourceGit/App.JsonCodeGen.cs
@@ -6,4 +6,4 @@ namespace SourceGit
[JsonSerializable(typeof(Models.Version))]
[JsonSerializable(typeof(ViewModels.Preference))]
internal partial class JsonCodeGen : JsonSerializerContext { }
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/App.axaml.cs b/src/SourceGit/App.axaml.cs
index 68a601db..4b7c142e 100644
--- a/src/SourceGit/App.axaml.cs
+++ b/src/SourceGit/App.axaml.cs
@@ -143,7 +143,8 @@ namespace SourceGit
public static string Text(string key, params object[] args)
{
var fmt = Current.FindResource($"Text.{key}") as string;
- if (string.IsNullOrWhiteSpace(fmt)) return $"Text.{key}";
+ if (string.IsNullOrWhiteSpace(fmt))
+ return $"Text.{key}";
return string.Format(fmt, args);
}
@@ -178,12 +179,14 @@ namespace SourceGit
// Parse json into Models.Version.
var ver = JsonSerializer.Deserialize(data, JsonCodeGen.Default.Version);
- if (ver == null) return;
+ if (ver == null)
+ return;
// Check if already up-to-date.
if (!ver.IsNewVersion)
{
- if (manually) ShowSelfUpdateResult(new Models.AlreadyUpToDate());
+ if (manually)
+ ShowSelfUpdateResult(new Models.AlreadyUpToDate());
return;
}
@@ -191,14 +194,16 @@ namespace SourceGit
if (!manually)
{
var pref = ViewModels.Preference.Instance;
- if (ver.TagName == pref.IgnoreUpdateTag) return;
+ if (ver.TagName == pref.IgnoreUpdateTag)
+ return;
}
ShowSelfUpdateResult(ver);
}
catch (Exception e)
{
- if (manually) ShowSelfUpdateResult(e);
+ if (manually)
+ ShowSelfUpdateResult(e);
}
});
}
@@ -232,7 +237,8 @@ namespace SourceGit
_notificationReceiver = launcher;
desktop.MainWindow = launcher;
- if (ViewModels.Preference.Instance.Check4UpdatesOnStartup) Check4Update();
+ if (ViewModels.Preference.Instance.Check4UpdatesOnStartup)
+ Check4Update();
}
base.OnFrameworkInitializationCompleted();
@@ -260,4 +266,4 @@ namespace SourceGit
private ResourceDictionary _activeLocale = null;
private Models.INotificationReceiver _notificationReceiver = null;
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/Add.cs b/src/SourceGit/Commands/Add.cs
index b5f02089..2251c892 100644
--- a/src/SourceGit/Commands/Add.cs
+++ b/src/SourceGit/Commands/Add.cs
@@ -28,4 +28,4 @@ namespace SourceGit.Commands
}
}
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/Apply.cs b/src/SourceGit/Commands/Apply.cs
index e98ec601..d1c9ffbc 100644
--- a/src/SourceGit/Commands/Apply.cs
+++ b/src/SourceGit/Commands/Apply.cs
@@ -7,10 +7,13 @@
WorkingDirectory = repo;
Context = repo;
Args = "apply ";
- if (ignoreWhitespace) Args += "--ignore-whitespace ";
- else Args += $"--whitespace={whitespaceMode} ";
- if (!string.IsNullOrEmpty(extra)) Args += $"{extra} ";
+ if (ignoreWhitespace)
+ Args += "--ignore-whitespace ";
+ else
+ Args += $"--whitespace={whitespaceMode} ";
+ if (!string.IsNullOrEmpty(extra))
+ Args += $"{extra} ";
Args += $"\"{file}\"";
}
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/Archive.cs b/src/SourceGit/Commands/Archive.cs
index 065b9900..d4f6241c 100644
--- a/src/SourceGit/Commands/Archive.cs
+++ b/src/SourceGit/Commands/Archive.cs
@@ -20,4 +20,4 @@ namespace SourceGit.Commands
private readonly Action _outputHandler;
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/AssumeUnchanged.cs b/src/SourceGit/Commands/AssumeUnchanged.cs
index 936242b5..f4cfe32b 100644
--- a/src/SourceGit/Commands/AssumeUnchanged.cs
+++ b/src/SourceGit/Commands/AssumeUnchanged.cs
@@ -7,7 +7,6 @@ namespace SourceGit.Commands
{
partial class ViewCommand : Command
{
-
[GeneratedRegex(@"^(\w)\s+(.+)$")]
private static partial Regex REG();
@@ -27,7 +26,8 @@ namespace SourceGit.Commands
protected override void OnReadline(string line)
{
var match = REG().Match(line);
- if (!match.Success) return;
+ if (!match.Success)
+ return;
if (match.Groups[1].Value == "h")
{
@@ -72,4 +72,4 @@ namespace SourceGit.Commands
private readonly string _repo;
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/Blame.cs b/src/SourceGit/Commands/Blame.cs
index ef3324e3..5d047d8c 100644
--- a/src/SourceGit/Commands/Blame.cs
+++ b/src/SourceGit/Commands/Blame.cs
@@ -46,8 +46,10 @@ namespace SourceGit.Commands
protected override void OnReadline(string line)
{
- if (_result.IsBinary) return;
- if (string.IsNullOrEmpty(line)) return;
+ if (_result.IsBinary)
+ return;
+ if (string.IsNullOrEmpty(line))
+ return;
if (line.IndexOf('\0', StringComparison.Ordinal) >= 0)
{
@@ -57,7 +59,8 @@ namespace SourceGit.Commands
}
var match = REG_FORMAT().Match(line);
- if (!match.Success) return;
+ if (!match.Success)
+ return;
_content.AppendLine(match.Groups[4].Value);
@@ -90,4 +93,4 @@ namespace SourceGit.Commands
private bool _needUnifyCommitSHA = false;
private int _minSHALen = 64;
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/Branch.cs b/src/SourceGit/Commands/Branch.cs
index aa3990c9..21210238 100644
--- a/src/SourceGit/Commands/Branch.cs
+++ b/src/SourceGit/Commands/Branch.cs
@@ -45,4 +45,4 @@
return cmd.Exec();
}
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/Checkout.cs b/src/SourceGit/Commands/Checkout.cs
index d6a9aba4..dd1426fb 100644
--- a/src/SourceGit/Commands/Checkout.cs
+++ b/src/SourceGit/Commands/Checkout.cs
@@ -69,4 +69,4 @@ namespace SourceGit.Commands
private Action _outputHandler;
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/CherryPick.cs b/src/SourceGit/Commands/CherryPick.cs
index 622202b4..504769c0 100644
--- a/src/SourceGit/Commands/CherryPick.cs
+++ b/src/SourceGit/Commands/CherryPick.cs
@@ -10,4 +10,4 @@
Args = $"cherry-pick {mode} {commit}";
}
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/Clean.cs b/src/SourceGit/Commands/Clean.cs
index 5ef4570f..900a7f93 100644
--- a/src/SourceGit/Commands/Clean.cs
+++ b/src/SourceGit/Commands/Clean.cs
@@ -28,4 +28,4 @@ namespace SourceGit.Commands
Args = builder.ToString();
}
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/Clone.cs b/src/SourceGit/Commands/Clone.cs
index a8709138..80e0df50 100644
--- a/src/SourceGit/Commands/Clone.cs
+++ b/src/SourceGit/Commands/Clone.cs
@@ -23,9 +23,11 @@ namespace SourceGit.Commands
Args += "clone --progress --verbose --recurse-submodules ";
- if (!string.IsNullOrEmpty(extraArgs)) Args += $"{extraArgs} ";
+ if (!string.IsNullOrEmpty(extraArgs))
+ Args += $"{extraArgs} ";
Args += $"{url} ";
- if (!string.IsNullOrEmpty(localName)) Args += localName;
+ if (!string.IsNullOrEmpty(localName))
+ Args += localName;
_notifyProgress = ouputHandler;
}
@@ -35,4 +37,4 @@ namespace SourceGit.Commands
_notifyProgress?.Invoke(line);
}
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/Command.cs b/src/SourceGit/Commands/Command.cs
index 297d9b85..8667346e 100644
--- a/src/SourceGit/Commands/Command.cs
+++ b/src/SourceGit/Commands/Command.cs
@@ -47,7 +47,8 @@ namespace SourceGit.Commands
start.Environment.Add("LANG", "en_US.UTF-8");
}
- if (!string.IsNullOrEmpty(WorkingDirectory)) start.WorkingDirectory = WorkingDirectory;
+ if (!string.IsNullOrEmpty(WorkingDirectory))
+ start.WorkingDirectory = WorkingDirectory;
var errs = new List();
var proc = new Process() { StartInfo = start };
@@ -60,11 +61,13 @@ namespace SourceGit.Commands
isCancelled = true;
proc.CancelErrorRead();
proc.CancelOutputRead();
- if (!proc.HasExited) proc.Kill(true);
+ if (!proc.HasExited)
+ proc.Kill(true);
return;
}
- if (e.Data != null) OnReadline(e.Data);
+ if (e.Data != null)
+ OnReadline(e.Data);
};
proc.ErrorDataReceived += (_, e) =>
@@ -74,19 +77,27 @@ namespace SourceGit.Commands
isCancelled = true;
proc.CancelErrorRead();
proc.CancelOutputRead();
- if (!proc.HasExited) proc.Kill(true);
+ if (!proc.HasExited)
+ proc.Kill(true);
return;
}
- if (string.IsNullOrEmpty(e.Data)) return;
- if (TraitErrorAsOutput) OnReadline(e.Data);
+ if (string.IsNullOrEmpty(e.Data))
+ return;
+ if (TraitErrorAsOutput)
+ OnReadline(e.Data);
// Ignore progress messages
- if (e.Data.StartsWith("remote: Enumerating objects:", StringComparison.Ordinal)) return;
- if (e.Data.StartsWith("remote: Counting objects:", StringComparison.Ordinal)) return;
- if (e.Data.StartsWith("remote: Compressing objects:", StringComparison.Ordinal)) return;
- if (e.Data.StartsWith("Filtering content:", StringComparison.Ordinal)) return;
- if (_progressRegex().IsMatch(e.Data)) return;
+ if (e.Data.StartsWith("remote: Enumerating objects:", StringComparison.Ordinal))
+ return;
+ if (e.Data.StartsWith("remote: Counting objects:", StringComparison.Ordinal))
+ return;
+ if (e.Data.StartsWith("remote: Compressing objects:", StringComparison.Ordinal))
+ return;
+ if (e.Data.StartsWith("Filtering content:", StringComparison.Ordinal))
+ return;
+ if (_progressRegex().IsMatch(e.Data))
+ return;
errs.Add(e.Data);
};
@@ -142,7 +153,8 @@ namespace SourceGit.Commands
start.StandardOutputEncoding = Encoding.UTF8;
start.StandardErrorEncoding = Encoding.UTF8;
- if (!string.IsNullOrEmpty(WorkingDirectory)) start.WorkingDirectory = WorkingDirectory;
+ if (!string.IsNullOrEmpty(WorkingDirectory))
+ start.WorkingDirectory = WorkingDirectory;
var proc = new Process() { StartInfo = start };
try
@@ -177,4 +189,4 @@ namespace SourceGit.Commands
[GeneratedRegex(@"\d+%")]
private static partial Regex _progressRegex();
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/Commit.cs b/src/SourceGit/Commands/Commit.cs
index faa941c3..8ac6501f 100644
--- a/src/SourceGit/Commands/Commit.cs
+++ b/src/SourceGit/Commands/Commit.cs
@@ -12,8 +12,10 @@ namespace SourceGit.Commands
WorkingDirectory = repo;
Context = repo;
Args = $"commit --file=\"{file}\"";
- if (amend) Args += " --amend --no-edit";
- if (allowEmpty) Args += " --allow-empty";
+ if (amend)
+ Args += " --amend --no-edit";
+ if (allowEmpty)
+ Args += " --allow-empty";
}
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/CompareRevisions.cs b/src/SourceGit/Commands/CompareRevisions.cs
index 7938df8e..a9efb36c 100644
--- a/src/SourceGit/Commands/CompareRevisions.cs
+++ b/src/SourceGit/Commands/CompareRevisions.cs
@@ -25,21 +25,37 @@ namespace SourceGit.Commands
protected override void OnReadline(string line)
{
var match = REG_FORMAT().Match(line);
- if (!match.Success) return;
+ if (!match.Success)
+ return;
var change = new Models.Change() { Path = match.Groups[2].Value };
var status = match.Groups[1].Value;
switch (status[0])
{
- case 'M': change.Set(Models.ChangeState.Modified); _changes.Add(change); break;
- case 'A': change.Set(Models.ChangeState.Added); _changes.Add(change); break;
- case 'D': change.Set(Models.ChangeState.Deleted); _changes.Add(change); break;
- case 'R': change.Set(Models.ChangeState.Renamed); _changes.Add(change); break;
- case 'C': change.Set(Models.ChangeState.Copied); _changes.Add(change); break;
+ case 'M':
+ change.Set(Models.ChangeState.Modified);
+ _changes.Add(change);
+ break;
+ case 'A':
+ change.Set(Models.ChangeState.Added);
+ _changes.Add(change);
+ break;
+ case 'D':
+ change.Set(Models.ChangeState.Deleted);
+ _changes.Add(change);
+ break;
+ case 'R':
+ change.Set(Models.ChangeState.Renamed);
+ _changes.Add(change);
+ break;
+ case 'C':
+ change.Set(Models.ChangeState.Copied);
+ _changes.Add(change);
+ break;
}
}
private readonly List _changes = new List();
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/Config.cs b/src/SourceGit/Commands/Config.cs
index 43723839..62340aa3 100644
--- a/src/SourceGit/Commands/Config.cs
+++ b/src/SourceGit/Commands/Config.cs
@@ -77,4 +77,4 @@ namespace SourceGit.Commands
return Exec();
}
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/Diff.cs b/src/SourceGit/Commands/Diff.cs
index a35bd6e7..090eba98 100644
--- a/src/SourceGit/Commands/Diff.cs
+++ b/src/SourceGit/Commands/Diff.cs
@@ -8,9 +8,9 @@ namespace SourceGit.Commands
{
[GeneratedRegex(@"^@@ \-(\d+),?\d* \+(\d+),?\d* @@")]
private static partial Regex REG_INDICATOR();
- private static readonly string PREFIX_LFS_NEW = "+version https://git-lfs.github.com/spec/";
- private static readonly string PREFIX_LFS_DEL = "-version https://git-lfs.github.com/spec/";
- private static readonly string PREFIX_LFS_MODIFY = " version https://git-lfs.github.com/spec/";
+ private const string PREFIX_LFS_NEW = "+version https://git-lfs.github.com/spec/";
+ private const string PREFIX_LFS_DEL = "-version https://git-lfs.github.com/spec/";
+ private const string PREFIX_LFS_MODIFY = " version https://git-lfs.github.com/spec/";
public Diff(string repo, Models.DiffOption opt)
{
@@ -46,7 +46,8 @@ namespace SourceGit.Commands
protected override void OnReadline(string line)
{
- if (_result.IsBinary) return;
+ if (_result.IsBinary)
+ return;
if (_result.IsLFS)
{
@@ -85,7 +86,8 @@ namespace SourceGit.Commands
var match = REG_INDICATOR().Match(line);
if (!match.Success)
{
- if (line.StartsWith("Binary", StringComparison.Ordinal)) _result.IsBinary = true;
+ if (line.StartsWith("Binary", StringComparison.Ordinal))
+ _result.IsBinary = true;
return;
}
@@ -167,10 +169,12 @@ namespace SourceGit.Commands
var left = _deleted[i];
var right = _added[i];
- if (left.Content.Length > 1024 || right.Content.Length > 1024) continue;
+ if (left.Content.Length > 1024 || right.Content.Length > 1024)
+ continue;
var chunks = Models.TextInlineChange.Compare(left.Content, right.Content);
- if (chunks.Count > 4) continue;
+ if (chunks.Count > 4)
+ continue;
foreach (var chunk in chunks)
{
@@ -204,4 +208,4 @@ namespace SourceGit.Commands
private int _oldLine = 0;
private int _newLine = 0;
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/Discard.cs b/src/SourceGit/Commands/Discard.cs
index 11f174d6..072dc59a 100644
--- a/src/SourceGit/Commands/Discard.cs
+++ b/src/SourceGit/Commands/Discard.cs
@@ -47,9 +47,10 @@ namespace SourceGit.Commands
{
var count = Math.Min(10, changes.Count - i);
var files = new List();
- for (int j = 0; j < count; j++) files.Add(changes[i + j].Path);
+ for (int j = 0; j < count; j++)
+ files.Add(changes[i + j].Path);
new Restore(repo, files, "--staged --worktree").Exec();
}
}
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/Fetch.cs b/src/SourceGit/Commands/Fetch.cs
index 3b068d2d..f195c011 100644
--- a/src/SourceGit/Commands/Fetch.cs
+++ b/src/SourceGit/Commands/Fetch.cs
@@ -25,7 +25,8 @@ namespace SourceGit.Commands
}
Args += "fetch --progress --verbose ";
- if (prune) Args += "--prune ";
+ if (prune)
+ Args += "--prune ";
Args += remote;
AutoFetch.MarkFetched(repo);
@@ -61,6 +62,8 @@ namespace SourceGit.Commands
public class AutoFetch
{
+ private const double INTERVAL = 10 * 60;
+
public static bool IsEnabled
{
get;
@@ -101,7 +104,7 @@ namespace SourceGit.Commands
foreach (var job in uptodate)
{
job.Cmd.Exec();
- job.NextRunTimepoint = DateTime.Now.AddSeconds(_fetchInterval);
+ job.NextRunTimepoint = DateTime.Now.AddSeconds(INTERVAL);
}
Thread.Sleep(2000);
@@ -114,7 +117,7 @@ namespace SourceGit.Commands
var job = new Job
{
Cmd = new Fetch(repo, "--all", true, null) { RaiseError = false },
- NextRunTimepoint = DateTime.Now.AddSeconds(_fetchInterval),
+ NextRunTimepoint = DateTime.Now.AddSeconds(INTERVAL),
};
lock (_lock)
@@ -142,15 +145,14 @@ namespace SourceGit.Commands
{
lock (_lock)
{
- if (_jobs.ContainsKey(repo))
+ if (_jobs.TryGetValue(repo, out var value))
{
- _jobs[repo].NextRunTimepoint = DateTime.Now.AddSeconds(_fetchInterval);
+ value.NextRunTimepoint = DateTime.Now.AddSeconds(INTERVAL);
}
}
}
private static readonly Dictionary _jobs = new Dictionary();
private static readonly object _lock = new object();
- private static readonly double _fetchInterval = 10 * 60;
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/FormatPatch.cs b/src/SourceGit/Commands/FormatPatch.cs
index 5310115c..2c7359c0 100644
--- a/src/SourceGit/Commands/FormatPatch.cs
+++ b/src/SourceGit/Commands/FormatPatch.cs
@@ -9,4 +9,4 @@
Args = $"format-patch {commit} -1 -o \"{saveTo}\"";
}
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/GC.cs b/src/SourceGit/Commands/GC.cs
index a38f6147..f40b665c 100644
--- a/src/SourceGit/Commands/GC.cs
+++ b/src/SourceGit/Commands/GC.cs
@@ -20,4 +20,4 @@ namespace SourceGit.Commands
private readonly Action _outputHandler;
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/GetImageFileAsBitmap.cs b/src/SourceGit/Commands/GetImageFileAsBitmap.cs
index 05da8cc1..e145d67f 100644
--- a/src/SourceGit/Commands/GetImageFileAsBitmap.cs
+++ b/src/SourceGit/Commands/GetImageFileAsBitmap.cs
@@ -37,4 +37,4 @@ namespace SourceGit.Commands
}
}
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/GitFlow.cs b/src/SourceGit/Commands/GitFlow.cs
index 3a52ed83..e47631c1 100644
--- a/src/SourceGit/Commands/GitFlow.cs
+++ b/src/SourceGit/Commands/GitFlow.cs
@@ -17,10 +17,12 @@ namespace SourceGit.Commands
var current = branches.Find(x => x.IsCurrent);
var masterBranch = branches.Find(x => x.Name == master);
- if (masterBranch == null && current != null) Branch.Create(WorkingDirectory, master, current.Head);
+ if (masterBranch == null && current != null)
+ Branch.Create(WorkingDirectory, master, current.Head);
var devBranch = branches.Find(x => x.Name == develop);
- if (devBranch == null && current != null) Branch.Create(WorkingDirectory, develop, current.Head);
+ if (devBranch == null && current != null)
+ Branch.Create(WorkingDirectory, develop, current.Head);
var cmd = new Config(WorkingDirectory);
cmd.Set("gitflow.branch.master", master);
@@ -85,4 +87,4 @@ namespace SourceGit.Commands
return Exec();
}
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/Init.cs b/src/SourceGit/Commands/Init.cs
index f0c03149..c44486da 100644
--- a/src/SourceGit/Commands/Init.cs
+++ b/src/SourceGit/Commands/Init.cs
@@ -9,4 +9,4 @@
Args = "init -q";
}
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/IsBinary.cs b/src/SourceGit/Commands/IsBinary.cs
index ef97eefc..de59b5a4 100644
--- a/src/SourceGit/Commands/IsBinary.cs
+++ b/src/SourceGit/Commands/IsBinary.cs
@@ -20,4 +20,4 @@ namespace SourceGit.Commands
return REG_TEST().IsMatch(ReadToEnd().StdOut);
}
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/IsLFSFiltered.cs b/src/SourceGit/Commands/IsLFSFiltered.cs
index 33f9abfb..b29039de 100644
--- a/src/SourceGit/Commands/IsLFSFiltered.cs
+++ b/src/SourceGit/Commands/IsLFSFiltered.cs
@@ -16,4 +16,4 @@
return rs.IsSuccess && rs.StdOut.Contains("filter\0lfs");
}
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/LFS.cs b/src/SourceGit/Commands/LFS.cs
index 1b94ad75..3b8a1cc2 100644
--- a/src/SourceGit/Commands/LFS.cs
+++ b/src/SourceGit/Commands/LFS.cs
@@ -32,7 +32,8 @@ namespace SourceGit.Commands
public bool IsEnabled()
{
var path = Path.Combine(_repo, ".git", "hooks", "pre-push");
- if (!File.Exists(path)) return false;
+ if (!File.Exists(path))
+ return false;
var content = File.ReadAllText(path);
return content.Contains("git lfs pre-push");
@@ -45,4 +46,4 @@ namespace SourceGit.Commands
private readonly string _repo;
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/Merge.cs b/src/SourceGit/Commands/Merge.cs
index 6c3eb934..cf2e285f 100644
--- a/src/SourceGit/Commands/Merge.cs
+++ b/src/SourceGit/Commands/Merge.cs
@@ -20,4 +20,4 @@ namespace SourceGit.Commands
private readonly Action _outputHandler = null;
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/MergeTool.cs b/src/SourceGit/Commands/MergeTool.cs
index 6701eb4b..75b88bc9 100644
--- a/src/SourceGit/Commands/MergeTool.cs
+++ b/src/SourceGit/Commands/MergeTool.cs
@@ -60,4 +60,4 @@ namespace SourceGit.Commands
return cmd.Exec();
}
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/Pull.cs b/src/SourceGit/Commands/Pull.cs
index 1381e0fe..d4f15dda 100644
--- a/src/SourceGit/Commands/Pull.cs
+++ b/src/SourceGit/Commands/Pull.cs
@@ -22,7 +22,8 @@ namespace SourceGit.Commands
}
Args += "pull --verbose --progress --tags ";
- if (useRebase) Args += "--rebase ";
+ if (useRebase)
+ Args += "--rebase ";
Args += $"{remote} {branch}";
}
@@ -33,4 +34,4 @@ namespace SourceGit.Commands
private readonly Action _outputHandler;
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/Push.cs b/src/SourceGit/Commands/Push.cs
index a15591f3..b3e4814a 100644
--- a/src/SourceGit/Commands/Push.cs
+++ b/src/SourceGit/Commands/Push.cs
@@ -23,9 +23,12 @@ namespace SourceGit.Commands
Args += "push --progress --verbose ";
- if (withTags) Args += "--tags ";
- if (track) Args += "-u ";
- if (force) Args += "--force-with-lease ";
+ if (withTags)
+ Args += "--tags ";
+ if (track)
+ Args += "-u ";
+ if (force)
+ Args += "--force-with-lease ";
Args += $"{remote} {local}:{remoteBranch}";
}
@@ -71,7 +74,8 @@ namespace SourceGit.Commands
}
Args += "push ";
- if (isDelete) Args += "--delete ";
+ if (isDelete)
+ Args += "--delete ";
Args += $"{remote} refs/tags/{tag}";
}
@@ -82,4 +86,4 @@ namespace SourceGit.Commands
private readonly Action _outputHandler = null;
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/QueryBranches.cs b/src/SourceGit/Commands/QueryBranches.cs
index 3b993831..cc726fd9 100644
--- a/src/SourceGit/Commands/QueryBranches.cs
+++ b/src/SourceGit/Commands/QueryBranches.cs
@@ -6,8 +6,8 @@ namespace SourceGit.Commands
{
public partial class QueryBranches : Command
{
- private static readonly string PREFIX_LOCAL = "refs/heads/";
- private static readonly string PREFIX_REMOTE = "refs/remotes/";
+ private const string PREFIX_LOCAL = "refs/heads/";
+ private const string PREFIX_REMOTE = "refs/remotes/";
[GeneratedRegex(@"^(\d+)\s(\d+)$")]
private static partial Regex REG_AHEAD_BEHIND();
@@ -44,11 +44,13 @@ namespace SourceGit.Commands
protected override void OnReadline(string line)
{
var parts = line.Split('$');
- if (parts.Length != 5) return;
+ if (parts.Length != 5)
+ return;
var branch = new Models.Branch();
var refName = parts[0];
- if (refName.EndsWith("/HEAD", StringComparison.Ordinal)) return;
+ if (refName.EndsWith("/HEAD", StringComparison.Ordinal))
+ return;
if (refName.StartsWith(PREFIX_LOCAL, StringComparison.Ordinal))
{
@@ -59,7 +61,8 @@ namespace SourceGit.Commands
{
var name = refName.Substring(PREFIX_REMOTE.Length);
var shortNameIdx = name.IndexOf('/', StringComparison.Ordinal);
- if (shortNameIdx < 0) return;
+ if (shortNameIdx < 0)
+ return;
branch.Remote = name.Substring(0, shortNameIdx);
branch.Name = name.Substring(branch.Remote.Length + 1);
@@ -87,19 +90,23 @@ namespace SourceGit.Commands
cmd.Args = $"rev-list --left-right --count {local}...{upstream}";
var rs = cmd.ReadToEnd();
- if (!rs.IsSuccess) return string.Empty;
+ if (!rs.IsSuccess)
+ return string.Empty;
var match = REG_AHEAD_BEHIND().Match(rs.StdOut);
- if (!match.Success) return string.Empty;
+ if (!match.Success)
+ return string.Empty;
var ahead = int.Parse(match.Groups[1].Value);
var behind = int.Parse(match.Groups[2].Value);
var track = "";
- if (ahead > 0) track += $"{ahead}↑";
- if (behind > 0) track += $" {behind}↓";
+ if (ahead > 0)
+ track += $"{ahead}↑";
+ if (behind > 0)
+ track += $" {behind}↓";
return track.Trim();
}
private readonly List _branches = new List();
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/QueryCommitChanges.cs b/src/SourceGit/Commands/QueryCommitChanges.cs
index b2edfdff..e7481b89 100644
--- a/src/SourceGit/Commands/QueryCommitChanges.cs
+++ b/src/SourceGit/Commands/QueryCommitChanges.cs
@@ -25,21 +25,37 @@ namespace SourceGit.Commands
protected override void OnReadline(string line)
{
var match = REG_FORMAT().Match(line);
- if (!match.Success) return;
+ if (!match.Success)
+ return;
var change = new Models.Change() { Path = match.Groups[2].Value };
var status = match.Groups[1].Value;
switch (status[0])
{
- case 'M': change.Set(Models.ChangeState.Modified); _changes.Add(change); break;
- case 'A': change.Set(Models.ChangeState.Added); _changes.Add(change); break;
- case 'D': change.Set(Models.ChangeState.Deleted); _changes.Add(change); break;
- case 'R': change.Set(Models.ChangeState.Renamed); _changes.Add(change); break;
- case 'C': change.Set(Models.ChangeState.Copied); _changes.Add(change); break;
+ case 'M':
+ change.Set(Models.ChangeState.Modified);
+ _changes.Add(change);
+ break;
+ case 'A':
+ change.Set(Models.ChangeState.Added);
+ _changes.Add(change);
+ break;
+ case 'D':
+ change.Set(Models.ChangeState.Deleted);
+ _changes.Add(change);
+ break;
+ case 'R':
+ change.Set(Models.ChangeState.Renamed);
+ _changes.Add(change);
+ break;
+ case 'C':
+ change.Set(Models.ChangeState.Copied);
+ _changes.Add(change);
+ break;
}
}
private readonly List _changes = new List();
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/QueryCommits.cs b/src/SourceGit/Commands/QueryCommits.cs
index e8c421f9..7d6ad169 100644
--- a/src/SourceGit/Commands/QueryCommits.cs
+++ b/src/SourceGit/Commands/QueryCommits.cs
@@ -5,8 +5,8 @@ namespace SourceGit.Commands
{
public class QueryCommits : Command
{
- private static readonly string GPGSIG_START = "gpgsig -----BEGIN PGP SIGNATURE-----";
- private static readonly string GPGSIG_END = " -----END PGP SIGNATURE-----";
+ private const string GPGSIG_START = "gpgsig -----BEGIN PGP SIGNATURE-----";
+ private const string GPGSIG_END = " -----END PGP SIGNATURE-----";
private readonly List commits = new List();
private Models.Commit current = null;
@@ -43,7 +43,8 @@ namespace SourceGit.Commands
{
if (isSkipingGpgsig)
{
- if (line.StartsWith(GPGSIG_END, StringComparison.Ordinal)) isSkipingGpgsig = false;
+ if (line.StartsWith(GPGSIG_END, StringComparison.Ordinal))
+ isSkipingGpgsig = false;
return;
}
else if (line.StartsWith(GPGSIG_START, StringComparison.Ordinal))
@@ -72,13 +73,15 @@ namespace SourceGit.Commands
{
current.SHA = line.Substring(0, decoratorStart).Trim();
current.IsMerged = ParseDecorators(current.Decorators, line.Substring(decoratorStart + 1));
- if (!isHeadFounded) isHeadFounded = current.IsMerged;
+ if (!isHeadFounded)
+ isHeadFounded = current.IsMerged;
}
return;
}
- if (current == null) return;
+ if (current == null)
+ return;
if (line.StartsWith("tree ", StringComparison.Ordinal))
{
@@ -182,10 +185,12 @@ namespace SourceGit.Commands
var rs = ReadToEnd();
var shas = rs.StdOut.Split(new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries);
- if (shas.Length == 0) return;
+ if (shas.Length == 0)
+ return;
var set = new HashSet();
- foreach (var sha in shas) set.Add(sha);
+ foreach (var sha in shas)
+ set.Add(sha);
foreach (var c in commits)
{
@@ -197,4 +202,4 @@ namespace SourceGit.Commands
}
}
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/QueryFileContent.cs b/src/SourceGit/Commands/QueryFileContent.cs
index e0898105..975f4264 100644
--- a/src/SourceGit/Commands/QueryFileContent.cs
+++ b/src/SourceGit/Commands/QueryFileContent.cs
@@ -25,4 +25,4 @@ namespace SourceGit.Commands
private readonly StringBuilder _builder = new StringBuilder();
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/QueryFileSize.cs b/src/SourceGit/Commands/QueryFileSize.cs
index c2c031c6..5ce7641e 100644
--- a/src/SourceGit/Commands/QueryFileSize.cs
+++ b/src/SourceGit/Commands/QueryFileSize.cs
@@ -17,7 +17,8 @@ namespace SourceGit.Commands
public long Result()
{
- if (_result != 0) return _result;
+ if (_result != 0)
+ return _result;
var rs = ReadToEnd();
if (rs.IsSuccess)
@@ -34,4 +35,4 @@ namespace SourceGit.Commands
private readonly long _result = 0;
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/QueryGitDir.cs b/src/SourceGit/Commands/QueryGitDir.cs
index f7ed0cc0..e3a94baf 100644
--- a/src/SourceGit/Commands/QueryGitDir.cs
+++ b/src/SourceGit/Commands/QueryGitDir.cs
@@ -14,11 +14,13 @@ namespace SourceGit.Commands
public string Result()
{
var rs = ReadToEnd().StdOut;
- if (string.IsNullOrEmpty(rs)) return null;
+ if (string.IsNullOrEmpty(rs))
+ return null;
rs = rs.Trim();
- if (Path.IsPathRooted(rs)) return rs;
+ if (Path.IsPathRooted(rs))
+ return rs;
return Path.GetFullPath(Path.Combine(WorkingDirectory, rs));
}
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/QueryLocalChanges.cs b/src/SourceGit/Commands/QueryLocalChanges.cs
index 943f3a72..2f1e89b8 100644
--- a/src/SourceGit/Commands/QueryLocalChanges.cs
+++ b/src/SourceGit/Commands/QueryLocalChanges.cs
@@ -26,43 +26,102 @@ namespace SourceGit.Commands
protected override void OnReadline(string line)
{
var match = REG_FORMAT().Match(line);
- if (!match.Success) return;
- if (line.EndsWith("/", StringComparison.Ordinal)) return; // Ignore changes with git-worktree
+ if (!match.Success)
+ return;
+ if (line.EndsWith("/", StringComparison.Ordinal))
+ return; // Ignore changes with git-worktree
var change = new Models.Change() { Path = match.Groups[2].Value };
var status = match.Groups[1].Value;
switch (status)
{
- case " M": change.Set(Models.ChangeState.None, Models.ChangeState.Modified); break;
- case " A": change.Set(Models.ChangeState.None, Models.ChangeState.Added); break;
- case " D": change.Set(Models.ChangeState.None, Models.ChangeState.Deleted); break;
- case " R": change.Set(Models.ChangeState.None, Models.ChangeState.Renamed); break;
- case " C": change.Set(Models.ChangeState.None, Models.ChangeState.Copied); break;
- case "M": change.Set(Models.ChangeState.Modified, Models.ChangeState.None); break;
- case "MM": change.Set(Models.ChangeState.Modified, Models.ChangeState.Modified); break;
- case "MD": change.Set(Models.ChangeState.Modified, Models.ChangeState.Deleted); break;
- case "A": change.Set(Models.ChangeState.Added, Models.ChangeState.None); break;
- case "AM": change.Set(Models.ChangeState.Added, Models.ChangeState.Modified); break;
- case "AD": change.Set(Models.ChangeState.Added, Models.ChangeState.Deleted); break;
- case "D": change.Set(Models.ChangeState.Deleted, Models.ChangeState.None); break;
- case "R": change.Set(Models.ChangeState.Renamed, Models.ChangeState.None); break;
- case "RM": change.Set(Models.ChangeState.Renamed, Models.ChangeState.Modified); break;
- case "RD": change.Set(Models.ChangeState.Renamed, Models.ChangeState.Deleted); break;
- case "C": change.Set(Models.ChangeState.Copied, Models.ChangeState.None); break;
- case "CM": change.Set(Models.ChangeState.Copied, Models.ChangeState.Modified); break;
- case "CD": change.Set(Models.ChangeState.Copied, Models.ChangeState.Deleted); break;
- case "DR": change.Set(Models.ChangeState.Deleted, Models.ChangeState.Renamed); break;
- case "DC": change.Set(Models.ChangeState.Deleted, Models.ChangeState.Copied); break;
- case "DD": change.Set(Models.ChangeState.Deleted, Models.ChangeState.Deleted); break;
- case "AU": change.Set(Models.ChangeState.Added, Models.ChangeState.Unmerged); break;
- case "UD": change.Set(Models.ChangeState.Unmerged, Models.ChangeState.Deleted); break;
- case "UA": change.Set(Models.ChangeState.Unmerged, Models.ChangeState.Added); break;
- case "DU": change.Set(Models.ChangeState.Deleted, Models.ChangeState.Unmerged); break;
- case "AA": change.Set(Models.ChangeState.Added, Models.ChangeState.Added); break;
- case "UU": change.Set(Models.ChangeState.Unmerged, Models.ChangeState.Unmerged); break;
- case "??": change.Set(Models.ChangeState.Untracked, Models.ChangeState.Untracked); break;
- default: return;
+ case " M":
+ change.Set(Models.ChangeState.None, Models.ChangeState.Modified);
+ break;
+ case " A":
+ change.Set(Models.ChangeState.None, Models.ChangeState.Added);
+ break;
+ case " D":
+ change.Set(Models.ChangeState.None, Models.ChangeState.Deleted);
+ break;
+ case " R":
+ change.Set(Models.ChangeState.None, Models.ChangeState.Renamed);
+ break;
+ case " C":
+ change.Set(Models.ChangeState.None, Models.ChangeState.Copied);
+ break;
+ case "M":
+ change.Set(Models.ChangeState.Modified, Models.ChangeState.None);
+ break;
+ case "MM":
+ change.Set(Models.ChangeState.Modified, Models.ChangeState.Modified);
+ break;
+ case "MD":
+ change.Set(Models.ChangeState.Modified, Models.ChangeState.Deleted);
+ break;
+ case "A":
+ change.Set(Models.ChangeState.Added, Models.ChangeState.None);
+ break;
+ case "AM":
+ change.Set(Models.ChangeState.Added, Models.ChangeState.Modified);
+ break;
+ case "AD":
+ change.Set(Models.ChangeState.Added, Models.ChangeState.Deleted);
+ break;
+ case "D":
+ change.Set(Models.ChangeState.Deleted, Models.ChangeState.None);
+ break;
+ case "R":
+ change.Set(Models.ChangeState.Renamed, Models.ChangeState.None);
+ break;
+ case "RM":
+ change.Set(Models.ChangeState.Renamed, Models.ChangeState.Modified);
+ break;
+ case "RD":
+ change.Set(Models.ChangeState.Renamed, Models.ChangeState.Deleted);
+ break;
+ case "C":
+ change.Set(Models.ChangeState.Copied, Models.ChangeState.None);
+ break;
+ case "CM":
+ change.Set(Models.ChangeState.Copied, Models.ChangeState.Modified);
+ break;
+ case "CD":
+ change.Set(Models.ChangeState.Copied, Models.ChangeState.Deleted);
+ break;
+ case "DR":
+ change.Set(Models.ChangeState.Deleted, Models.ChangeState.Renamed);
+ break;
+ case "DC":
+ change.Set(Models.ChangeState.Deleted, Models.ChangeState.Copied);
+ break;
+ case "DD":
+ change.Set(Models.ChangeState.Deleted, Models.ChangeState.Deleted);
+ break;
+ case "AU":
+ change.Set(Models.ChangeState.Added, Models.ChangeState.Unmerged);
+ break;
+ case "UD":
+ change.Set(Models.ChangeState.Unmerged, Models.ChangeState.Deleted);
+ break;
+ case "UA":
+ change.Set(Models.ChangeState.Unmerged, Models.ChangeState.Added);
+ break;
+ case "DU":
+ change.Set(Models.ChangeState.Deleted, Models.ChangeState.Unmerged);
+ break;
+ case "AA":
+ change.Set(Models.ChangeState.Added, Models.ChangeState.Added);
+ break;
+ case "UU":
+ change.Set(Models.ChangeState.Unmerged, Models.ChangeState.Unmerged);
+ break;
+ case "??":
+ change.Set(Models.ChangeState.Untracked, Models.ChangeState.Untracked);
+ break;
+ default:
+ return;
}
_changes.Add(change);
@@ -70,4 +129,4 @@ namespace SourceGit.Commands
private readonly List _changes = new List();
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/QueryRemotes.cs b/src/SourceGit/Commands/QueryRemotes.cs
index ed2a26e6..b5b41b4a 100644
--- a/src/SourceGit/Commands/QueryRemotes.cs
+++ b/src/SourceGit/Commands/QueryRemotes.cs
@@ -24,7 +24,8 @@ namespace SourceGit.Commands
protected override void OnReadline(string line)
{
var match = REG_REMOTE().Match(line);
- if (!match.Success) return;
+ if (!match.Success)
+ return;
var remote = new Models.Remote()
{
@@ -32,10 +33,11 @@ namespace SourceGit.Commands
URL = match.Groups[2].Value,
};
- if (_loaded.Find(x => x.Name == remote.Name) != null) return;
+ if (_loaded.Find(x => x.Name == remote.Name) != null)
+ return;
_loaded.Add(remote);
}
private readonly List _loaded = new List();
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/QueryRepositoryRootPath.cs b/src/SourceGit/Commands/QueryRepositoryRootPath.cs
index fad9fe34..1eef5af8 100644
--- a/src/SourceGit/Commands/QueryRepositoryRootPath.cs
+++ b/src/SourceGit/Commands/QueryRepositoryRootPath.cs
@@ -12,8 +12,9 @@
public string Result()
{
var rs = ReadToEnd().StdOut;
- if (string.IsNullOrEmpty(rs)) return null;
+ if (string.IsNullOrEmpty(rs))
+ return null;
return rs.Trim();
}
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/QueryRevisionObjects.cs b/src/SourceGit/Commands/QueryRevisionObjects.cs
index 5c97b5bf..7a3db057 100644
--- a/src/SourceGit/Commands/QueryRevisionObjects.cs
+++ b/src/SourceGit/Commands/QueryRevisionObjects.cs
@@ -26,7 +26,8 @@ namespace SourceGit.Commands
protected override void OnReadline(string line)
{
var match = REG_FORMAT().Match(line);
- if (!match.Success) return;
+ if (!match.Success)
+ return;
var obj = new Models.Object();
obj.SHA = match.Groups[2].Value;
@@ -35,13 +36,21 @@ namespace SourceGit.Commands
switch (match.Groups[1].Value)
{
- case "blob": obj.Type = Models.ObjectType.Blob; break;
- case "tree": obj.Type = Models.ObjectType.Tree; break;
- case "tag": obj.Type = Models.ObjectType.Tag; break;
- case "commit": obj.Type = Models.ObjectType.Commit; break;
+ case "blob":
+ obj.Type = Models.ObjectType.Blob;
+ break;
+ case "tree":
+ obj.Type = Models.ObjectType.Tree;
+ break;
+ case "tag":
+ obj.Type = Models.ObjectType.Tag;
+ break;
+ case "commit":
+ obj.Type = Models.ObjectType.Commit;
+ break;
}
objects.Add(obj);
}
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/QueryStagedFileBlobGuid.cs b/src/SourceGit/Commands/QueryStagedFileBlobGuid.cs
index 5fa56dd6..3f52a5f2 100644
--- a/src/SourceGit/Commands/QueryStagedFileBlobGuid.cs
+++ b/src/SourceGit/Commands/QueryStagedFileBlobGuid.cs
@@ -26,4 +26,4 @@ namespace SourceGit.Commands
return string.Empty;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/QueryStashChanges.cs b/src/SourceGit/Commands/QueryStashChanges.cs
index ad02ef00..bf61ca2d 100644
--- a/src/SourceGit/Commands/QueryStashChanges.cs
+++ b/src/SourceGit/Commands/QueryStashChanges.cs
@@ -25,21 +25,37 @@ namespace SourceGit.Commands
protected override void OnReadline(string line)
{
var match = REG_FORMAT().Match(line);
- if (!match.Success) return;
+ if (!match.Success)
+ return;
var change = new Models.Change() { Path = match.Groups[2].Value };
var status = match.Groups[1].Value;
switch (status[0])
{
- case 'M': change.Set(Models.ChangeState.Modified); _changes.Add(change); break;
- case 'A': change.Set(Models.ChangeState.Added); _changes.Add(change); break;
- case 'D': change.Set(Models.ChangeState.Deleted); _changes.Add(change); break;
- case 'R': change.Set(Models.ChangeState.Renamed); _changes.Add(change); break;
- case 'C': change.Set(Models.ChangeState.Copied); _changes.Add(change); break;
+ case 'M':
+ change.Set(Models.ChangeState.Modified);
+ _changes.Add(change);
+ break;
+ case 'A':
+ change.Set(Models.ChangeState.Added);
+ _changes.Add(change);
+ break;
+ case 'D':
+ change.Set(Models.ChangeState.Deleted);
+ _changes.Add(change);
+ break;
+ case 'R':
+ change.Set(Models.ChangeState.Renamed);
+ _changes.Add(change);
+ break;
+ case 'C':
+ change.Set(Models.ChangeState.Copied);
+ _changes.Add(change);
+ break;
}
}
private readonly List _changes = new List();
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/QueryStashes.cs b/src/SourceGit/Commands/QueryStashes.cs
index e9023574..5362f87b 100644
--- a/src/SourceGit/Commands/QueryStashes.cs
+++ b/src/SourceGit/Commands/QueryStashes.cs
@@ -20,7 +20,8 @@ namespace SourceGit.Commands
public List Result()
{
Exec();
- if (_current != null) _stashes.Add(_current);
+ if (_current != null)
+ _stashes.Add(_current);
return _stashes;
}
@@ -28,17 +29,20 @@ namespace SourceGit.Commands
{
if (line.StartsWith("commit ", StringComparison.Ordinal))
{
- if (_current != null && !string.IsNullOrEmpty(_current.Name)) _stashes.Add(_current);
+ if (_current != null && !string.IsNullOrEmpty(_current.Name))
+ _stashes.Add(_current);
_current = new Models.Stash() { SHA = line.Substring(7, 8) };
return;
}
- if (_current == null) return;
+ if (_current == null)
+ return;
if (line.StartsWith("Reflog: refs/stash@", StringComparison.Ordinal))
{
var match = REG_STASH().Match(line);
- if (match.Success) _current.Name = match.Groups[1].Value;
+ if (match.Success)
+ _current.Name = match.Groups[1].Value;
}
else if (line.StartsWith("Reflog message: ", StringComparison.Ordinal))
{
@@ -57,4 +61,4 @@ namespace SourceGit.Commands
private readonly List _stashes = new List();
private Models.Stash _current = null;
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/QuerySubmodules.cs b/src/SourceGit/Commands/QuerySubmodules.cs
index 58c858d4..622de2fc 100644
--- a/src/SourceGit/Commands/QuerySubmodules.cs
+++ b/src/SourceGit/Commands/QuerySubmodules.cs
@@ -41,4 +41,4 @@ namespace SourceGit.Commands
private readonly List _submodules = new List();
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/QueryTags.cs b/src/SourceGit/Commands/QueryTags.cs
index a4d5a65d..0b5b747f 100644
--- a/src/SourceGit/Commands/QueryTags.cs
+++ b/src/SourceGit/Commands/QueryTags.cs
@@ -41,4 +41,4 @@ namespace SourceGit.Commands
private readonly List _loaded = new List();
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/Rebase.cs b/src/SourceGit/Commands/Rebase.cs
index faa4f5c5..d08d55ad 100644
--- a/src/SourceGit/Commands/Rebase.cs
+++ b/src/SourceGit/Commands/Rebase.cs
@@ -7,8 +7,9 @@
WorkingDirectory = repo;
Context = repo;
Args = "rebase ";
- if (autoStash) Args += "--autostash ";
+ if (autoStash)
+ Args += "--autostash ";
Args += basedOn;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/Remote.cs b/src/SourceGit/Commands/Remote.cs
index d669b0a3..46aa37e3 100644
--- a/src/SourceGit/Commands/Remote.cs
+++ b/src/SourceGit/Commands/Remote.cs
@@ -38,4 +38,4 @@
return Exec();
}
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/Reset.cs b/src/SourceGit/Commands/Reset.cs
index c44eae12..da272135 100644
--- a/src/SourceGit/Commands/Reset.cs
+++ b/src/SourceGit/Commands/Reset.cs
@@ -35,4 +35,4 @@ namespace SourceGit.Commands
Args = $"reset {mode} {revision}";
}
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/Restore.cs b/src/SourceGit/Commands/Restore.cs
index f55f6b70..12a2eaa1 100644
--- a/src/SourceGit/Commands/Restore.cs
+++ b/src/SourceGit/Commands/Restore.cs
@@ -12,10 +12,12 @@ namespace SourceGit.Commands
StringBuilder builder = new StringBuilder();
builder.Append("restore ");
- if (!string.IsNullOrEmpty(extra)) builder.Append(extra).Append(" ");
+ if (!string.IsNullOrEmpty(extra))
+ builder.Append(extra).Append(" ");
builder.Append("--");
- foreach (var f in files) builder.Append(' ').Append('"').Append(f).Append('"');
+ foreach (var f in files)
+ builder.Append(' ').Append('"').Append(f).Append('"');
Args = builder.ToString();
}
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/Revert.cs b/src/SourceGit/Commands/Revert.cs
index 12149c97..b6c3913a 100644
--- a/src/SourceGit/Commands/Revert.cs
+++ b/src/SourceGit/Commands/Revert.cs
@@ -7,7 +7,8 @@
WorkingDirectory = repo;
Context = repo;
Args = $"revert {commit} --no-edit";
- if (!autoCommit) Args += " --no-commit";
+ if (!autoCommit)
+ Args += " --no-commit";
}
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/SaveChangesAsPatch.cs b/src/SourceGit/Commands/SaveChangesAsPatch.cs
index 25003059..f15cc2f2 100644
--- a/src/SourceGit/Commands/SaveChangesAsPatch.cs
+++ b/src/SourceGit/Commands/SaveChangesAsPatch.cs
@@ -15,7 +15,8 @@ namespace SourceGit.Commands
{
foreach (var change in changes)
{
- if (!ProcessSingleChange(repo, new Models.DiffOption(change, isUnstaged), sw)) return false;
+ if (!ProcessSingleChange(repo, new Models.DiffOption(change, isUnstaged), sw))
+ return false;
}
}
@@ -54,4 +55,4 @@ namespace SourceGit.Commands
}
}
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/SaveRevisionFile.cs b/src/SourceGit/Commands/SaveRevisionFile.cs
index a19a4397..41575efc 100644
--- a/src/SourceGit/Commands/SaveRevisionFile.cs
+++ b/src/SourceGit/Commands/SaveRevisionFile.cs
@@ -53,7 +53,8 @@ namespace SourceGit.Commands
while (true)
{
var line = sr.ReadLine();
- if (line == null) break;
+ if (line == null)
+ break;
proc.StandardInput.WriteLine(line);
}
}
@@ -77,4 +78,4 @@ namespace SourceGit.Commands
}
}
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/Stash.cs b/src/SourceGit/Commands/Stash.cs
index cb0c18e7..3e784f60 100644
--- a/src/SourceGit/Commands/Stash.cs
+++ b/src/SourceGit/Commands/Stash.cs
@@ -79,4 +79,4 @@ namespace SourceGit.Commands
return Exec();
}
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/Statistics.cs b/src/SourceGit/Commands/Statistics.cs
index 36a048a7..85f5a4fb 100644
--- a/src/SourceGit/Commands/Statistics.cs
+++ b/src/SourceGit/Commands/Statistics.cs
@@ -23,15 +23,17 @@ namespace SourceGit.Commands
protected override void OnReadline(string line)
{
var dateEndIdx = line.IndexOf('$', StringComparison.Ordinal);
- if (dateEndIdx == -1) return;
+ if (dateEndIdx == -1)
+ return;
var dateStr = line.Substring(0, dateEndIdx);
var date = 0.0;
- if (!double.TryParse(dateStr, out date)) return;
+ if (!double.TryParse(dateStr, out date))
+ return;
_statistics.AddCommit(line.Substring(dateEndIdx + 1), date);
}
private readonly Models.Statistics _statistics = null;
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/Submodule.cs b/src/SourceGit/Commands/Submodule.cs
index e5c385c3..428c10d1 100644
--- a/src/SourceGit/Commands/Submodule.cs
+++ b/src/SourceGit/Commands/Submodule.cs
@@ -14,7 +14,8 @@ namespace SourceGit.Commands
{
_outputHandler = outputHandler;
Args = $"submodule add {url} {relativePath}";
- if (!Exec()) return false;
+ if (!Exec())
+ return false;
if (recursive)
{
@@ -37,7 +38,8 @@ namespace SourceGit.Commands
public bool Delete(string relativePath)
{
Args = $"submodule deinit -f {relativePath}";
- if (!Exec()) return false;
+ if (!Exec())
+ return false;
Args = $"rm -rf {relativePath}";
return Exec();
@@ -50,4 +52,4 @@ namespace SourceGit.Commands
private Action _outputHandler;
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/Tag.cs b/src/SourceGit/Commands/Tag.cs
index 3b49deba..f96d3bc7 100644
--- a/src/SourceGit/Commands/Tag.cs
+++ b/src/SourceGit/Commands/Tag.cs
@@ -32,7 +32,8 @@ namespace SourceGit.Commands
cmd.WorkingDirectory = repo;
cmd.Context = repo;
cmd.Args = $"tag --delete {name}";
- if (!cmd.Exec()) return false;
+ if (!cmd.Exec())
+ return false;
if (remotes != null)
{
@@ -45,4 +46,4 @@ namespace SourceGit.Commands
return true;
}
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Commands/Version.cs b/src/SourceGit/Commands/Version.cs
index 7b368b04..ed7c6892 100644
--- a/src/SourceGit/Commands/Version.cs
+++ b/src/SourceGit/Commands/Version.cs
@@ -11,8 +11,9 @@
public string Query()
{
var rs = ReadToEnd();
- if (!rs.IsSuccess || string.IsNullOrWhiteSpace(rs.StdOut)) return string.Empty;
+ if (!rs.IsSuccess || string.IsNullOrWhiteSpace(rs.StdOut))
+ return string.Empty;
return rs.StdOut.Trim().Substring("git version ".Length);
}
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Converters/BookmarkConverters.cs b/src/SourceGit/Converters/BookmarkConverters.cs
index 01da5475..9896d9aa 100644
--- a/src/SourceGit/Converters/BookmarkConverters.cs
+++ b/src/SourceGit/Converters/BookmarkConverters.cs
@@ -5,10 +5,10 @@ namespace SourceGit.Converters
{
public static class BookmarkConverters
{
- public static FuncValueConverter ToBrush =
+ public static readonly FuncValueConverter ToBrush =
new FuncValueConverter(bookmark => Models.Bookmarks.Brushes[bookmark]);
- public static FuncValueConverter ToStrokeThickness =
+ public static readonly FuncValueConverter ToStrokeThickness =
new FuncValueConverter(bookmark => bookmark == 0 ? 1.0 : 0);
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Converters/BoolConverters.cs b/src/SourceGit/Converters/BoolConverters.cs
index 31f56499..1311e875 100644
--- a/src/SourceGit/Converters/BoolConverters.cs
+++ b/src/SourceGit/Converters/BoolConverters.cs
@@ -4,7 +4,7 @@ namespace SourceGit.Converters
{
public static class BoolConverters
{
- public static FuncValueConverter ToCommitOpacity =
+ public static readonly FuncValueConverter ToCommitOpacity =
new FuncValueConverter(x => x ? 1 : 0.5);
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Converters/BranchConverters.cs b/src/SourceGit/Converters/BranchConverters.cs
index 66675eca..d20ed89f 100644
--- a/src/SourceGit/Converters/BranchConverters.cs
+++ b/src/SourceGit/Converters/BranchConverters.cs
@@ -4,7 +4,7 @@ namespace SourceGit.Converters
{
public static class BranchConverters
{
- public static FuncValueConverter ToName =
+ public static readonly FuncValueConverter ToName =
new FuncValueConverter(v => v.IsLocal ? v.Name : $"{v.Remote}/{v.Name}");
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Converters/ChangeViewModeConverters.cs b/src/SourceGit/Converters/ChangeViewModeConverters.cs
index 90a0828f..01bc1774 100644
--- a/src/SourceGit/Converters/ChangeViewModeConverters.cs
+++ b/src/SourceGit/Converters/ChangeViewModeConverters.cs
@@ -6,7 +6,7 @@ namespace SourceGit.Converters
{
public static class ChangeViewModeConverters
{
- public static FuncValueConverter ToIcon =
+ public static readonly FuncValueConverter ToIcon =
new FuncValueConverter(v =>
{
switch (v)
@@ -20,13 +20,13 @@ namespace SourceGit.Converters
}
});
- public static FuncValueConverter IsList =
+ public static readonly FuncValueConverter IsList =
new FuncValueConverter(v => v == Models.ChangeViewMode.List);
- public static FuncValueConverter IsGrid =
+ public static readonly FuncValueConverter IsGrid =
new FuncValueConverter(v => v == Models.ChangeViewMode.Grid);
- public static FuncValueConverter IsTree =
+ public static readonly FuncValueConverter IsTree =
new FuncValueConverter(v => v == Models.ChangeViewMode.Tree);
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Converters/DecoratorTypeConverters.cs b/src/SourceGit/Converters/DecoratorTypeConverters.cs
index 10d6f0a7..9a65ab4d 100644
--- a/src/SourceGit/Converters/DecoratorTypeConverters.cs
+++ b/src/SourceGit/Converters/DecoratorTypeConverters.cs
@@ -7,14 +7,15 @@ namespace SourceGit.Converters
{
public static class DecoratorTypeConverters
{
- public static FuncValueConverter ToBackground =
+ public static readonly FuncValueConverter ToBackground =
new FuncValueConverter(v =>
{
- if (v == Models.DecoratorType.Tag) return Models.DecoratorResources.Backgrounds[0];
+ if (v == Models.DecoratorType.Tag)
+ return Models.DecoratorResources.Backgrounds[0];
return Models.DecoratorResources.Backgrounds[1];
});
- public static FuncValueConverter ToIcon =
+ public static readonly FuncValueConverter ToIcon =
new FuncValueConverter(v =>
{
var key = "Icons.Tag";
@@ -36,4 +37,4 @@ namespace SourceGit.Converters
return Application.Current?.FindResource(key) as StreamGeometry;
});
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Converters/FontSizeModifyConverters.cs b/src/SourceGit/Converters/FontSizeModifyConverters.cs
index e2f1864a..4c885e38 100644
--- a/src/SourceGit/Converters/FontSizeModifyConverters.cs
+++ b/src/SourceGit/Converters/FontSizeModifyConverters.cs
@@ -4,10 +4,10 @@ namespace SourceGit.Converters
{
public static class FontSizeModifyConverters
{
- public static FuncValueConverter Increase =
+ public static readonly FuncValueConverter Increase =
new FuncValueConverter(v => v + 1.0);
- public static FuncValueConverter Decrease =
+ public static readonly FuncValueConverter Decrease =
new FuncValueConverter(v => v - 1.0);
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Converters/IntConverters.cs b/src/SourceGit/Converters/IntConverters.cs
index f595505e..f89dab9b 100644
--- a/src/SourceGit/Converters/IntConverters.cs
+++ b/src/SourceGit/Converters/IntConverters.cs
@@ -4,13 +4,13 @@ namespace SourceGit.Converters
{
public static class IntConverters
{
- public static FuncValueConverter IsGreaterThanZero =
+ public static readonly FuncValueConverter IsGreaterThanZero =
new FuncValueConverter(v => v > 0);
- public static FuncValueConverter IsZero =
+ public static readonly FuncValueConverter IsZero =
new FuncValueConverter(v => v == 0);
- public static FuncValueConverter IsOne =
+ public static readonly FuncValueConverter IsOne =
new FuncValueConverter(v => v == 1);
}
-}
\ No newline at end of file
+}
diff --git a/src/SourceGit/Converters/LauncherPageConverters.cs b/src/SourceGit/Converters/LauncherPageConverters.cs
index 88d21d51..05eec2b1 100644
--- a/src/SourceGit/Converters/LauncherPageConverters.cs
+++ b/src/SourceGit/Converters/LauncherPageConverters.cs
@@ -7,17 +7,20 @@ namespace SourceGit.Converters
{
public static class LauncherPageConverters
{
- public static FuncMultiValueConverter