# EditorConfig for C# and Web projects
root = true

# All files
[*]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
charset = utf-8

# C# files
[*.cs]
indent_size = 4

# Code style rules
[*.cs]
# Indentation preferences
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_indent_labels = flush_left

# 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_between_query_expression_clauses = true

# Space preferences
csharp_space_after_cast = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_open_square_brackets = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_around_binary_operators = before_and_after
csharp_space_around_declaration_statements = false
csharp_space_before_open_brace = true
csharp_space_between_empty_square_brackets = false
csharp_space_between_method_declaration_parameter_list_parentheses = false

# Wrapping preferences
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = false

# Naming conventions
[*.cs]
# Style Definitions
dotnet_naming_style.pascal_case_style.required_prefix =
dotnet_naming_style.pascal_case_style.required_suffix =
dotnet_naming_style.pascal_case_style.word_separator =
dotnet_naming_style.pascal_case_style.capitalization = pascal_case

dotnet_naming_style.camel_case_style.required_prefix =
dotnet_naming_style.camel_case_style.required_suffix =
dotnet_naming_style.camel_case_style.word_separator =
dotnet_naming_style.camel_case_style.capitalization = camel_case

# Use PascalCase for public members
dotnet_naming_rule.public_members_pascal_case.symbols = public_symbols
dotnet_naming_rule.public_members_pascal_case.style = pascal_case_style
dotnet_naming_rule.public_members_pascal_case.severity = suggestion

dotnet_naming_symbols.public_symbols.applicable_kinds = property,method,field,event,delegate
dotnet_naming_symbols.public_symbols.applicable_accessibilities = public

# Use camelCase for private members
dotnet_naming_rule.private_members_camel_case.symbols = private_symbols
dotnet_naming_rule.private_members_camel_case.style = camel_case_style
dotnet_naming_rule.private_members_camel_case.severity = suggestion

dotnet_naming_symbols.private_symbols.applicable_kinds = property,method,field,event,delegate
dotnet_naming_symbols.private_symbols.applicable_accessibilities = private,protected
