csharp_new_line_before_open_brace = none
This commit is contained in:
296
ADO2024/PI4/.editorconfig
Normal file
296
ADO2024/PI4/.editorconfig
Normal file
@ -0,0 +1,296 @@
|
|||||||
|
[*.md]
|
||||||
|
end_of_line = crlf
|
||||||
|
file_header_template = unset
|
||||||
|
indent_size = 2
|
||||||
|
indent_style = space
|
||||||
|
insert_final_newline = false
|
||||||
|
root = true
|
||||||
|
tab_width = 2
|
||||||
|
[*.csproj]
|
||||||
|
end_of_line = crlf
|
||||||
|
file_header_template = unset
|
||||||
|
indent_size = 2
|
||||||
|
indent_style = space
|
||||||
|
insert_final_newline = false
|
||||||
|
root = true
|
||||||
|
tab_width = 2
|
||||||
|
[*.cs]
|
||||||
|
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_new_line_before_catch = false
|
||||||
|
csharp_new_line_before_else = false
|
||||||
|
csharp_new_line_before_finally = false
|
||||||
|
csharp_new_line_before_members_in_anonymous_types = true
|
||||||
|
csharp_new_line_before_members_in_object_initializers = true
|
||||||
|
csharp_new_line_before_open_brace = none
|
||||||
|
csharp_new_line_between_query_expression_clauses = true
|
||||||
|
csharp_prefer_braces = false
|
||||||
|
csharp_prefer_qualified_reference = true:error
|
||||||
|
csharp_prefer_simple_default_expression = true:warning
|
||||||
|
csharp_prefer_simple_using_statement = true:warning
|
||||||
|
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
|
||||||
|
csharp_preserve_single_line_blocks = true
|
||||||
|
csharp_preserve_single_line_statements = false
|
||||||
|
csharp_space_after_cast = false
|
||||||
|
csharp_space_after_colon_in_inheritance_clause = true
|
||||||
|
csharp_space_after_comma = true
|
||||||
|
csharp_space_after_dot = false
|
||||||
|
csharp_space_after_keywords_in_control_flow_statements = true
|
||||||
|
csharp_space_after_semicolon_in_for_statement = true
|
||||||
|
csharp_space_around_binary_operators = before_and_after
|
||||||
|
csharp_space_around_declaration_statements = 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_between_empty_square_brackets = false
|
||||||
|
csharp_space_between_method_call_empty_parameter_list_parentheses = false
|
||||||
|
csharp_space_between_method_call_name_and_opening_parenthesis = false
|
||||||
|
csharp_space_between_method_call_parameter_list_parentheses = false
|
||||||
|
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
|
||||||
|
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
|
||||||
|
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true
|
||||||
|
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true
|
||||||
|
csharp_style_allow_embedded_statements_on_same_line_experimental = true
|
||||||
|
csharp_style_conditional_delegate_call = true
|
||||||
|
csharp_style_deconstructed_variable_declaration = false
|
||||||
|
csharp_style_expression_bodied_accessors = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_constructors = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_indexers = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_lambdas = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_local_functions = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_methods = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_operators = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_properties = when_on_single_line:warning
|
||||||
|
csharp_style_implicit_object_creation_when_type_is_apparent = true:warning
|
||||||
|
csharp_style_inlined_variable_declaration = false
|
||||||
|
csharp_style_namespace_declarations = file_scoped:warning
|
||||||
|
csharp_style_pattern_local_over_anonymous_function = true:warning
|
||||||
|
csharp_style_pattern_matching_over_as_with_null_check = true:warning
|
||||||
|
csharp_style_pattern_matching_over_is_with_cast_check = true:warning
|
||||||
|
csharp_style_prefer_index_operator = true:warning
|
||||||
|
csharp_style_prefer_not_pattern = true:warning
|
||||||
|
csharp_style_prefer_null_check_over_type_check = true
|
||||||
|
csharp_style_prefer_pattern_matching = true:warning
|
||||||
|
csharp_style_prefer_range_operator = true:warning
|
||||||
|
csharp_style_prefer_switch_expression = true:warning
|
||||||
|
csharp_style_throw_expression = true
|
||||||
|
csharp_style_unused_value_assignment_preference = discard_variable:warning
|
||||||
|
csharp_style_unused_value_expression_statement_preference = discard_variable:warning
|
||||||
|
csharp_style_var_elsewhere = false:warning
|
||||||
|
csharp_style_var_for_built_in_types = false:warning
|
||||||
|
csharp_style_var_when_type_is_apparent = false:warning
|
||||||
|
csharp_using_directive_placement = outside_namespace
|
||||||
|
dotnet_analyzer_diagnostic.category-Design.severity = error
|
||||||
|
dotnet_analyzer_diagnostic.category-Documentation.severity = error
|
||||||
|
dotnet_analyzer_diagnostic.category-Globalization.severity = none
|
||||||
|
dotnet_analyzer_diagnostic.category-Interoperability.severity = error
|
||||||
|
dotnet_analyzer_diagnostic.category-Maintainability.severity = error
|
||||||
|
dotnet_analyzer_diagnostic.category-Naming.severity = none
|
||||||
|
dotnet_analyzer_diagnostic.category-Performance.severity = none
|
||||||
|
dotnet_analyzer_diagnostic.category-Reliability.severity = error
|
||||||
|
dotnet_analyzer_diagnostic.category-Security.severity = error
|
||||||
|
dotnet_analyzer_diagnostic.category-SingleFile.severity = error
|
||||||
|
dotnet_analyzer_diagnostic.category-Style.severity = error
|
||||||
|
dotnet_analyzer_diagnostic.category-Usage.severity = error
|
||||||
|
dotnet_code_quality_unused_parameters = all
|
||||||
|
dotnet_code_quality_unused_parameters = non_public
|
||||||
|
dotnet_code_quality.CAXXXX.api_surface = private, internal
|
||||||
|
dotnet_diagnostic.CA1001.severity = error # CA1001: Types that own disposable fields should be disposable
|
||||||
|
dotnet_diagnostic.CA1051.severity = error # CA1051: Do not declare visible instance fields
|
||||||
|
dotnet_diagnostic.CA1511.severity = warning # CA1511: Use 'ArgumentException.ThrowIfNullOrEmpty' instead of explicitly throwing a new exception instance
|
||||||
|
dotnet_diagnostic.CA1513.severity = warning # Use 'ObjectDisposedException.ThrowIf' instead of explicitly throwing a new exception instance
|
||||||
|
dotnet_diagnostic.CA1825.severity = warning # CA1825: Avoid zero-length array allocations
|
||||||
|
dotnet_diagnostic.CA1829.severity = warning # CA1829: Use Length/Count property instead of Count() when available
|
||||||
|
dotnet_diagnostic.CA1834.severity = warning # CA1834: Consider using 'StringBuilder.Append(char)' when applicable
|
||||||
|
dotnet_diagnostic.CA1860.severity = error # CA1860: Prefer comparing 'Count' to 0 rather than using 'Any()', both for clarity and for performance
|
||||||
|
dotnet_diagnostic.CA1862.severity = warning # CA1862: Prefer using 'string.Equals(string, StringComparison)' to perform a case-insensitive comparison, but keep in mind that this might cause subtle changes in behavior, so make sure to conduct thorough testing after applying the suggestion, or if culturally sensitive comparison is not required, consider using 'StringComparison.OrdinalIgnoreCase'
|
||||||
|
dotnet_diagnostic.CA1869.severity = none # CA1869: Avoid creating a new 'JsonSerializerOptions' instance for every serialization operation. Cache and reuse instances instead.
|
||||||
|
dotnet_diagnostic.CA2201.severity = none # CA2201: Exception type System.NullReferenceException is reserved by the runtime
|
||||||
|
dotnet_diagnostic.CA2254.severity = none # CA2254: The logging message template should not vary between calls to 'LoggerExtensions.LogInformation(ILogger, string?, params object?[])'
|
||||||
|
dotnet_diagnostic.IDE0001.severity = warning # IDE0001: Simplify name
|
||||||
|
dotnet_diagnostic.IDE0002.severity = warning # Simplify (member access) - System.Version.Equals("1", "2"); Version.Equals("1", "2");
|
||||||
|
dotnet_diagnostic.IDE0004.severity = warning # IDE0004: Cast is redundant.
|
||||||
|
dotnet_diagnostic.IDE0005.severity = warning # Using directive is unnecessary
|
||||||
|
dotnet_diagnostic.IDE0010.severity = none # Add missing cases to switch statement (IDE0010)
|
||||||
|
dotnet_diagnostic.IDE0028.severity = error # IDE0028: Collection initialization can be simplified
|
||||||
|
dotnet_diagnostic.IDE0031.severity = warning # Use null propagation (IDE0031)
|
||||||
|
dotnet_diagnostic.IDE0047.severity = warning # IDE0047: Parentheses can be removed
|
||||||
|
dotnet_diagnostic.IDE0048.severity = none # Parentheses preferences (IDE0047 and IDE0048)
|
||||||
|
dotnet_diagnostic.IDE0049.severity = warning # Use language keywords instead of framework type names for type references (IDE0049)
|
||||||
|
dotnet_diagnostic.IDE0051.severity = error # Private member '' is unused [, ]
|
||||||
|
dotnet_diagnostic.IDE0058.severity = warning # IDE0058: Expression value is never used
|
||||||
|
dotnet_diagnostic.IDE0060.severity = error # IDE0060: Remove unused parameter
|
||||||
|
dotnet_diagnostic.IDE0074.severity = warning # IDE0074: Use compound assignment
|
||||||
|
dotnet_diagnostic.IDE0130.severity = none # Namespace does not match folder structure (IDE0130)
|
||||||
|
dotnet_diagnostic.IDE0270.severity = warning # IDE0270: Null check can be simplified
|
||||||
|
dotnet_diagnostic.IDE0290.severity = none # Use primary constructor [Distance]csharp(IDE0290)
|
||||||
|
dotnet_diagnostic.IDE0300.severity = error # IDE0300: Collection initialization can be simplified
|
||||||
|
dotnet_diagnostic.IDE0301.severity = error #IDE0301: Collection initialization can be simplified
|
||||||
|
dotnet_diagnostic.IDE0305.severity = none # IDE0305: Collection initialization can be simplified
|
||||||
|
dotnet_naming_rule.abstract_method_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.abstract_method_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.abstract_method_should_be_pascal_case.symbols = abstract_method
|
||||||
|
dotnet_naming_rule.class_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.class_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.class_should_be_pascal_case.symbols = class
|
||||||
|
dotnet_naming_rule.delegate_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.delegate_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.delegate_should_be_pascal_case.symbols = delegate
|
||||||
|
dotnet_naming_rule.enum_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.enum_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.enum_should_be_pascal_case.symbols = enum
|
||||||
|
dotnet_naming_rule.event_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.event_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.event_should_be_pascal_case.symbols = event
|
||||||
|
dotnet_naming_rule.interface_should_be_begins_with_i.severity = warning
|
||||||
|
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
|
||||||
|
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
|
||||||
|
dotnet_naming_rule.method_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.method_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.method_should_be_pascal_case.symbols = method
|
||||||
|
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
|
||||||
|
dotnet_naming_rule.private_method_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.private_method_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.private_method_should_be_pascal_case.symbols = private_method
|
||||||
|
dotnet_naming_rule.private_or_internal_field_should_be_private_of_internal_field.severity = warning
|
||||||
|
dotnet_naming_rule.private_or_internal_field_should_be_private_of_internal_field.style = private_of_internal_field
|
||||||
|
dotnet_naming_rule.private_or_internal_field_should_be_private_of_internal_field.symbols = private_or_internal_field
|
||||||
|
dotnet_naming_rule.private_or_internal_static_field_should_be_private_of_internal_field.severity = warning
|
||||||
|
dotnet_naming_rule.private_or_internal_static_field_should_be_private_of_internal_field.style = private_of_internal_field
|
||||||
|
dotnet_naming_rule.private_or_internal_static_field_should_be_private_of_internal_field.symbols = private_or_internal_static_field
|
||||||
|
dotnet_naming_rule.property_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.property_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.property_should_be_pascal_case.symbols = property
|
||||||
|
dotnet_naming_rule.public_or_protected_field_should_be_private_of_internal_field.severity = warning
|
||||||
|
dotnet_naming_rule.public_or_protected_field_should_be_private_of_internal_field.style = private_of_internal_field
|
||||||
|
dotnet_naming_rule.public_or_protected_field_should_be_private_of_internal_field.symbols = public_or_protected_field
|
||||||
|
dotnet_naming_rule.static_field_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.static_field_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.static_field_should_be_pascal_case.symbols = static_field
|
||||||
|
dotnet_naming_rule.static_method_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.static_method_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.static_method_should_be_pascal_case.symbols = static_method
|
||||||
|
dotnet_naming_rule.struct_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.struct_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.struct_should_be_pascal_case.symbols = struct
|
||||||
|
dotnet_naming_rule.types_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
|
||||||
|
dotnet_naming_style.begins_with_i.capitalization = pascal_case
|
||||||
|
dotnet_naming_style.begins_with_i.required_prefix = I
|
||||||
|
dotnet_naming_style.begins_with_i.required_suffix =
|
||||||
|
dotnet_naming_style.begins_with_i.word_separator =
|
||||||
|
dotnet_naming_style.pascal_case.capitalization = pascal_case
|
||||||
|
dotnet_naming_style.pascal_case.required_prefix =
|
||||||
|
dotnet_naming_style.pascal_case.required_suffix =
|
||||||
|
dotnet_naming_style.pascal_case.word_separator =
|
||||||
|
dotnet_naming_style.private_of_internal_field.capitalization = pascal_case
|
||||||
|
dotnet_naming_style.private_of_internal_field.required_prefix = _
|
||||||
|
dotnet_naming_style.private_of_internal_field.required_suffix =
|
||||||
|
dotnet_naming_style.private_of_internal_field.word_separator =
|
||||||
|
dotnet_naming_symbols.abstract_method.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.abstract_method.applicable_kinds = method
|
||||||
|
dotnet_naming_symbols.abstract_method.required_modifiers = abstract
|
||||||
|
dotnet_naming_symbols.class.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.class.applicable_kinds = class
|
||||||
|
dotnet_naming_symbols.class.required_modifiers =
|
||||||
|
dotnet_naming_symbols.delegate.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.delegate.applicable_kinds = delegate
|
||||||
|
dotnet_naming_symbols.delegate.required_modifiers =
|
||||||
|
dotnet_naming_symbols.enum.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.enum.applicable_kinds = enum
|
||||||
|
dotnet_naming_symbols.enum.required_modifiers =
|
||||||
|
dotnet_naming_symbols.event.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.event.applicable_kinds = event
|
||||||
|
dotnet_naming_symbols.event.required_modifiers =
|
||||||
|
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.interface.applicable_kinds = interface
|
||||||
|
dotnet_naming_symbols.interface.required_modifiers =
|
||||||
|
dotnet_naming_symbols.method.applicable_accessibilities = public
|
||||||
|
dotnet_naming_symbols.method.applicable_kinds = method
|
||||||
|
dotnet_naming_symbols.method.required_modifiers =
|
||||||
|
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
|
||||||
|
dotnet_naming_symbols.non_field_members.required_modifiers =
|
||||||
|
dotnet_naming_symbols.private_method.applicable_accessibilities = private
|
||||||
|
dotnet_naming_symbols.private_method.applicable_kinds = method
|
||||||
|
dotnet_naming_symbols.private_method.required_modifiers =
|
||||||
|
dotnet_naming_symbols.private_or_internal_field.applicable_accessibilities = internal, private, private_protected
|
||||||
|
dotnet_naming_symbols.private_or_internal_field.applicable_kinds = field
|
||||||
|
dotnet_naming_symbols.private_or_internal_field.required_modifiers =
|
||||||
|
dotnet_naming_symbols.private_or_internal_static_field.applicable_accessibilities = internal, private, private_protected
|
||||||
|
dotnet_naming_symbols.private_or_internal_static_field.applicable_kinds = field
|
||||||
|
dotnet_naming_symbols.private_or_internal_static_field.required_modifiers = static
|
||||||
|
dotnet_naming_symbols.property.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.property.applicable_kinds = property
|
||||||
|
dotnet_naming_symbols.property.required_modifiers =
|
||||||
|
dotnet_naming_symbols.public_or_protected_field.applicable_accessibilities = public, protected
|
||||||
|
dotnet_naming_symbols.public_or_protected_field.applicable_kinds = field
|
||||||
|
dotnet_naming_symbols.public_or_protected_field.required_modifiers =
|
||||||
|
dotnet_naming_symbols.static_field.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.static_field.applicable_kinds = field
|
||||||
|
dotnet_naming_symbols.static_field.required_modifiers = static
|
||||||
|
dotnet_naming_symbols.static_method.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.static_method.applicable_kinds = method
|
||||||
|
dotnet_naming_symbols.static_method.required_modifiers = static
|
||||||
|
dotnet_naming_symbols.struct.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.struct.applicable_kinds = struct
|
||||||
|
dotnet_naming_symbols.struct.required_modifiers =
|
||||||
|
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
|
||||||
|
dotnet_naming_symbols.types.required_modifiers =
|
||||||
|
dotnet_remove_unnecessary_suppression_exclusions = 0
|
||||||
|
dotnet_separate_import_directive_groups = false
|
||||||
|
dotnet_sort_system_directives_first = false
|
||||||
|
dotnet_style_allow_multiple_blank_lines_experimental = false:warning
|
||||||
|
dotnet_style_allow_statement_immediately_after_block_experimental = true
|
||||||
|
dotnet_style_coalesce_expression = true
|
||||||
|
dotnet_style_collection_initializer = true:warning
|
||||||
|
dotnet_style_explicit_tuple_names = true:warning
|
||||||
|
dotnet_style_namespace_match_folder = true
|
||||||
|
dotnet_style_null_propagation = true:warning
|
||||||
|
dotnet_style_object_initializer = true:warning
|
||||||
|
dotnet_style_operator_placement_when_wrapping = beginning_of_line
|
||||||
|
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity
|
||||||
|
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity
|
||||||
|
dotnet_style_parentheses_in_other_operators = never_if_unnecessary
|
||||||
|
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity
|
||||||
|
dotnet_style_predefined_type_for_locals_parameters_members = true
|
||||||
|
dotnet_style_predefined_type_for_member_access = true:warning
|
||||||
|
dotnet_style_prefer_auto_properties = true:warning
|
||||||
|
dotnet_style_prefer_compound_assignment = true:warning
|
||||||
|
dotnet_style_prefer_conditional_expression_over_assignment = false
|
||||||
|
dotnet_style_prefer_conditional_expression_over_return = false
|
||||||
|
dotnet_style_prefer_inferred_anonymous_type_member_names = true:warning
|
||||||
|
dotnet_style_prefer_inferred_tuple_names = true:warning
|
||||||
|
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning
|
||||||
|
dotnet_style_prefer_simplified_boolean_expressions = true:warning
|
||||||
|
dotnet_style_prefer_simplified_interpolation = true
|
||||||
|
dotnet_style_qualification_for_event = false:error
|
||||||
|
dotnet_style_qualification_for_field = false
|
||||||
|
dotnet_style_qualification_for_method = false:error
|
||||||
|
dotnet_style_qualification_for_property = false:error
|
||||||
|
dotnet_style_readonly_field = true:warning
|
||||||
|
dotnet_style_require_accessibility_modifiers = for_non_interface_members
|
||||||
|
end_of_line = crlf
|
||||||
|
file_header_template = unset
|
||||||
|
indent_size = 4
|
||||||
|
indent_style = space
|
||||||
|
insert_final_newline = false
|
||||||
|
root = true
|
||||||
|
tab_width = 4
|
||||||
|
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1822
|
||||||
|
# https://github.com/dotnet/aspnetcore/blob/main/.editorconfig
|
||||||
|
# https://github.com/dotnet/project-system/blob/main/.editorconfig
|
@ -7,8 +7,7 @@ using System.Text.Json.Serialization;
|
|||||||
|
|
||||||
namespace File_Folder_Helper.ADO2024.PI4;
|
namespace File_Folder_Helper.ADO2024.PI4;
|
||||||
|
|
||||||
internal static partial class Helper20241108
|
internal static partial class Helper20241108 {
|
||||||
{
|
|
||||||
|
|
||||||
#if WorkItems
|
#if WorkItems
|
||||||
|
|
||||||
@ -49,13 +48,11 @@ internal static partial class Helper20241108
|
|||||||
string Title,
|
string Title,
|
||||||
string? Violation,
|
string? Violation,
|
||||||
long? WeightedShortestJobFirst,
|
long? WeightedShortestJobFirst,
|
||||||
string WorkItemType)
|
string WorkItemType) {
|
||||||
{
|
|
||||||
|
|
||||||
public override string ToString() => $"{Id} - {WorkItemType} - {Title}";
|
public override string ToString() => $"{Id} - {WorkItemType} - {Title}";
|
||||||
|
|
||||||
public static WorkItem Get(WorkItem workItem, Relation[] relations)
|
public static WorkItem Get(WorkItem workItem, Relation[] relations) {
|
||||||
{
|
|
||||||
WorkItem result = new(workItem.ActivatedDate,
|
WorkItem result = new(workItem.ActivatedDate,
|
||||||
workItem.AreaPath,
|
workItem.AreaPath,
|
||||||
workItem.AssignedTo,
|
workItem.AssignedTo,
|
||||||
@ -87,8 +84,7 @@ internal static partial class Helper20241108
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static WorkItem? GetWithOutRelations(WorkItem? workItem)
|
public static WorkItem? GetWithOutRelations(WorkItem? workItem) {
|
||||||
{
|
|
||||||
WorkItem? result = workItem is null ? null : new(workItem.ActivatedDate,
|
WorkItem? result = workItem is null ? null : new(workItem.ActivatedDate,
|
||||||
workItem.AreaPath,
|
workItem.AreaPath,
|
||||||
workItem.AssignedTo,
|
workItem.AssignedTo,
|
||||||
@ -124,21 +120,17 @@ internal static partial class Helper20241108
|
|||||||
|
|
||||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||||
[JsonSerializable(typeof(WorkItem))]
|
[JsonSerializable(typeof(WorkItem))]
|
||||||
private partial class WorkItemSourceGenerationContext : JsonSerializerContext
|
private partial class WorkItemSourceGenerationContext : JsonSerializerContext {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||||
[JsonSerializable(typeof(WorkItem[]))]
|
[JsonSerializable(typeof(WorkItem[]))]
|
||||||
private partial class WorkItemCollectionSourceGenerationContext : JsonSerializerContext
|
private partial class WorkItemCollectionSourceGenerationContext : JsonSerializerContext {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private record Record(WorkItem WorkItem, WorkItem? Parent, Record[]? Children, Record[]? Related, Record[]? Successors)
|
private record Record(WorkItem WorkItem, WorkItem? Parent, Record[]? Children, Record[]? Related, Record[]? Successors) {
|
||||||
{
|
|
||||||
|
|
||||||
internal static Record GetWithoutNesting(Record record, string? violation)
|
internal static Record GetWithoutNesting(Record record, string? violation) {
|
||||||
{
|
|
||||||
Record result;
|
Record result;
|
||||||
WorkItem workItem = new(record.WorkItem.ActivatedDate,
|
WorkItem workItem = new(record.WorkItem.ActivatedDate,
|
||||||
record.WorkItem.AreaPath,
|
record.WorkItem.AreaPath,
|
||||||
@ -172,8 +164,7 @@ internal static partial class Helper20241108
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Record Get(Record record, bool keepRelations)
|
private static Record Get(Record record, bool keepRelations) {
|
||||||
{
|
|
||||||
Record result;
|
Record result;
|
||||||
Record[]? childRecords;
|
Record[]? childRecords;
|
||||||
Record[]? relatedRecords;
|
Record[]? relatedRecords;
|
||||||
@ -183,8 +174,7 @@ internal static partial class Helper20241108
|
|||||||
WorkItem? workItem = keepRelations ? record.WorkItem : WorkItem.GetWithOutRelations(record.WorkItem) ?? throw new Exception();
|
WorkItem? workItem = keepRelations ? record.WorkItem : WorkItem.GetWithOutRelations(record.WorkItem) ?? throw new Exception();
|
||||||
if (record.Children is null)
|
if (record.Children is null)
|
||||||
childRecords = null;
|
childRecords = null;
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
relationRecords = [];
|
relationRecords = [];
|
||||||
foreach (Record r in record.Children)
|
foreach (Record r in record.Children)
|
||||||
relationRecords.Add(Get(r, keepRelations));
|
relationRecords.Add(Get(r, keepRelations));
|
||||||
@ -192,8 +182,7 @@ internal static partial class Helper20241108
|
|||||||
}
|
}
|
||||||
if (record.Related is null)
|
if (record.Related is null)
|
||||||
relatedRecords = null;
|
relatedRecords = null;
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
relationRecords = [];
|
relationRecords = [];
|
||||||
foreach (Record r in record.Related)
|
foreach (Record r in record.Related)
|
||||||
relationRecords.Add(Get(r, keepRelations));
|
relationRecords.Add(Get(r, keepRelations));
|
||||||
@ -201,8 +190,7 @@ internal static partial class Helper20241108
|
|||||||
}
|
}
|
||||||
if (record.Successors is null)
|
if (record.Successors is null)
|
||||||
successorRecords = null;
|
successorRecords = null;
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
relationRecords = [];
|
relationRecords = [];
|
||||||
foreach (Record r in record.Successors)
|
foreach (Record r in record.Successors)
|
||||||
relationRecords.Add(Get(r, keepRelations));
|
relationRecords.Add(Get(r, keepRelations));
|
||||||
@ -212,16 +200,14 @@ internal static partial class Helper20241108
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static Record Get(WorkItem workItem, WorkItem? parent, ReadOnlyCollection<Record>? children, ReadOnlyCollection<Record>? related, ReadOnlyCollection<Record>? successors, bool keepRelations)
|
internal static Record Get(WorkItem workItem, WorkItem? parent, ReadOnlyCollection<Record>? children, ReadOnlyCollection<Record>? related, ReadOnlyCollection<Record>? successors, bool keepRelations) {
|
||||||
{
|
|
||||||
Record result;
|
Record result;
|
||||||
Record record = new(workItem, parent, children?.ToArray(), related?.ToArray(), successors?.ToArray());
|
Record record = new(workItem, parent, children?.ToArray(), related?.ToArray(), successors?.ToArray());
|
||||||
result = Get(record, keepRelations);
|
result = Get(record, keepRelations);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static ReadOnlyCollection<Record> GetKeyValuePairs(ReadOnlyDictionary<int, WorkItem> keyValuePairs, WorkItem workItem, string relationName, List<bool> nests, bool keepRelations)
|
internal static ReadOnlyCollection<Record> GetKeyValuePairs(ReadOnlyDictionary<int, WorkItem> keyValuePairs, WorkItem workItem, string relationName, List<bool> nests, bool keepRelations) {
|
||||||
{
|
|
||||||
List<Record> results = [];
|
List<Record> results = [];
|
||||||
Record record;
|
Record record;
|
||||||
nests.Add(true);
|
nests.Add(true);
|
||||||
@ -231,11 +217,9 @@ internal static partial class Helper20241108
|
|||||||
ReadOnlyCollection<Record>? childRecords;
|
ReadOnlyCollection<Record>? childRecords;
|
||||||
ReadOnlyCollection<Record>? relatedRecords;
|
ReadOnlyCollection<Record>? relatedRecords;
|
||||||
ReadOnlyCollection<Record>? successorRecords;
|
ReadOnlyCollection<Record>? successorRecords;
|
||||||
if (workItem.Relations is not null && workItem.Relations.Length > 0)
|
if (workItem.Relations is not null && workItem.Relations.Length > 0) {
|
||||||
{
|
|
||||||
collection.Clear();
|
collection.Clear();
|
||||||
foreach (Relation relation in workItem.Relations)
|
foreach (Relation relation in workItem.Relations) {
|
||||||
{
|
|
||||||
if (relation.Attributes.Name != relationName)
|
if (relation.Attributes.Name != relationName)
|
||||||
continue;
|
continue;
|
||||||
if (workItem.Parent is not null && relation.Id == workItem.Parent.Value)
|
if (workItem.Parent is not null && relation.Id == workItem.Parent.Value)
|
||||||
@ -245,8 +229,7 @@ internal static partial class Helper20241108
|
|||||||
collection.Add(relationWorkItem);
|
collection.Add(relationWorkItem);
|
||||||
}
|
}
|
||||||
collection = (from l in collection orderby l.State != "Closed", l.Id select l).ToList();
|
collection = (from l in collection orderby l.State != "Closed", l.Id select l).ToList();
|
||||||
foreach (WorkItem w in collection)
|
foreach (WorkItem w in collection) {
|
||||||
{
|
|
||||||
if (nests.Count > 500)
|
if (nests.Count > 500)
|
||||||
break;
|
break;
|
||||||
if (w.Parent is null)
|
if (w.Parent is null)
|
||||||
@ -268,12 +251,10 @@ internal static partial class Helper20241108
|
|||||||
|
|
||||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||||
[JsonSerializable(typeof(Record[]))]
|
[JsonSerializable(typeof(Record[]))]
|
||||||
private partial class RecordCollectionBCommonSourceGenerationContext : JsonSerializerContext
|
private partial class RecordCollectionBCommonSourceGenerationContext : JsonSerializerContext {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ReadOnlyDictionary<int, Record> GetKeyValuePairs(ReadOnlyDictionary<int, WorkItem> keyValuePairs, bool keepRelations)
|
private static ReadOnlyDictionary<int, Record> GetKeyValuePairs(ReadOnlyDictionary<int, WorkItem> keyValuePairs, bool keepRelations) {
|
||||||
{
|
|
||||||
Dictionary<int, Record> results = [];
|
Dictionary<int, Record> results = [];
|
||||||
Record record;
|
Record record;
|
||||||
List<bool> nests = [];
|
List<bool> nests = [];
|
||||||
@ -281,23 +262,19 @@ internal static partial class Helper20241108
|
|||||||
ReadOnlyCollection<Record> childRecords;
|
ReadOnlyCollection<Record> childRecords;
|
||||||
ReadOnlyCollection<Record> relatedRecords;
|
ReadOnlyCollection<Record> relatedRecords;
|
||||||
ReadOnlyCollection<Record> successorRecords;
|
ReadOnlyCollection<Record> successorRecords;
|
||||||
foreach (KeyValuePair<int, WorkItem> keyValuePair in keyValuePairs)
|
foreach (KeyValuePair<int, WorkItem> keyValuePair in keyValuePairs) {
|
||||||
{
|
|
||||||
nests.Clear();
|
nests.Clear();
|
||||||
if (keyValuePair.Value.Parent is null)
|
if (keyValuePair.Value.Parent is null)
|
||||||
parentWorkItem = null;
|
parentWorkItem = null;
|
||||||
else
|
else
|
||||||
_ = keyValuePairs.TryGetValue(keyValuePair.Value.Parent.Value, out parentWorkItem);
|
_ = keyValuePairs.TryGetValue(keyValuePair.Value.Parent.Value, out parentWorkItem);
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
childRecords = Record.GetKeyValuePairs(keyValuePairs, keyValuePair.Value, "Child", nests, keepRelations); // Forward
|
childRecords = Record.GetKeyValuePairs(keyValuePairs, keyValuePair.Value, "Child", nests, keepRelations); // Forward
|
||||||
// records = Record.GetKeyValuePairs(keyValuePairs, keyValuePair.Value, "Predecessor", nests, keepRelations); // Reverse
|
// records = Record.GetKeyValuePairs(keyValuePairs, keyValuePair.Value, "Predecessor", nests, keepRelations); // Reverse
|
||||||
relatedRecords = Record.GetKeyValuePairs(keyValuePairs, keyValuePair.Value, "Related", nests, keepRelations); // Related
|
relatedRecords = Record.GetKeyValuePairs(keyValuePairs, keyValuePair.Value, "Related", nests, keepRelations); // Related
|
||||||
successorRecords = Record.GetKeyValuePairs(keyValuePairs, keyValuePair.Value, "Successor", nests, keepRelations); // Forward
|
successorRecords = Record.GetKeyValuePairs(keyValuePairs, keyValuePair.Value, "Successor", nests, keepRelations); // Forward
|
||||||
record = Record.Get(keyValuePair.Value, parentWorkItem, childRecords, relatedRecords, successorRecords, keepRelations);
|
record = Record.Get(keyValuePair.Value, parentWorkItem, childRecords, relatedRecords, successorRecords, keepRelations);
|
||||||
}
|
} catch (Exception) {
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
record = new(keyValuePair.Value, parentWorkItem, [], [], []);
|
record = new(keyValuePair.Value, parentWorkItem, [], [], []);
|
||||||
}
|
}
|
||||||
results.Add(keyValuePair.Key, record);
|
results.Add(keyValuePair.Key, record);
|
||||||
@ -305,8 +282,7 @@ internal static partial class Helper20241108
|
|||||||
return new(results);
|
return new(results);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ReadOnlyDictionary<int, Record> GetWorkItems(ReadOnlyCollection<WorkItem> workItems, bool keepRelations)
|
private static ReadOnlyDictionary<int, Record> GetWorkItems(ReadOnlyCollection<WorkItem> workItems, bool keepRelations) {
|
||||||
{
|
|
||||||
ReadOnlyDictionary<int, Record> results;
|
ReadOnlyDictionary<int, Record> results;
|
||||||
Dictionary<int, WorkItem> keyValuePairs = [];
|
Dictionary<int, WorkItem> keyValuePairs = [];
|
||||||
foreach (WorkItem workItem in workItems)
|
foreach (WorkItem workItem in workItems)
|
||||||
@ -315,14 +291,12 @@ internal static partial class Helper20241108
|
|||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ReadOnlyCollection<WorkItem>? GetWorkItems(string fileName, string sourceDirectory)
|
private static ReadOnlyCollection<WorkItem>? GetWorkItems(string fileName, string sourceDirectory) {
|
||||||
{
|
|
||||||
WorkItem[]? results;
|
WorkItem[]? results;
|
||||||
string? checkFile = null;
|
string? checkFile = null;
|
||||||
string? checkDirectory = sourceDirectory;
|
string? checkDirectory = sourceDirectory;
|
||||||
string? pathRoot = Path.GetPathRoot(sourceDirectory);
|
string? pathRoot = Path.GetPathRoot(sourceDirectory);
|
||||||
for (int i = 0; i < int.MaxValue; i++)
|
for (int i = 0; i < int.MaxValue; i++) {
|
||||||
{
|
|
||||||
checkDirectory = Path.GetDirectoryName(checkDirectory);
|
checkDirectory = Path.GetDirectoryName(checkDirectory);
|
||||||
if (string.IsNullOrEmpty(checkDirectory) || checkDirectory == pathRoot)
|
if (string.IsNullOrEmpty(checkDirectory) || checkDirectory == pathRoot)
|
||||||
break;
|
break;
|
||||||
@ -333,16 +307,14 @@ internal static partial class Helper20241108
|
|||||||
}
|
}
|
||||||
if (checkFile is null)
|
if (checkFile is null)
|
||||||
results = null;
|
results = null;
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
string json = File.ReadAllText(checkFile);
|
string json = File.ReadAllText(checkFile);
|
||||||
results = JsonSerializer.Deserialize(json, WorkItemCollectionSourceGenerationContext.Default.WorkItemArray);
|
results = JsonSerializer.Deserialize(json, WorkItemCollectionSourceGenerationContext.Default.WorkItemArray);
|
||||||
}
|
}
|
||||||
return results is null ? null : new(results);
|
return results is null ? null : new(results);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void WriteMarkdown(ILogger<Worker> logger, List<string> args)
|
internal static void WriteMarkdown(ILogger<Worker> logger, List<string> args) {
|
||||||
{
|
|
||||||
// string url = args[5];
|
// string url = args[5];
|
||||||
bool keepRelations = true;
|
bool keepRelations = true;
|
||||||
string fileName = args[2];
|
string fileName = args[2];
|
||||||
@ -351,20 +323,17 @@ internal static partial class Helper20241108
|
|||||||
string idCheck = sourceDirectoryName.Split('-', StringSplitOptions.None)[0];
|
string idCheck = sourceDirectoryName.Split('-', StringSplitOptions.None)[0];
|
||||||
if (!int.TryParse(idCheck, out int id))
|
if (!int.TryParse(idCheck, out int id))
|
||||||
logger.LogInformation("Not valid directory!");
|
logger.LogInformation("Not valid directory!");
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
ReadOnlyCollection<WorkItem>? workItems = GetWorkItems(fileName, sourceDirectory);
|
ReadOnlyCollection<WorkItem>? workItems = GetWorkItems(fileName, sourceDirectory);
|
||||||
if (workItems is null)
|
if (workItems is null)
|
||||||
logger.LogInformation("No file found!");
|
logger.LogInformation("No file found!");
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
Record? record;
|
Record? record;
|
||||||
ReadOnlyDictionary<int, Record> keyValuePairs = GetWorkItems(workItems, keepRelations);
|
ReadOnlyDictionary<int, Record> keyValuePairs = GetWorkItems(workItems, keepRelations);
|
||||||
logger.LogInformation("Found {keyValuePairs}", keyValuePairs.Count);
|
logger.LogInformation("Found {keyValuePairs}", keyValuePairs.Count);
|
||||||
if (!keyValuePairs.TryGetValue(id, out record))
|
if (!keyValuePairs.TryGetValue(id, out record))
|
||||||
logger.LogInformation($"Id {id} not found!");
|
logger.LogInformation($"Id {id} not found!");
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
logger.LogInformation($"Id {id} found with title {record.WorkItem.Title}!");
|
logger.LogInformation($"Id {id} found with title {record.WorkItem.Title}!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -373,8 +342,7 @@ internal static partial class Helper20241108
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
internal static void WriteMarkdown(ILogger<Worker> logger, List<string> args)
|
internal static void WriteMarkdown(ILogger<Worker> logger, List<string> args) {
|
||||||
{
|
|
||||||
logger.LogError("WriteMarkdown is not available in WorkItems {args[0]}", args[0]);
|
logger.LogError("WriteMarkdown is not available in WorkItems {args[0]}", args[0]);
|
||||||
logger.LogError("WriteMarkdown is not available in WorkItems {args[1]}", args[1]);
|
logger.LogError("WriteMarkdown is not available in WorkItems {args[1]}", args[1]);
|
||||||
}
|
}
|
||||||
|
@ -2,13 +2,11 @@ using Microsoft.Extensions.Logging;
|
|||||||
|
|
||||||
namespace File_Folder_Helper.ADO2024.PI4;
|
namespace File_Folder_Helper.ADO2024.PI4;
|
||||||
|
|
||||||
internal static partial class Helper20241115
|
internal static partial class Helper20241115 {
|
||||||
{
|
|
||||||
|
|
||||||
#if BIORAD
|
#if BIORAD
|
||||||
|
|
||||||
internal static void ScanPast(string text, int[] i, string search)
|
internal static void ScanPast(string text, int[] i, string search) {
|
||||||
{
|
|
||||||
int num = text.IndexOf(search, i[0]);
|
int num = text.IndexOf(search, i[0]);
|
||||||
if (num > -1)
|
if (num > -1)
|
||||||
i[0] = num + search.Length;
|
i[0] = num + search.Length;
|
||||||
@ -16,15 +14,13 @@ internal static partial class Helper20241115
|
|||||||
i[0] = text.Length;
|
i[0] = text.Length;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void GetComplete(ILogger<Worker> logger, List<string> args)
|
internal static void GetComplete(ILogger<Worker> logger, List<string> args) {
|
||||||
{
|
|
||||||
string searchPattern = args[2];
|
string searchPattern = args[2];
|
||||||
string sourceDirectory = Path.GetFullPath(args[0]);
|
string sourceDirectory = Path.GetFullPath(args[0]);
|
||||||
string[] files = Directory.GetFiles(sourceDirectory, searchPattern, SearchOption.TopDirectoryOnly);
|
string[] files = Directory.GetFiles(sourceDirectory, searchPattern, SearchOption.TopDirectoryOnly);
|
||||||
if (files.Length != 1)
|
if (files.Length != 1)
|
||||||
logger.LogError("No files found in {sourceDirectory} with search pattern {searchPattern}", sourceDirectory, searchPattern);
|
logger.LogError("No files found in {sourceDirectory} with search pattern {searchPattern}", sourceDirectory, searchPattern);
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
List<string> group = [];
|
List<string> group = [];
|
||||||
string text = File.ReadAllText(files[0]);
|
string text = File.ReadAllText(files[0]);
|
||||||
int[] i = [0];
|
int[] i = [0];
|
||||||
@ -34,12 +30,10 @@ internal static partial class Helper20241115
|
|||||||
string[] segments = text.Substring(i[0]).Split('*');
|
string[] segments = text.Substring(i[0]).Split('*');
|
||||||
string[] segmentsB;
|
string[] segmentsB;
|
||||||
string[] segmentsC;
|
string[] segmentsC;
|
||||||
foreach (string segment in segments)
|
foreach (string segment in segments) {
|
||||||
{
|
|
||||||
segmentsB = segment.Split(Environment.NewLine);
|
segmentsB = segment.Split(Environment.NewLine);
|
||||||
segmentsC = segmentsB[0].Split(' ');
|
segmentsC = segmentsB[0].Split(' ');
|
||||||
if (segment.Contains("Group"))
|
if (segment.Contains("Group")) {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -47,8 +41,7 @@ internal static partial class Helper20241115
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
internal static void GetComplete(ILogger<Worker> logger, List<string> args)
|
internal static void GetComplete(ILogger<Worker> logger, List<string> args) {
|
||||||
{
|
|
||||||
string searchPattern = args[2];
|
string searchPattern = args[2];
|
||||||
string sourceDirectory = Path.GetFullPath(args[0]);
|
string sourceDirectory = Path.GetFullPath(args[0]);
|
||||||
string[] files = Directory.GetFiles(sourceDirectory, searchPattern, SearchOption.TopDirectoryOnly);
|
string[] files = Directory.GetFiles(sourceDirectory, searchPattern, SearchOption.TopDirectoryOnly);
|
||||||
|
@ -3,19 +3,16 @@ using System.Text;
|
|||||||
|
|
||||||
namespace File_Folder_Helper.ADO2024.PI4;
|
namespace File_Folder_Helper.ADO2024.PI4;
|
||||||
|
|
||||||
internal static partial class Helper20241204
|
internal static partial class Helper20241204 {
|
||||||
{
|
|
||||||
|
|
||||||
internal static void ConvertToUTF8(ILogger<Worker> logger, List<string> args)
|
internal static void ConvertToUTF8(ILogger<Worker> logger, List<string> args) {
|
||||||
{
|
|
||||||
string text;
|
string text;
|
||||||
string searchPattern = args[2];
|
string searchPattern = args[2];
|
||||||
string sourceDirectory = Path.GetFullPath(args[0]);
|
string sourceDirectory = Path.GetFullPath(args[0]);
|
||||||
string[] files = Directory.GetFiles(sourceDirectory, searchPattern, SearchOption.TopDirectoryOnly);
|
string[] files = Directory.GetFiles(sourceDirectory, searchPattern, SearchOption.TopDirectoryOnly);
|
||||||
if (files.Length == 0)
|
if (files.Length == 0)
|
||||||
logger.LogError("No files found in {sourceDirectory} with search pattern {searchPattern}", sourceDirectory, searchPattern);
|
logger.LogError("No files found in {sourceDirectory} with search pattern {searchPattern}", sourceDirectory, searchPattern);
|
||||||
foreach (string file in files)
|
foreach (string file in files) {
|
||||||
{
|
|
||||||
text = File.ReadAllText(file);
|
text = File.ReadAllText(file);
|
||||||
File.WriteAllText(file, text, Encoding.UTF8);
|
File.WriteAllText(file, text, Encoding.UTF8);
|
||||||
}
|
}
|
||||||
|
@ -2,11 +2,9 @@ using Microsoft.Extensions.Logging;
|
|||||||
|
|
||||||
namespace File_Folder_Helper.ADO2024.PI4;
|
namespace File_Folder_Helper.ADO2024.PI4;
|
||||||
|
|
||||||
internal static partial class Helper20241212
|
internal static partial class Helper20241212 {
|
||||||
{
|
|
||||||
|
|
||||||
internal static void Rename(ILogger<Worker> logger, List<string> args)
|
internal static void Rename(ILogger<Worker> logger, List<string> args) {
|
||||||
{
|
|
||||||
string newFile;
|
string newFile;
|
||||||
string fileName;
|
string fileName;
|
||||||
string newFileName;
|
string newFileName;
|
||||||
@ -17,8 +15,7 @@ internal static partial class Helper20241212
|
|||||||
string[] files = Directory.GetFiles(sourceDirectory, searchPattern, SearchOption.AllDirectories);
|
string[] files = Directory.GetFiles(sourceDirectory, searchPattern, SearchOption.AllDirectories);
|
||||||
if (files.Length == 0)
|
if (files.Length == 0)
|
||||||
logger.LogError("No files found in {sourceDirectory} with search pattern {searchPattern}", sourceDirectory, searchPattern);
|
logger.LogError("No files found in {sourceDirectory} with search pattern {searchPattern}", sourceDirectory, searchPattern);
|
||||||
foreach (string file in files)
|
foreach (string file in files) {
|
||||||
{
|
|
||||||
fileName = Path.GetFileName(file);
|
fileName = Path.GetFileName(file);
|
||||||
directoryName = Path.GetDirectoryName(file) ?? throw new Exception();
|
directoryName = Path.GetDirectoryName(file) ?? throw new Exception();
|
||||||
newFileName = fileName;
|
newFileName = fileName;
|
||||||
|
@ -8,8 +8,7 @@ using System.Text.Json.Serialization;
|
|||||||
|
|
||||||
namespace File_Folder_Helper.ADO2024.PI4;
|
namespace File_Folder_Helper.ADO2024.PI4;
|
||||||
|
|
||||||
internal static partial class Helper20241217
|
internal static partial class Helper20241217 {
|
||||||
{
|
|
||||||
|
|
||||||
private record SecureShell(
|
private record SecureShell(
|
||||||
);
|
);
|
||||||
@ -42,21 +41,18 @@ internal static partial class Helper20241217
|
|||||||
|
|
||||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||||
[JsonSerializable(typeof(Job))]
|
[JsonSerializable(typeof(Job))]
|
||||||
private partial class JobSourceGenerationContext : JsonSerializerContext
|
private partial class JobSourceGenerationContext : JsonSerializerContext {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||||
[JsonSerializable(typeof(File[]))]
|
[JsonSerializable(typeof(File[]))]
|
||||||
private partial class FilesSourceGenerationContext : JsonSerializerContext
|
private partial class FilesSourceGenerationContext : JsonSerializerContext {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ReadOnlyCollection<File> GetFiles(string searchPattern, string[] ignoreFileNames, Record record) =>
|
private static ReadOnlyCollection<File> GetFiles(string searchPattern, string[] ignoreFileNames, Record record) =>
|
||||||
GetFiles(record.SourceDirectory, searchPattern, ignoreFileNames);
|
GetFiles(record.SourceDirectory, searchPattern, ignoreFileNames);
|
||||||
|
|
||||||
internal static void Backup(ILogger<Worker> logger, List<string> args)
|
internal static void Backup(ILogger<Worker> logger, List<string> args) {
|
||||||
{
|
|
||||||
Job jobNew;
|
Job jobNew;
|
||||||
string path;
|
string path;
|
||||||
string? json;
|
string? json;
|
||||||
@ -78,21 +74,15 @@ internal static partial class Helper20241217
|
|||||||
logger.LogInformation("Searching <{sourceDirectory}> with search pattern {searchPattern}", args[0], searchPattern);
|
logger.LogInformation("Searching <{sourceDirectory}> with search pattern {searchPattern}", args[0], searchPattern);
|
||||||
if (Debugger.IsAttached)
|
if (Debugger.IsAttached)
|
||||||
Verify(searchPattern, ignoreFileNames);
|
Verify(searchPattern, ignoreFileNames);
|
||||||
for (int i = 1; i < 3; i++)
|
for (int i = 1; i < 3; i++) {
|
||||||
{
|
if (i == 1) {
|
||||||
if (i == 1)
|
|
||||||
{
|
|
||||||
searchPatternFiles = Directory.EnumerateFiles(sourceDirectory, searchPattern, new EnumerationOptions { IgnoreInaccessible = true, RecurseSubdirectories = true });
|
searchPatternFiles = Directory.EnumerateFiles(sourceDirectory, searchPattern, new EnumerationOptions { IgnoreInaccessible = true, RecurseSubdirectories = true });
|
||||||
}
|
} else if (i == 2) {
|
||||||
else if (i == 2)
|
|
||||||
{
|
|
||||||
searchPatternFiles = Directory.GetFiles(sourceDirectory, searchPattern, SearchOption.AllDirectories);
|
searchPatternFiles = Directory.GetFiles(sourceDirectory, searchPattern, SearchOption.AllDirectories);
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
records = GetRecords(sourceDirectory, destination, searchPatternFiles);
|
records = GetRecords(sourceDirectory, destination, searchPatternFiles);
|
||||||
foreach (Record record in records)
|
foreach (Record record in records) {
|
||||||
{
|
|
||||||
if (record.Job is null || string.IsNullOrEmpty(record.Job.Extension))
|
if (record.Job is null || string.IsNullOrEmpty(record.Job.Extension))
|
||||||
continue;
|
continue;
|
||||||
logger.LogInformation("Searching <{directory}>", record.SourceDirectory);
|
logger.LogInformation("Searching <{directory}>", record.SourceDirectory);
|
||||||
@ -100,13 +90,11 @@ internal static partial class Helper20241217
|
|||||||
jobNew = GetJob(searchPattern, ignoreFileNames, record, files);
|
jobNew = GetJob(searchPattern, ignoreFileNames, record, files);
|
||||||
json = JsonSerializer.Serialize(jobNew, JobSourceGenerationContext.Default.Job);
|
json = JsonSerializer.Serialize(jobNew, JobSourceGenerationContext.Default.Job);
|
||||||
areTheyTheSame = GetAreTheyTheSame(logger, searchPattern, ignoreFileNames, record, jobNew);
|
areTheyTheSame = GetAreTheyTheSame(logger, searchPattern, ignoreFileNames, record, jobNew);
|
||||||
if (snap2HyperTextMarkupLanguage is not null && System.IO.File.Exists(snap2HyperTextMarkupLanguage))
|
if (snap2HyperTextMarkupLanguage is not null && System.IO.File.Exists(snap2HyperTextMarkupLanguage)) {
|
||||||
{
|
|
||||||
if (!areTheyTheSame || (areTheyTheSame && !System.IO.File.Exists(record.Snap2HyperTextMarkupLanguage)))
|
if (!areTheyTheSame || (areTheyTheSame && !System.IO.File.Exists(record.Snap2HyperTextMarkupLanguage)))
|
||||||
WriteSnap2HyperTextMarkupLanguage(logger, snap2HyperTextMarkupLanguage, record);
|
WriteSnap2HyperTextMarkupLanguage(logger, snap2HyperTextMarkupLanguage, record);
|
||||||
}
|
}
|
||||||
if (areTheyTheSame)
|
if (areTheyTheSame) {
|
||||||
{
|
|
||||||
WriteAllText(record.Path, json);
|
WriteAllText(record.Path, json);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -121,8 +109,7 @@ internal static partial class Helper20241217
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void Verify(string searchPattern, string[] ignoreFileNames)
|
private static void Verify(string searchPattern, string[] ignoreFileNames) {
|
||||||
{
|
|
||||||
List<Target> targets = [
|
List<Target> targets = [
|
||||||
new(new SecureShell(), null),
|
new(new SecureShell(), null),
|
||||||
new(null, new ServerMessageBlock("\\\\mesfs.infineon.com\\EC_APC\\DEV", true))
|
new(null, new ServerMessageBlock("\\\\mesfs.infineon.com\\EC_APC\\DEV", true))
|
||||||
@ -146,12 +133,10 @@ internal static partial class Helper20241217
|
|||||||
WriteAllText(path, json);
|
WriteAllText(path, json);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ReadOnlyCollection<File> GetFilteredFiles(string searchPattern, string[] ignoreFileNames, ReadOnlyCollection<File> files)
|
private static ReadOnlyCollection<File> GetFilteredFiles(string searchPattern, string[] ignoreFileNames, ReadOnlyCollection<File> files) {
|
||||||
{
|
|
||||||
List<File> results = [];
|
List<File> results = [];
|
||||||
string fileName;
|
string fileName;
|
||||||
foreach (File file in files)
|
foreach (File file in files) {
|
||||||
{
|
|
||||||
if (file.RelativePath == searchPattern)
|
if (file.RelativePath == searchPattern)
|
||||||
continue;
|
continue;
|
||||||
fileName = Path.GetFileName(file.RelativePath);
|
fileName = Path.GetFileName(file.RelativePath);
|
||||||
@ -166,8 +151,7 @@ internal static partial class Helper20241217
|
|||||||
return results.AsReadOnly();
|
return results.AsReadOnly();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IEnumerable<Record> GetRecords(string directory, string destination, IEnumerable<string> files)
|
private static IEnumerable<Record> GetRecords(string directory, string destination, IEnumerable<string> files) {
|
||||||
{
|
|
||||||
Job? job;
|
Job? job;
|
||||||
string json;
|
string json;
|
||||||
Record record;
|
Record record;
|
||||||
@ -176,13 +160,11 @@ internal static partial class Helper20241217
|
|||||||
string sourceDirectory;
|
string sourceDirectory;
|
||||||
string destinationDirectory;
|
string destinationDirectory;
|
||||||
string snap2HyperTextMarkupLanguage;
|
string snap2HyperTextMarkupLanguage;
|
||||||
foreach (string file in files)
|
foreach (string file in files) {
|
||||||
{
|
|
||||||
fileName = Path.GetFileName(file);
|
fileName = Path.GetFileName(file);
|
||||||
sourceDirectory = Path.GetDirectoryName(file) ?? throw new Exception();
|
sourceDirectory = Path.GetDirectoryName(file) ?? throw new Exception();
|
||||||
directoryName = Path.GetFileName(sourceDirectory);
|
directoryName = Path.GetFileName(sourceDirectory);
|
||||||
if (!fileName.StartsWith('.'))
|
if (!fileName.StartsWith('.')) {
|
||||||
{
|
|
||||||
System.IO.File.Move(file, Path.Combine(sourceDirectory, $".{fileName}"));
|
System.IO.File.Move(file, Path.Combine(sourceDirectory, $".{fileName}"));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -213,11 +195,9 @@ internal static partial class Helper20241217
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void WriteSnap2HyperTextMarkupLanguage(ILogger<Worker> logger, string snap2HyperTextMarkupLanguage, Record record)
|
private static void WriteSnap2HyperTextMarkupLanguage(ILogger<Worker> logger, string snap2HyperTextMarkupLanguage, Record record) {
|
||||||
{
|
|
||||||
string title = Path.GetFileName(record.SourceDirectory);
|
string title = Path.GetFileName(record.SourceDirectory);
|
||||||
ProcessStartInfo processStartInfo = new()
|
ProcessStartInfo processStartInfo = new() {
|
||||||
{
|
|
||||||
Arguments = $"-path:\"{record.SourceDirectory}\" -outfile:\"{record.Snap2HyperTextMarkupLanguage}\" -title:\"{title}\" -hidden -silent",
|
Arguments = $"-path:\"{record.SourceDirectory}\" -outfile:\"{record.Snap2HyperTextMarkupLanguage}\" -title:\"{title}\" -hidden -silent",
|
||||||
FileName = snap2HyperTextMarkupLanguage,
|
FileName = snap2HyperTextMarkupLanguage,
|
||||||
RedirectStandardError = true,
|
RedirectStandardError = true,
|
||||||
@ -230,15 +210,13 @@ internal static partial class Helper20241217
|
|||||||
logger.LogInformation($"Snap2HyperTextMarkupLanguage: {process.StandardOutput.ReadToEnd()}{Environment.NewLine}{process.StandardError.ReadToEnd()}{Environment.NewLine}{process.ExitCode}");
|
logger.LogInformation($"Snap2HyperTextMarkupLanguage: {process.StandardOutput.ReadToEnd()}{Environment.NewLine}{process.StandardError.ReadToEnd()}{Environment.NewLine}{process.ExitCode}");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ReadOnlyCollection<File> GetFiles(string directory, string searchPattern, string[] ignoreFileNames)
|
private static ReadOnlyCollection<File> GetFiles(string directory, string searchPattern, string[] ignoreFileNames) {
|
||||||
{
|
|
||||||
List<File> results = [];
|
List<File> results = [];
|
||||||
File file;
|
File file;
|
||||||
string relativePath;
|
string relativePath;
|
||||||
string[] files = Directory.GetFiles(directory, "*", SearchOption.AllDirectories);
|
string[] files = Directory.GetFiles(directory, "*", SearchOption.AllDirectories);
|
||||||
FileInfo[] fileInfoCollection = files.Select(l => new FileInfo(l)).ToArray();
|
FileInfo[] fileInfoCollection = files.Select(l => new FileInfo(l)).ToArray();
|
||||||
foreach (FileInfo fileInfo in fileInfoCollection)
|
foreach (FileInfo fileInfo in fileInfoCollection) {
|
||||||
{
|
|
||||||
if (fileInfo.Name == searchPattern)
|
if (fileInfo.Name == searchPattern)
|
||||||
continue;
|
continue;
|
||||||
if (ignoreFileNames.Any(l => l == fileInfo.Name))
|
if (ignoreFileNames.Any(l => l == fileInfo.Name))
|
||||||
@ -254,8 +232,7 @@ internal static partial class Helper20241217
|
|||||||
return results.AsReadOnly();
|
return results.AsReadOnly();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Job GetJob(string searchPattern, string[] ignoreFileNames, Record record, ReadOnlyCollection<File> files)
|
private static Job GetJob(string searchPattern, string[] ignoreFileNames, Record record, ReadOnlyCollection<File> files) {
|
||||||
{
|
|
||||||
Job result;
|
Job result;
|
||||||
ReadOnlyCollection<File> collection = GetFilteredFiles(searchPattern, ignoreFileNames, files);
|
ReadOnlyCollection<File> collection = GetFilteredFiles(searchPattern, ignoreFileNames, files);
|
||||||
double filesTotalLengthNew = collection.Select(l => l.Length).Sum();
|
double filesTotalLengthNew = collection.Select(l => l.Length).Sum();
|
||||||
@ -270,37 +247,28 @@ internal static partial class Helper20241217
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool GetAreTheyTheSame(ILogger<Worker> logger, string searchPattern, string[] ignoreFileNames, Record record, Job jobNew)
|
private static bool GetAreTheyTheSame(ILogger<Worker> logger, string searchPattern, string[] ignoreFileNames, Record record, Job jobNew) {
|
||||||
{
|
|
||||||
bool result;
|
bool result;
|
||||||
ReadOnlyCollection<File> collection = GetFilteredFiles(searchPattern, ignoreFileNames, record.Job.Files.AsReadOnly());
|
ReadOnlyCollection<File> collection = GetFilteredFiles(searchPattern, ignoreFileNames, record.Job.Files.AsReadOnly());
|
||||||
int filesCountOld = collection.Count;
|
int filesCountOld = collection.Count;
|
||||||
int filesCountNew = jobNew.Files.Length;
|
int filesCountNew = jobNew.Files.Length;
|
||||||
if (filesCountNew != filesCountOld)
|
if (filesCountNew != filesCountOld) {
|
||||||
{
|
|
||||||
result = false;
|
result = false;
|
||||||
logger.LogWarning("<{directory}> file count has changed {filesCountNew} != {filesCountOld}", record.SourceDirectory, filesCountNew, filesCountOld);
|
logger.LogWarning("<{directory}> file count has changed {filesCountNew} != {filesCountOld}", record.SourceDirectory, filesCountNew, filesCountOld);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
double filesTotalLengthOld = collection.Select(l => l.Length).Sum();
|
double filesTotalLengthOld = collection.Select(l => l.Length).Sum();
|
||||||
double filesTotalLengthNew = jobNew.Files.Select(l => l.Length).Sum();
|
double filesTotalLengthNew = jobNew.Files.Select(l => l.Length).Sum();
|
||||||
if (filesTotalLengthNew != filesTotalLengthOld)
|
if (filesTotalLengthNew != filesTotalLengthOld) {
|
||||||
{
|
|
||||||
result = false;
|
result = false;
|
||||||
logger.LogWarning("<{directory}> file length has changed {filesTotalLengthNew} != {filesTotalLengthOld}", record.SourceDirectory, filesTotalLengthNew, filesTotalLengthOld);
|
logger.LogWarning("<{directory}> file length has changed {filesTotalLengthNew} != {filesTotalLengthOld}", record.SourceDirectory, filesTotalLengthNew, filesTotalLengthOld);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
string jsonNew = JsonSerializer.Serialize(jobNew.Files, FilesSourceGenerationContext.Default.FileArray);
|
string jsonNew = JsonSerializer.Serialize(jobNew.Files, FilesSourceGenerationContext.Default.FileArray);
|
||||||
string jsonOld = JsonSerializer.Serialize(collection.ToArray(), FilesSourceGenerationContext.Default.FileArray);
|
string jsonOld = JsonSerializer.Serialize(collection.ToArray(), FilesSourceGenerationContext.Default.FileArray);
|
||||||
if (jsonNew == jsonOld)
|
if (jsonNew == jsonOld)
|
||||||
result = true;
|
result = true;
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
result = false;
|
result = false;
|
||||||
if (Debugger.IsAttached)
|
if (Debugger.IsAttached) {
|
||||||
{
|
|
||||||
WriteAllText(Path.Combine(Environment.CurrentDirectory, ".vscode", "helper", "old.json"), jsonOld);
|
WriteAllText(Path.Combine(Environment.CurrentDirectory, ".vscode", "helper", "old.json"), jsonOld);
|
||||||
WriteAllText(Path.Combine(Environment.CurrentDirectory, ".vscode", "helper", "new.json"), jsonNew);
|
WriteAllText(Path.Combine(Environment.CurrentDirectory, ".vscode", "helper", "new.json"), jsonNew);
|
||||||
}
|
}
|
||||||
@ -311,15 +279,13 @@ internal static partial class Helper20241217
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void WriteAllText(string path, string text)
|
private static void WriteAllText(string path, string text) {
|
||||||
{
|
|
||||||
string check = !System.IO.File.Exists(path) ? string.Empty : System.IO.File.ReadAllText(path);
|
string check = !System.IO.File.Exists(path) ? string.Empty : System.IO.File.ReadAllText(path);
|
||||||
if (check != text)
|
if (check != text)
|
||||||
System.IO.File.WriteAllText(path, text);
|
System.IO.File.WriteAllText(path, text);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void WritePassedExtension(Record record, ReadOnlyCollection<File> files, string directoryName, string path)
|
private static void WritePassedExtension(Record record, ReadOnlyCollection<File> files, string directoryName, string path) {
|
||||||
{
|
|
||||||
if (record.Job.Extension.Equals(".iso", StringComparison.OrdinalIgnoreCase))
|
if (record.Job.Extension.Equals(".iso", StringComparison.OrdinalIgnoreCase))
|
||||||
WriteISO(record, files, path, directoryName);
|
WriteISO(record, files, path, directoryName);
|
||||||
else if (record.Job.Extension.Equals(".zip", StringComparison.OrdinalIgnoreCase))
|
else if (record.Job.Extension.Equals(".zip", StringComparison.OrdinalIgnoreCase))
|
||||||
@ -328,21 +294,18 @@ internal static partial class Helper20241217
|
|||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void WriteISO(Record record, ReadOnlyCollection<File> files, string path, string directoryName)
|
private static void WriteISO(Record record, ReadOnlyCollection<File> files, string path, string directoryName) {
|
||||||
{
|
|
||||||
CDBuilder builder = new() { UseJoliet = true, VolumeIdentifier = directoryName.Length < 25 ? directoryName : directoryName[..25] };
|
CDBuilder builder = new() { UseJoliet = true, VolumeIdentifier = directoryName.Length < 25 ? directoryName : directoryName[..25] };
|
||||||
foreach (File file in files)
|
foreach (File file in files)
|
||||||
_ = builder.AddFile(file.RelativePath, Path.Combine(record.SourceDirectory, file.RelativePath));
|
_ = builder.AddFile(file.RelativePath, Path.Combine(record.SourceDirectory, file.RelativePath));
|
||||||
builder.Build(path);
|
builder.Build(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void WriteZIP(Record record, ReadOnlyCollection<File> files, string path)
|
private static void WriteZIP(Record record, ReadOnlyCollection<File> files, string path) {
|
||||||
{
|
|
||||||
using ZipArchive zip = ZipFile.Open(path, ZipArchiveMode.Create);
|
using ZipArchive zip = ZipFile.Open(path, ZipArchiveMode.Create);
|
||||||
string directoryEntry;
|
string directoryEntry;
|
||||||
List<string> directoryEntries = [];
|
List<string> directoryEntries = [];
|
||||||
foreach (File file in files)
|
foreach (File file in files) {
|
||||||
{
|
|
||||||
directoryEntry = Path.GetDirectoryName(file.RelativePath) ?? throw new Exception();
|
directoryEntry = Path.GetDirectoryName(file.RelativePath) ?? throw new Exception();
|
||||||
if (!directoryEntries.Contains(directoryEntry))
|
if (!directoryEntries.Contains(directoryEntry))
|
||||||
continue;
|
continue;
|
||||||
@ -353,8 +316,7 @@ internal static partial class Helper20241217
|
|||||||
_ = zip.CreateEntryFromFile(Path.Combine(record.SourceDirectory, file.RelativePath), file.RelativePath);
|
_ = zip.CreateEntryFromFile(Path.Combine(record.SourceDirectory, file.RelativePath), file.RelativePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void WriteAllText(Record record, string text, string path)
|
private static void WriteAllText(Record record, string text, string path) {
|
||||||
{
|
|
||||||
WriteAllText(record.Path, text);
|
WriteAllText(record.Path, text);
|
||||||
System.IO.File.Copy(record.Path, $"{path}.json");
|
System.IO.File.Copy(record.Path, $"{path}.json");
|
||||||
string checkFile = Path.Combine(record.SourceDirectory, ".html");
|
string checkFile = Path.Combine(record.SourceDirectory, ".html");
|
||||||
|
@ -9,15 +9,13 @@ using System.Text.Json;
|
|||||||
|
|
||||||
namespace File_Folder_Helper.ADO2024.PI4;
|
namespace File_Folder_Helper.ADO2024.PI4;
|
||||||
|
|
||||||
internal static partial class Helper20241224
|
internal static partial class Helper20241224 {
|
||||||
{
|
|
||||||
|
|
||||||
private static readonly HttpClient _HttpClient = new();
|
private static readonly HttpClient _HttpClient = new();
|
||||||
|
|
||||||
private record Record(Uri URI, string Path, DateTime LastModified);
|
private record Record(Uri URI, string Path, DateTime LastModified);
|
||||||
|
|
||||||
private static ReadOnlyCollection<NginxFileSystem>? GetRecursiveCollection(string host, string page)
|
private static ReadOnlyCollection<NginxFileSystem>? GetRecursiveCollection(string host, string page) {
|
||||||
{
|
|
||||||
List<NginxFileSystem>? results;
|
List<NginxFileSystem>? results;
|
||||||
Uri uri = new($"https://{host}/{page}");
|
Uri uri = new($"https://{host}/{page}");
|
||||||
string format = NginxFileSystem.GetFormat();
|
string format = NginxFileSystem.GetFormat();
|
||||||
@ -26,25 +24,21 @@ internal static partial class Helper20241224
|
|||||||
taskHttpResponseMessage.Wait();
|
taskHttpResponseMessage.Wait();
|
||||||
if (!taskHttpResponseMessage.Result.IsSuccessStatusCode)
|
if (!taskHttpResponseMessage.Result.IsSuccessStatusCode)
|
||||||
results = null;
|
results = null;
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
Task<string> taskString = taskHttpResponseMessage.Result.Content.ReadAsStringAsync();
|
Task<string> taskString = taskHttpResponseMessage.Result.Content.ReadAsStringAsync();
|
||||||
taskString.Wait();
|
taskString.Wait();
|
||||||
NginxFileSystem[]? nginxFileSystems = JsonSerializer.Deserialize(taskString.Result, NginxFileSystemCollectionSourceGenerationContext.Default.NginxFileSystemArray);
|
NginxFileSystem[]? nginxFileSystems = JsonSerializer.Deserialize(taskString.Result, NginxFileSystemCollectionSourceGenerationContext.Default.NginxFileSystemArray);
|
||||||
if (nginxFileSystems is null)
|
if (nginxFileSystems is null)
|
||||||
results = null;
|
results = null;
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
results = [];
|
results = [];
|
||||||
NginxFileSystem nginxFileSystem;
|
NginxFileSystem nginxFileSystem;
|
||||||
ReadOnlyCollection<NginxFileSystem>? directory;
|
ReadOnlyCollection<NginxFileSystem>? directory;
|
||||||
for (int i = 0; i < nginxFileSystems.Length; i++)
|
for (int i = 0; i < nginxFileSystems.Length; i++) {
|
||||||
{
|
|
||||||
nginxFileSystem = NginxFileSystem.Get(format, timeZoneInfo, uri, nginxFileSystems[i]);
|
nginxFileSystem = NginxFileSystem.Get(format, timeZoneInfo, uri, nginxFileSystems[i]);
|
||||||
if (nginxFileSystem.Type == "file")
|
if (nginxFileSystem.Type == "file")
|
||||||
results.Add(nginxFileSystem);
|
results.Add(nginxFileSystem);
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
directory = GetRecursiveCollection(host, $"{page}/{nginxFileSystem.Name}");
|
directory = GetRecursiveCollection(host, $"{page}/{nginxFileSystem.Name}");
|
||||||
if (directory is null)
|
if (directory is null)
|
||||||
continue;
|
continue;
|
||||||
@ -56,30 +50,25 @@ internal static partial class Helper20241224
|
|||||||
return results?.AsReadOnly();
|
return results?.AsReadOnly();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ReadOnlyCollection<NginxFileSystem>? GetCollection(string format, TimeZoneInfo timeZoneInfo, Uri uri)
|
private static ReadOnlyCollection<NginxFileSystem>? GetCollection(string format, TimeZoneInfo timeZoneInfo, Uri uri) {
|
||||||
{
|
|
||||||
List<NginxFileSystem>? results;
|
List<NginxFileSystem>? results;
|
||||||
Task<HttpResponseMessage> taskHttpResponseMessage = _HttpClient.GetAsync(uri);
|
Task<HttpResponseMessage> taskHttpResponseMessage = _HttpClient.GetAsync(uri);
|
||||||
taskHttpResponseMessage.Wait();
|
taskHttpResponseMessage.Wait();
|
||||||
if (!taskHttpResponseMessage.Result.IsSuccessStatusCode)
|
if (!taskHttpResponseMessage.Result.IsSuccessStatusCode)
|
||||||
results = null;
|
results = null;
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
Task<string> taskString = taskHttpResponseMessage.Result.Content.ReadAsStringAsync();
|
Task<string> taskString = taskHttpResponseMessage.Result.Content.ReadAsStringAsync();
|
||||||
taskString.Wait();
|
taskString.Wait();
|
||||||
if (taskString.Result.StartsWith('<'))
|
if (taskString.Result.StartsWith('<'))
|
||||||
results = null;
|
results = null;
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
NginxFileSystem[]? nginxFileSystems = JsonSerializer.Deserialize(taskString.Result, NginxFileSystemCollectionSourceGenerationContext.Default.NginxFileSystemArray);
|
NginxFileSystem[]? nginxFileSystems = JsonSerializer.Deserialize(taskString.Result, NginxFileSystemCollectionSourceGenerationContext.Default.NginxFileSystemArray);
|
||||||
if (nginxFileSystems is null)
|
if (nginxFileSystems is null)
|
||||||
results = null;
|
results = null;
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
results = [];
|
results = [];
|
||||||
NginxFileSystem nginxFileSystem;
|
NginxFileSystem nginxFileSystem;
|
||||||
for (int i = 0; i < nginxFileSystems.Length; i++)
|
for (int i = 0; i < nginxFileSystems.Length; i++) {
|
||||||
{
|
|
||||||
nginxFileSystem = NginxFileSystem.Get(format, timeZoneInfo, uri, nginxFileSystems[i]);
|
nginxFileSystem = NginxFileSystem.Get(format, timeZoneInfo, uri, nginxFileSystems[i]);
|
||||||
results.Add(nginxFileSystem);
|
results.Add(nginxFileSystem);
|
||||||
}
|
}
|
||||||
@ -89,19 +78,16 @@ internal static partial class Helper20241224
|
|||||||
return results?.AsReadOnly();
|
return results?.AsReadOnly();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Record? CompareFile(string host, ReadOnlyCollection<string> directoryNames, string compareDirectory, NginxFileSystem nginxFileSystem)
|
private static Record? CompareFile(string host, ReadOnlyCollection<string> directoryNames, string compareDirectory, NginxFileSystem nginxFileSystem) {
|
||||||
{
|
|
||||||
Record? result;
|
Record? result;
|
||||||
if (nginxFileSystem.LastModified is null || nginxFileSystem.Length is null)
|
if (nginxFileSystem.LastModified is null || nginxFileSystem.Length is null)
|
||||||
result = null;
|
result = null;
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
Uri uri = new($"https://{host}/{string.Join('/', directoryNames)}/{nginxFileSystem.Name}");
|
Uri uri = new($"https://{host}/{string.Join('/', directoryNames)}/{nginxFileSystem.Name}");
|
||||||
FileInfo fileInfo = new($"{compareDirectory}\\{string.Join('\\', directoryNames)}\\{nginxFileSystem.Name}");
|
FileInfo fileInfo = new($"{compareDirectory}\\{string.Join('\\', directoryNames)}\\{nginxFileSystem.Name}");
|
||||||
if (!fileInfo.Exists || fileInfo.Length != nginxFileSystem.Length.Value)
|
if (!fileInfo.Exists || fileInfo.Length != nginxFileSystem.Length.Value)
|
||||||
result = new(uri, fileInfo.FullName, nginxFileSystem.LastModified.Value);
|
result = new(uri, fileInfo.FullName, nginxFileSystem.LastModified.Value);
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
double totalSeconds = new TimeSpan(fileInfo.LastWriteTime.Ticks - nginxFileSystem.LastModified.Value.Ticks).TotalSeconds;
|
double totalSeconds = new TimeSpan(fileInfo.LastWriteTime.Ticks - nginxFileSystem.LastModified.Value.Ticks).TotalSeconds;
|
||||||
if (totalSeconds is < 2 and > -2)
|
if (totalSeconds is < 2 and > -2)
|
||||||
result = null;
|
result = null;
|
||||||
@ -112,8 +98,7 @@ internal static partial class Helper20241224
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ReadOnlyCollection<Record> CompareDirectory(string format, TimeZoneInfo timeZoneInfo, string host, ReadOnlyCollection<string> directoryNames, string compareDirectory, NginxFileSystem nginxFileSystem)
|
private static ReadOnlyCollection<Record> CompareDirectory(string format, TimeZoneInfo timeZoneInfo, string host, ReadOnlyCollection<string> directoryNames, string compareDirectory, NginxFileSystem nginxFileSystem) {
|
||||||
{
|
|
||||||
ReadOnlyCollection<Record> results;
|
ReadOnlyCollection<Record> results;
|
||||||
List<string> collection = directoryNames.ToList();
|
List<string> collection = directoryNames.ToList();
|
||||||
collection.Add(nginxFileSystem.Name);
|
collection.Add(nginxFileSystem.Name);
|
||||||
@ -121,29 +106,23 @@ internal static partial class Helper20241224
|
|||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ReadOnlyCollection<Record> GetRecord(string format, TimeZoneInfo timeZoneInfo, string host, ReadOnlyCollection<string> directoryNames, string compareDirectory)
|
private static ReadOnlyCollection<Record> GetRecord(string format, TimeZoneInfo timeZoneInfo, string host, ReadOnlyCollection<string> directoryNames, string compareDirectory) {
|
||||||
{
|
|
||||||
List<Record> results = [];
|
List<Record> results = [];
|
||||||
Uri uri = new($"https://{host}/{string.Join('/', directoryNames)}");
|
Uri uri = new($"https://{host}/{string.Join('/', directoryNames)}");
|
||||||
ReadOnlyCollection<NginxFileSystem>? nginxFileSystems = GetCollection(format, timeZoneInfo, uri);
|
ReadOnlyCollection<NginxFileSystem>? nginxFileSystems = GetCollection(format, timeZoneInfo, uri);
|
||||||
if (nginxFileSystems is not null)
|
if (nginxFileSystems is not null) {
|
||||||
{
|
|
||||||
NginxFileSystem nginxFileSystem;
|
NginxFileSystem nginxFileSystem;
|
||||||
ReadOnlyCollection<Record> records;
|
ReadOnlyCollection<Record> records;
|
||||||
string checkDirectory = $"{compareDirectory}\\{string.Join('\\', directoryNames)}";
|
string checkDirectory = $"{compareDirectory}\\{string.Join('\\', directoryNames)}";
|
||||||
if (!Directory.Exists(checkDirectory))
|
if (!Directory.Exists(checkDirectory))
|
||||||
_ = Directory.CreateDirectory(checkDirectory);
|
_ = Directory.CreateDirectory(checkDirectory);
|
||||||
for (int i = 0; i < nginxFileSystems.Count; i++)
|
for (int i = 0; i < nginxFileSystems.Count; i++) {
|
||||||
{
|
|
||||||
nginxFileSystem = NginxFileSystem.Get(format, timeZoneInfo, uri, nginxFileSystems[i]);
|
nginxFileSystem = NginxFileSystem.Get(format, timeZoneInfo, uri, nginxFileSystems[i]);
|
||||||
if (nginxFileSystem.Type == "file")
|
if (nginxFileSystem.Type == "file") {
|
||||||
{
|
|
||||||
Record? record = CompareFile(host, directoryNames, compareDirectory, nginxFileSystem);
|
Record? record = CompareFile(host, directoryNames, compareDirectory, nginxFileSystem);
|
||||||
if (record is not null)
|
if (record is not null)
|
||||||
results.Add(record);
|
results.Add(record);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
records = CompareDirectory(format, timeZoneInfo, host, directoryNames, compareDirectory, nginxFileSystem);
|
records = CompareDirectory(format, timeZoneInfo, host, directoryNames, compareDirectory, nginxFileSystem);
|
||||||
foreach (Record record in records)
|
foreach (Record record in records)
|
||||||
results.Add(record);
|
results.Add(record);
|
||||||
@ -153,12 +132,10 @@ internal static partial class Helper20241224
|
|||||||
return results.AsReadOnly();
|
return results.AsReadOnly();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void Download(Record record)
|
private static void Download(Record record) {
|
||||||
{
|
|
||||||
Task<HttpResponseMessage> taskHttpResponseMessage = _HttpClient.GetAsync(record.URI);
|
Task<HttpResponseMessage> taskHttpResponseMessage = _HttpClient.GetAsync(record.URI);
|
||||||
taskHttpResponseMessage.Wait();
|
taskHttpResponseMessage.Wait();
|
||||||
if (taskHttpResponseMessage.Result.IsSuccessStatusCode)
|
if (taskHttpResponseMessage.Result.IsSuccessStatusCode) {
|
||||||
{
|
|
||||||
Task<string> taskString = taskHttpResponseMessage.Result.Content.ReadAsStringAsync();
|
Task<string> taskString = taskHttpResponseMessage.Result.Content.ReadAsStringAsync();
|
||||||
taskString.Wait();
|
taskString.Wait();
|
||||||
File.WriteAllText(record.Path, taskString.Result);
|
File.WriteAllText(record.Path, taskString.Result);
|
||||||
@ -166,8 +143,7 @@ internal static partial class Helper20241224
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void Compare(ILogger<Worker> logger, List<string> args)
|
internal static void Compare(ILogger<Worker> logger, List<string> args) {
|
||||||
{
|
|
||||||
string host = args[2];
|
string host = args[2];
|
||||||
string rootDirectoryName = args[3];
|
string rootDirectoryName = args[3];
|
||||||
string format = NginxFileSystem.GetFormat();
|
string format = NginxFileSystem.GetFormat();
|
||||||
@ -178,8 +154,7 @@ internal static partial class Helper20241224
|
|||||||
#if ShellProgressBar
|
#if ShellProgressBar
|
||||||
ProgressBar progressBar = new(records.Count, "Downloading", new ProgressBarOptions() { ProgressCharacter = '─', ProgressBarOnBottom = true, DisableBottomPercentage = true });
|
ProgressBar progressBar = new(records.Count, "Downloading", new ProgressBarOptions() { ProgressCharacter = '─', ProgressBarOnBottom = true, DisableBottomPercentage = true });
|
||||||
#endif
|
#endif
|
||||||
foreach (Record record in records)
|
foreach (Record record in records) {
|
||||||
{
|
|
||||||
#if ShellProgressBar
|
#if ShellProgressBar
|
||||||
progressBar.Tick();
|
progressBar.Tick();
|
||||||
#endif
|
#endif
|
||||||
@ -188,8 +163,7 @@ internal static partial class Helper20241224
|
|||||||
#if ShellProgressBar
|
#if ShellProgressBar
|
||||||
progressBar.Dispose();
|
progressBar.Dispose();
|
||||||
#endif
|
#endif
|
||||||
if (Debugger.IsAttached)
|
if (Debugger.IsAttached) {
|
||||||
{
|
|
||||||
ReadOnlyCollection<NginxFileSystem>? recursiveCollection = GetRecursiveCollection(host, rootDirectoryName);
|
ReadOnlyCollection<NginxFileSystem>? recursiveCollection = GetRecursiveCollection(host, rootDirectoryName);
|
||||||
string? json = recursiveCollection is null ? null : JsonSerializer.Serialize(recursiveCollection.ToArray(), NginxFileSystemCollectionSourceGenerationContext.Default.NginxFileSystemArray);
|
string? json = recursiveCollection is null ? null : JsonSerializer.Serialize(recursiveCollection.ToArray(), NginxFileSystemCollectionSourceGenerationContext.Default.NginxFileSystemArray);
|
||||||
if (!string.IsNullOrEmpty(json))
|
if (!string.IsNullOrEmpty(json))
|
||||||
|
296
ADO2025/PI4/.editorconfig
Normal file
296
ADO2025/PI4/.editorconfig
Normal file
@ -0,0 +1,296 @@
|
|||||||
|
[*.md]
|
||||||
|
end_of_line = crlf
|
||||||
|
file_header_template = unset
|
||||||
|
indent_size = 2
|
||||||
|
indent_style = space
|
||||||
|
insert_final_newline = false
|
||||||
|
root = true
|
||||||
|
tab_width = 2
|
||||||
|
[*.csproj]
|
||||||
|
end_of_line = crlf
|
||||||
|
file_header_template = unset
|
||||||
|
indent_size = 2
|
||||||
|
indent_style = space
|
||||||
|
insert_final_newline = false
|
||||||
|
root = true
|
||||||
|
tab_width = 2
|
||||||
|
[*.cs]
|
||||||
|
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_new_line_before_catch = false
|
||||||
|
csharp_new_line_before_else = false
|
||||||
|
csharp_new_line_before_finally = false
|
||||||
|
csharp_new_line_before_members_in_anonymous_types = true
|
||||||
|
csharp_new_line_before_members_in_object_initializers = true
|
||||||
|
csharp_new_line_before_open_brace = none
|
||||||
|
csharp_new_line_between_query_expression_clauses = true
|
||||||
|
csharp_prefer_braces = false
|
||||||
|
csharp_prefer_qualified_reference = true:error
|
||||||
|
csharp_prefer_simple_default_expression = true:warning
|
||||||
|
csharp_prefer_simple_using_statement = true:warning
|
||||||
|
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
|
||||||
|
csharp_preserve_single_line_blocks = true
|
||||||
|
csharp_preserve_single_line_statements = false
|
||||||
|
csharp_space_after_cast = false
|
||||||
|
csharp_space_after_colon_in_inheritance_clause = true
|
||||||
|
csharp_space_after_comma = true
|
||||||
|
csharp_space_after_dot = false
|
||||||
|
csharp_space_after_keywords_in_control_flow_statements = true
|
||||||
|
csharp_space_after_semicolon_in_for_statement = true
|
||||||
|
csharp_space_around_binary_operators = before_and_after
|
||||||
|
csharp_space_around_declaration_statements = 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_between_empty_square_brackets = false
|
||||||
|
csharp_space_between_method_call_empty_parameter_list_parentheses = false
|
||||||
|
csharp_space_between_method_call_name_and_opening_parenthesis = false
|
||||||
|
csharp_space_between_method_call_parameter_list_parentheses = false
|
||||||
|
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
|
||||||
|
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
|
||||||
|
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true
|
||||||
|
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true
|
||||||
|
csharp_style_allow_embedded_statements_on_same_line_experimental = true
|
||||||
|
csharp_style_conditional_delegate_call = true
|
||||||
|
csharp_style_deconstructed_variable_declaration = false
|
||||||
|
csharp_style_expression_bodied_accessors = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_constructors = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_indexers = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_lambdas = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_local_functions = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_methods = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_operators = when_on_single_line:warning
|
||||||
|
csharp_style_expression_bodied_properties = when_on_single_line:warning
|
||||||
|
csharp_style_implicit_object_creation_when_type_is_apparent = true:warning
|
||||||
|
csharp_style_inlined_variable_declaration = false
|
||||||
|
csharp_style_namespace_declarations = file_scoped:warning
|
||||||
|
csharp_style_pattern_local_over_anonymous_function = true:warning
|
||||||
|
csharp_style_pattern_matching_over_as_with_null_check = true:warning
|
||||||
|
csharp_style_pattern_matching_over_is_with_cast_check = true:warning
|
||||||
|
csharp_style_prefer_index_operator = true:warning
|
||||||
|
csharp_style_prefer_not_pattern = true:warning
|
||||||
|
csharp_style_prefer_null_check_over_type_check = true
|
||||||
|
csharp_style_prefer_pattern_matching = true:warning
|
||||||
|
csharp_style_prefer_range_operator = true:warning
|
||||||
|
csharp_style_prefer_switch_expression = true:warning
|
||||||
|
csharp_style_throw_expression = true
|
||||||
|
csharp_style_unused_value_assignment_preference = discard_variable:warning
|
||||||
|
csharp_style_unused_value_expression_statement_preference = discard_variable:warning
|
||||||
|
csharp_style_var_elsewhere = false:warning
|
||||||
|
csharp_style_var_for_built_in_types = false:warning
|
||||||
|
csharp_style_var_when_type_is_apparent = false:warning
|
||||||
|
csharp_using_directive_placement = outside_namespace
|
||||||
|
dotnet_analyzer_diagnostic.category-Design.severity = error
|
||||||
|
dotnet_analyzer_diagnostic.category-Documentation.severity = error
|
||||||
|
dotnet_analyzer_diagnostic.category-Globalization.severity = none
|
||||||
|
dotnet_analyzer_diagnostic.category-Interoperability.severity = error
|
||||||
|
dotnet_analyzer_diagnostic.category-Maintainability.severity = error
|
||||||
|
dotnet_analyzer_diagnostic.category-Naming.severity = none
|
||||||
|
dotnet_analyzer_diagnostic.category-Performance.severity = none
|
||||||
|
dotnet_analyzer_diagnostic.category-Reliability.severity = error
|
||||||
|
dotnet_analyzer_diagnostic.category-Security.severity = error
|
||||||
|
dotnet_analyzer_diagnostic.category-SingleFile.severity = error
|
||||||
|
dotnet_analyzer_diagnostic.category-Style.severity = error
|
||||||
|
dotnet_analyzer_diagnostic.category-Usage.severity = error
|
||||||
|
dotnet_code_quality_unused_parameters = all
|
||||||
|
dotnet_code_quality_unused_parameters = non_public
|
||||||
|
dotnet_code_quality.CAXXXX.api_surface = private, internal
|
||||||
|
dotnet_diagnostic.CA1001.severity = error # CA1001: Types that own disposable fields should be disposable
|
||||||
|
dotnet_diagnostic.CA1051.severity = error # CA1051: Do not declare visible instance fields
|
||||||
|
dotnet_diagnostic.CA1511.severity = warning # CA1511: Use 'ArgumentException.ThrowIfNullOrEmpty' instead of explicitly throwing a new exception instance
|
||||||
|
dotnet_diagnostic.CA1513.severity = warning # Use 'ObjectDisposedException.ThrowIf' instead of explicitly throwing a new exception instance
|
||||||
|
dotnet_diagnostic.CA1825.severity = warning # CA1825: Avoid zero-length array allocations
|
||||||
|
dotnet_diagnostic.CA1829.severity = warning # CA1829: Use Length/Count property instead of Count() when available
|
||||||
|
dotnet_diagnostic.CA1834.severity = warning # CA1834: Consider using 'StringBuilder.Append(char)' when applicable
|
||||||
|
dotnet_diagnostic.CA1860.severity = error # CA1860: Prefer comparing 'Count' to 0 rather than using 'Any()', both for clarity and for performance
|
||||||
|
dotnet_diagnostic.CA1862.severity = warning # CA1862: Prefer using 'string.Equals(string, StringComparison)' to perform a case-insensitive comparison, but keep in mind that this might cause subtle changes in behavior, so make sure to conduct thorough testing after applying the suggestion, or if culturally sensitive comparison is not required, consider using 'StringComparison.OrdinalIgnoreCase'
|
||||||
|
dotnet_diagnostic.CA1869.severity = none # CA1869: Avoid creating a new 'JsonSerializerOptions' instance for every serialization operation. Cache and reuse instances instead.
|
||||||
|
dotnet_diagnostic.CA2201.severity = none # CA2201: Exception type System.NullReferenceException is reserved by the runtime
|
||||||
|
dotnet_diagnostic.CA2254.severity = none # CA2254: The logging message template should not vary between calls to 'LoggerExtensions.LogInformation(ILogger, string?, params object?[])'
|
||||||
|
dotnet_diagnostic.IDE0001.severity = warning # IDE0001: Simplify name
|
||||||
|
dotnet_diagnostic.IDE0002.severity = warning # Simplify (member access) - System.Version.Equals("1", "2"); Version.Equals("1", "2");
|
||||||
|
dotnet_diagnostic.IDE0004.severity = warning # IDE0004: Cast is redundant.
|
||||||
|
dotnet_diagnostic.IDE0005.severity = warning # Using directive is unnecessary
|
||||||
|
dotnet_diagnostic.IDE0010.severity = none # Add missing cases to switch statement (IDE0010)
|
||||||
|
dotnet_diagnostic.IDE0028.severity = error # IDE0028: Collection initialization can be simplified
|
||||||
|
dotnet_diagnostic.IDE0031.severity = warning # Use null propagation (IDE0031)
|
||||||
|
dotnet_diagnostic.IDE0047.severity = warning # IDE0047: Parentheses can be removed
|
||||||
|
dotnet_diagnostic.IDE0048.severity = none # Parentheses preferences (IDE0047 and IDE0048)
|
||||||
|
dotnet_diagnostic.IDE0049.severity = warning # Use language keywords instead of framework type names for type references (IDE0049)
|
||||||
|
dotnet_diagnostic.IDE0051.severity = error # Private member '' is unused [, ]
|
||||||
|
dotnet_diagnostic.IDE0058.severity = warning # IDE0058: Expression value is never used
|
||||||
|
dotnet_diagnostic.IDE0060.severity = error # IDE0060: Remove unused parameter
|
||||||
|
dotnet_diagnostic.IDE0074.severity = warning # IDE0074: Use compound assignment
|
||||||
|
dotnet_diagnostic.IDE0130.severity = none # Namespace does not match folder structure (IDE0130)
|
||||||
|
dotnet_diagnostic.IDE0270.severity = warning # IDE0270: Null check can be simplified
|
||||||
|
dotnet_diagnostic.IDE0290.severity = none # Use primary constructor [Distance]csharp(IDE0290)
|
||||||
|
dotnet_diagnostic.IDE0300.severity = error # IDE0300: Collection initialization can be simplified
|
||||||
|
dotnet_diagnostic.IDE0301.severity = error #IDE0301: Collection initialization can be simplified
|
||||||
|
dotnet_diagnostic.IDE0305.severity = none # IDE0305: Collection initialization can be simplified
|
||||||
|
dotnet_naming_rule.abstract_method_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.abstract_method_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.abstract_method_should_be_pascal_case.symbols = abstract_method
|
||||||
|
dotnet_naming_rule.class_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.class_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.class_should_be_pascal_case.symbols = class
|
||||||
|
dotnet_naming_rule.delegate_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.delegate_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.delegate_should_be_pascal_case.symbols = delegate
|
||||||
|
dotnet_naming_rule.enum_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.enum_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.enum_should_be_pascal_case.symbols = enum
|
||||||
|
dotnet_naming_rule.event_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.event_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.event_should_be_pascal_case.symbols = event
|
||||||
|
dotnet_naming_rule.interface_should_be_begins_with_i.severity = warning
|
||||||
|
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
|
||||||
|
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
|
||||||
|
dotnet_naming_rule.method_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.method_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.method_should_be_pascal_case.symbols = method
|
||||||
|
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
|
||||||
|
dotnet_naming_rule.private_method_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.private_method_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.private_method_should_be_pascal_case.symbols = private_method
|
||||||
|
dotnet_naming_rule.private_or_internal_field_should_be_private_of_internal_field.severity = warning
|
||||||
|
dotnet_naming_rule.private_or_internal_field_should_be_private_of_internal_field.style = private_of_internal_field
|
||||||
|
dotnet_naming_rule.private_or_internal_field_should_be_private_of_internal_field.symbols = private_or_internal_field
|
||||||
|
dotnet_naming_rule.private_or_internal_static_field_should_be_private_of_internal_field.severity = warning
|
||||||
|
dotnet_naming_rule.private_or_internal_static_field_should_be_private_of_internal_field.style = private_of_internal_field
|
||||||
|
dotnet_naming_rule.private_or_internal_static_field_should_be_private_of_internal_field.symbols = private_or_internal_static_field
|
||||||
|
dotnet_naming_rule.property_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.property_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.property_should_be_pascal_case.symbols = property
|
||||||
|
dotnet_naming_rule.public_or_protected_field_should_be_private_of_internal_field.severity = warning
|
||||||
|
dotnet_naming_rule.public_or_protected_field_should_be_private_of_internal_field.style = private_of_internal_field
|
||||||
|
dotnet_naming_rule.public_or_protected_field_should_be_private_of_internal_field.symbols = public_or_protected_field
|
||||||
|
dotnet_naming_rule.static_field_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.static_field_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.static_field_should_be_pascal_case.symbols = static_field
|
||||||
|
dotnet_naming_rule.static_method_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.static_method_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.static_method_should_be_pascal_case.symbols = static_method
|
||||||
|
dotnet_naming_rule.struct_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.struct_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.struct_should_be_pascal_case.symbols = struct
|
||||||
|
dotnet_naming_rule.types_should_be_pascal_case.severity = warning
|
||||||
|
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
|
||||||
|
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
|
||||||
|
dotnet_naming_style.begins_with_i.capitalization = pascal_case
|
||||||
|
dotnet_naming_style.begins_with_i.required_prefix = I
|
||||||
|
dotnet_naming_style.begins_with_i.required_suffix =
|
||||||
|
dotnet_naming_style.begins_with_i.word_separator =
|
||||||
|
dotnet_naming_style.pascal_case.capitalization = pascal_case
|
||||||
|
dotnet_naming_style.pascal_case.required_prefix =
|
||||||
|
dotnet_naming_style.pascal_case.required_suffix =
|
||||||
|
dotnet_naming_style.pascal_case.word_separator =
|
||||||
|
dotnet_naming_style.private_of_internal_field.capitalization = pascal_case
|
||||||
|
dotnet_naming_style.private_of_internal_field.required_prefix = _
|
||||||
|
dotnet_naming_style.private_of_internal_field.required_suffix =
|
||||||
|
dotnet_naming_style.private_of_internal_field.word_separator =
|
||||||
|
dotnet_naming_symbols.abstract_method.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.abstract_method.applicable_kinds = method
|
||||||
|
dotnet_naming_symbols.abstract_method.required_modifiers = abstract
|
||||||
|
dotnet_naming_symbols.class.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.class.applicable_kinds = class
|
||||||
|
dotnet_naming_symbols.class.required_modifiers =
|
||||||
|
dotnet_naming_symbols.delegate.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.delegate.applicable_kinds = delegate
|
||||||
|
dotnet_naming_symbols.delegate.required_modifiers =
|
||||||
|
dotnet_naming_symbols.enum.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.enum.applicable_kinds = enum
|
||||||
|
dotnet_naming_symbols.enum.required_modifiers =
|
||||||
|
dotnet_naming_symbols.event.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.event.applicable_kinds = event
|
||||||
|
dotnet_naming_symbols.event.required_modifiers =
|
||||||
|
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.interface.applicable_kinds = interface
|
||||||
|
dotnet_naming_symbols.interface.required_modifiers =
|
||||||
|
dotnet_naming_symbols.method.applicable_accessibilities = public
|
||||||
|
dotnet_naming_symbols.method.applicable_kinds = method
|
||||||
|
dotnet_naming_symbols.method.required_modifiers =
|
||||||
|
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
|
||||||
|
dotnet_naming_symbols.non_field_members.required_modifiers =
|
||||||
|
dotnet_naming_symbols.private_method.applicable_accessibilities = private
|
||||||
|
dotnet_naming_symbols.private_method.applicable_kinds = method
|
||||||
|
dotnet_naming_symbols.private_method.required_modifiers =
|
||||||
|
dotnet_naming_symbols.private_or_internal_field.applicable_accessibilities = internal, private, private_protected
|
||||||
|
dotnet_naming_symbols.private_or_internal_field.applicable_kinds = field
|
||||||
|
dotnet_naming_symbols.private_or_internal_field.required_modifiers =
|
||||||
|
dotnet_naming_symbols.private_or_internal_static_field.applicable_accessibilities = internal, private, private_protected
|
||||||
|
dotnet_naming_symbols.private_or_internal_static_field.applicable_kinds = field
|
||||||
|
dotnet_naming_symbols.private_or_internal_static_field.required_modifiers = static
|
||||||
|
dotnet_naming_symbols.property.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.property.applicable_kinds = property
|
||||||
|
dotnet_naming_symbols.property.required_modifiers =
|
||||||
|
dotnet_naming_symbols.public_or_protected_field.applicable_accessibilities = public, protected
|
||||||
|
dotnet_naming_symbols.public_or_protected_field.applicable_kinds = field
|
||||||
|
dotnet_naming_symbols.public_or_protected_field.required_modifiers =
|
||||||
|
dotnet_naming_symbols.static_field.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.static_field.applicable_kinds = field
|
||||||
|
dotnet_naming_symbols.static_field.required_modifiers = static
|
||||||
|
dotnet_naming_symbols.static_method.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.static_method.applicable_kinds = method
|
||||||
|
dotnet_naming_symbols.static_method.required_modifiers = static
|
||||||
|
dotnet_naming_symbols.struct.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.struct.applicable_kinds = struct
|
||||||
|
dotnet_naming_symbols.struct.required_modifiers =
|
||||||
|
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
|
||||||
|
dotnet_naming_symbols.types.required_modifiers =
|
||||||
|
dotnet_remove_unnecessary_suppression_exclusions = 0
|
||||||
|
dotnet_separate_import_directive_groups = false
|
||||||
|
dotnet_sort_system_directives_first = false
|
||||||
|
dotnet_style_allow_multiple_blank_lines_experimental = false:warning
|
||||||
|
dotnet_style_allow_statement_immediately_after_block_experimental = true
|
||||||
|
dotnet_style_coalesce_expression = true
|
||||||
|
dotnet_style_collection_initializer = true:warning
|
||||||
|
dotnet_style_explicit_tuple_names = true:warning
|
||||||
|
dotnet_style_namespace_match_folder = true
|
||||||
|
dotnet_style_null_propagation = true:warning
|
||||||
|
dotnet_style_object_initializer = true:warning
|
||||||
|
dotnet_style_operator_placement_when_wrapping = beginning_of_line
|
||||||
|
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity
|
||||||
|
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity
|
||||||
|
dotnet_style_parentheses_in_other_operators = never_if_unnecessary
|
||||||
|
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity
|
||||||
|
dotnet_style_predefined_type_for_locals_parameters_members = true
|
||||||
|
dotnet_style_predefined_type_for_member_access = true:warning
|
||||||
|
dotnet_style_prefer_auto_properties = true:warning
|
||||||
|
dotnet_style_prefer_compound_assignment = true:warning
|
||||||
|
dotnet_style_prefer_conditional_expression_over_assignment = false
|
||||||
|
dotnet_style_prefer_conditional_expression_over_return = false
|
||||||
|
dotnet_style_prefer_inferred_anonymous_type_member_names = true:warning
|
||||||
|
dotnet_style_prefer_inferred_tuple_names = true:warning
|
||||||
|
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning
|
||||||
|
dotnet_style_prefer_simplified_boolean_expressions = true:warning
|
||||||
|
dotnet_style_prefer_simplified_interpolation = true
|
||||||
|
dotnet_style_qualification_for_event = false:error
|
||||||
|
dotnet_style_qualification_for_field = false
|
||||||
|
dotnet_style_qualification_for_method = false:error
|
||||||
|
dotnet_style_qualification_for_property = false:error
|
||||||
|
dotnet_style_readonly_field = true:warning
|
||||||
|
dotnet_style_require_accessibility_modifiers = for_non_interface_members
|
||||||
|
end_of_line = crlf
|
||||||
|
file_header_template = unset
|
||||||
|
indent_size = 4
|
||||||
|
indent_style = space
|
||||||
|
insert_final_newline = false
|
||||||
|
root = true
|
||||||
|
tab_width = 4
|
||||||
|
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1822
|
||||||
|
# https://github.com/dotnet/aspnetcore/blob/main/.editorconfig
|
||||||
|
# https://github.com/dotnet/project-system/blob/main/.editorconfig
|
@ -3,21 +3,17 @@ using System.Collections.ObjectModel;
|
|||||||
|
|
||||||
namespace File_Folder_Helper.ADO2025.PI4;
|
namespace File_Folder_Helper.ADO2025.PI4;
|
||||||
|
|
||||||
internal static partial class Helper20250101
|
internal static partial class Helper20250101 {
|
||||||
{
|
|
||||||
|
|
||||||
private static ReadOnlyDictionary<string, List<FileInfo>> GetKeyValuePairs(string directory, string searchPattern, string split)
|
private static ReadOnlyDictionary<string, List<FileInfo>> GetKeyValuePairs(string directory, string searchPattern, string split) {
|
||||||
{
|
|
||||||
string key;
|
string key;
|
||||||
List<FileInfo>? collection;
|
List<FileInfo>? collection;
|
||||||
Dictionary<string, List<FileInfo>> results = [];
|
Dictionary<string, List<FileInfo>> results = [];
|
||||||
string[] files = Directory.GetFiles(directory, searchPattern, SearchOption.TopDirectoryOnly);
|
string[] files = Directory.GetFiles(directory, searchPattern, SearchOption.TopDirectoryOnly);
|
||||||
FileInfo[] fileInfoCollection = files.Select(l => new FileInfo(l)).ToArray();
|
FileInfo[] fileInfoCollection = files.Select(l => new FileInfo(l)).ToArray();
|
||||||
foreach (FileInfo fileInfo in fileInfoCollection.OrderBy(l => l.LastWriteTime))
|
foreach (FileInfo fileInfo in fileInfoCollection.OrderBy(l => l.LastWriteTime)) {
|
||||||
{
|
|
||||||
key = fileInfo.Name.Split(split)[0];
|
key = fileInfo.Name.Split(split)[0];
|
||||||
if (!results.TryGetValue(key, out collection))
|
if (!results.TryGetValue(key, out collection)) {
|
||||||
{
|
|
||||||
results.Add(key, []);
|
results.Add(key, []);
|
||||||
if (!results.TryGetValue(key, out collection))
|
if (!results.TryGetValue(key, out collection))
|
||||||
throw new Exception();
|
throw new Exception();
|
||||||
@ -27,16 +23,13 @@ internal static partial class Helper20250101
|
|||||||
return results.AsReadOnly();
|
return results.AsReadOnly();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void MoveToDelete(ILogger<Worker> logger, string appendage, ReadOnlyDictionary<string, List<FileInfo>> keyValuePairs)
|
private static void MoveToDelete(ILogger<Worker> logger, string appendage, ReadOnlyDictionary<string, List<FileInfo>> keyValuePairs) {
|
||||||
{
|
|
||||||
string checkFile;
|
string checkFile;
|
||||||
FileInfo fileInfo;
|
FileInfo fileInfo;
|
||||||
foreach (KeyValuePair<string, List<FileInfo>> keyValuePair in keyValuePairs)
|
foreach (KeyValuePair<string, List<FileInfo>> keyValuePair in keyValuePairs) {
|
||||||
{
|
|
||||||
if (keyValuePair.Value.Count < 3)
|
if (keyValuePair.Value.Count < 3)
|
||||||
continue;
|
continue;
|
||||||
for (int i = 1; i < keyValuePair.Value.Count - 1; i++)
|
for (int i = 1; i < keyValuePair.Value.Count - 1; i++) {
|
||||||
{
|
|
||||||
fileInfo = keyValuePair.Value[i];
|
fileInfo = keyValuePair.Value[i];
|
||||||
checkFile = Path.Combine($"{fileInfo.Directory}{appendage}", fileInfo.Name);
|
checkFile = Path.Combine($"{fileInfo.Directory}{appendage}", fileInfo.Name);
|
||||||
if (File.Exists(checkFile))
|
if (File.Exists(checkFile))
|
||||||
@ -47,8 +40,7 @@ internal static partial class Helper20250101
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void MoveToDelete(ILogger<Worker> logger, List<string> args)
|
internal static void MoveToDelete(ILogger<Worker> logger, List<string> args) {
|
||||||
{
|
|
||||||
string split = args[3];
|
string split = args[3];
|
||||||
string appendage = args[4];
|
string appendage = args[4];
|
||||||
string searchPattern = args[2];
|
string searchPattern = args[2];
|
||||||
|
@ -2,21 +2,17 @@ using Microsoft.Extensions.Logging;
|
|||||||
|
|
||||||
namespace File_Folder_Helper.ADO2025.PI4;
|
namespace File_Folder_Helper.ADO2025.PI4;
|
||||||
|
|
||||||
internal static partial class Helper20250114
|
internal static partial class Helper20250114 {
|
||||||
{
|
|
||||||
|
|
||||||
private static void Rename(string[] directories, string dateFormat)
|
private static void Rename(string[] directories, string dateFormat) {
|
||||||
{
|
|
||||||
string[] files;
|
string[] files;
|
||||||
DateTime dateTime;
|
DateTime dateTime;
|
||||||
FileInfo fileInfo;
|
FileInfo fileInfo;
|
||||||
string checkDirectory;
|
string checkDirectory;
|
||||||
foreach (string directory in directories)
|
foreach (string directory in directories) {
|
||||||
{
|
|
||||||
dateTime = DateTime.MinValue;
|
dateTime = DateTime.MinValue;
|
||||||
files = Directory.GetFiles(directory, "*", SearchOption.AllDirectories);
|
files = Directory.GetFiles(directory, "*", SearchOption.AllDirectories);
|
||||||
foreach (string file in files)
|
foreach (string file in files) {
|
||||||
{
|
|
||||||
fileInfo = new(file);
|
fileInfo = new(file);
|
||||||
if (dateTime > fileInfo.LastWriteTime)
|
if (dateTime > fileInfo.LastWriteTime)
|
||||||
continue;
|
continue;
|
||||||
@ -25,8 +21,7 @@ internal static partial class Helper20250114
|
|||||||
if (dateTime == DateTime.MinValue)
|
if (dateTime == DateTime.MinValue)
|
||||||
continue;
|
continue;
|
||||||
checkDirectory = Path.Combine(Path.GetDirectoryName(directory) ?? throw new Exception(), dateTime.ToString(dateFormat));
|
checkDirectory = Path.Combine(Path.GetDirectoryName(directory) ?? throw new Exception(), dateTime.ToString(dateFormat));
|
||||||
if (checkDirectory != directory)
|
if (checkDirectory != directory) {
|
||||||
{
|
|
||||||
if (Directory.Exists(checkDirectory))
|
if (Directory.Exists(checkDirectory))
|
||||||
continue;
|
continue;
|
||||||
Directory.Move(directory, checkDirectory);
|
Directory.Move(directory, checkDirectory);
|
||||||
@ -35,15 +30,13 @@ internal static partial class Helper20250114
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void Rename(ILogger<Worker> logger, string sourceDirectory, string searchPattern, string dateFormat)
|
private static void Rename(ILogger<Worker> logger, string sourceDirectory, string searchPattern, string dateFormat) {
|
||||||
{
|
|
||||||
string[] directories = Directory.GetDirectories(sourceDirectory, searchPattern);
|
string[] directories = Directory.GetDirectories(sourceDirectory, searchPattern);
|
||||||
logger.LogInformation("directories: {directories}", directories.Length);
|
logger.LogInformation("directories: {directories}", directories.Length);
|
||||||
Rename(directories, dateFormat);
|
Rename(directories, dateFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void Rename(ILogger<Worker> logger, List<string> args)
|
internal static void Rename(ILogger<Worker> logger, List<string> args) {
|
||||||
{
|
|
||||||
string dateFormat = args[3];
|
string dateFormat = args[3];
|
||||||
string[] searchPatterns = args[2].Split('~');
|
string[] searchPatterns = args[2].Split('~');
|
||||||
string sourceDirectory = Path.GetFullPath(args[0]);
|
string sourceDirectory = Path.GetFullPath(args[0]);
|
||||||
|
@ -4,11 +4,9 @@ using System.Globalization;
|
|||||||
|
|
||||||
namespace File_Folder_Helper.ADO2025.PI4;
|
namespace File_Folder_Helper.ADO2025.PI4;
|
||||||
|
|
||||||
internal static partial class Helper20250126
|
internal static partial class Helper20250126 {
|
||||||
{
|
|
||||||
|
|
||||||
private static void Move(string file, string fileName, string checkFile, List<string> foundLines, ReadOnlyCollection<DateTime> dateTimes)
|
private static void Move(string file, string fileName, string checkFile, List<string> foundLines, ReadOnlyCollection<DateTime> dateTimes) {
|
||||||
{
|
|
||||||
string checkDirectory = Path.Combine(Path.GetDirectoryName(file) ?? throw new Exception(), dateTimes[0].ToString("yyyy-MM"));
|
string checkDirectory = Path.Combine(Path.GetDirectoryName(file) ?? throw new Exception(), dateTimes[0].ToString("yyyy-MM"));
|
||||||
if (!Directory.Exists(checkDirectory))
|
if (!Directory.Exists(checkDirectory))
|
||||||
_ = Directory.CreateDirectory(checkDirectory);
|
_ = Directory.CreateDirectory(checkDirectory);
|
||||||
@ -24,12 +22,10 @@ internal static partial class Helper20250126
|
|||||||
File.WriteAllText(checkFileD, contents);
|
File.WriteAllText(checkFileD, contents);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void Move(ILogger<Worker> logger, string dateFormat, string file, string checkFile, string fileName, ReadOnlyCollection<string> statementPeriodSegments, List<string> foundLines)
|
private static void Move(ILogger<Worker> logger, string dateFormat, string file, string checkFile, string fileName, ReadOnlyCollection<string> statementPeriodSegments, List<string> foundLines) {
|
||||||
{
|
|
||||||
DateTime dateTime;
|
DateTime dateTime;
|
||||||
List<DateTime> dateTimes = [];
|
List<DateTime> dateTimes = [];
|
||||||
foreach (string check in statementPeriodSegments)
|
foreach (string check in statementPeriodSegments) {
|
||||||
{
|
|
||||||
if (!DateTime.TryParseExact(check, dateFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out dateTime))
|
if (!DateTime.TryParseExact(check, dateFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out dateTime))
|
||||||
continue;
|
continue;
|
||||||
dateTimes.Add(dateTime);
|
dateTimes.Add(dateTime);
|
||||||
@ -40,24 +36,18 @@ internal static partial class Helper20250126
|
|||||||
Move(file, fileName, checkFile, foundLines, dateTimes.AsReadOnly());
|
Move(file, fileName, checkFile, foundLines, dateTimes.AsReadOnly());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void Move(ILogger<Worker> logger, string file, string checkFile, string dateFormat, string statementPeriod, string search)
|
private static void Move(ILogger<Worker> logger, string file, string checkFile, string dateFormat, string statementPeriod, string search) {
|
||||||
{
|
|
||||||
List<string> foundLines = [];
|
List<string> foundLines = [];
|
||||||
bool statementPeriodFound = false;
|
bool statementPeriodFound = false;
|
||||||
string[]? statementPeriodSegments = null;
|
string[]? statementPeriodSegments = null;
|
||||||
string fileName = Path.GetFileName(file);
|
string fileName = Path.GetFileName(file);
|
||||||
string[] lines = File.ReadAllLines(file);
|
string[] lines = File.ReadAllLines(file);
|
||||||
foreach (string line in lines)
|
foreach (string line in lines) {
|
||||||
{
|
if (statementPeriodSegments is not null) {
|
||||||
if (statementPeriodSegments is not null)
|
|
||||||
{
|
|
||||||
if (line.Contains(search))
|
if (line.Contains(search))
|
||||||
foundLines.Add(line);
|
foundLines.Add(line);
|
||||||
}
|
} else {
|
||||||
else
|
if (statementPeriodFound) {
|
||||||
{
|
|
||||||
if (statementPeriodFound)
|
|
||||||
{
|
|
||||||
statementPeriodSegments = line.Split(' ');
|
statementPeriodSegments = line.Split(' ');
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -72,8 +62,7 @@ internal static partial class Helper20250126
|
|||||||
Move(logger, dateFormat, file, checkFile, fileName, statementPeriodSegments.AsReadOnly(), foundLines);
|
Move(logger, dateFormat, file, checkFile, fileName, statementPeriodSegments.AsReadOnly(), foundLines);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void Move(ILogger<Worker> logger, List<string> args)
|
internal static void Move(ILogger<Worker> logger, List<string> args) {
|
||||||
{
|
|
||||||
string checkFile;
|
string checkFile;
|
||||||
string search = args[5];
|
string search = args[5];
|
||||||
string dateFormat = args[3];
|
string dateFormat = args[3];
|
||||||
@ -81,8 +70,7 @@ internal static partial class Helper20250126
|
|||||||
string statementPeriod = args[4];
|
string statementPeriod = args[4];
|
||||||
string sourceDirectory = Path.GetFullPath(args[0]);
|
string sourceDirectory = Path.GetFullPath(args[0]);
|
||||||
string[] files = Directory.GetFiles(sourceDirectory, searchPatterns, SearchOption.AllDirectories);
|
string[] files = Directory.GetFiles(sourceDirectory, searchPatterns, SearchOption.AllDirectories);
|
||||||
foreach (string file in files)
|
foreach (string file in files) {
|
||||||
{
|
|
||||||
checkFile = Path.ChangeExtension(file, ".pdf");
|
checkFile = Path.ChangeExtension(file, ".pdf");
|
||||||
if (!File.Exists(checkFile))
|
if (!File.Exists(checkFile))
|
||||||
continue;
|
continue;
|
||||||
|
@ -8,8 +8,7 @@ using System.Text.RegularExpressions;
|
|||||||
|
|
||||||
namespace File_Folder_Helper.ADO2025.PI4;
|
namespace File_Folder_Helper.ADO2025.PI4;
|
||||||
|
|
||||||
internal static partial class Helper20250204
|
internal static partial class Helper20250204 {
|
||||||
{
|
|
||||||
|
|
||||||
[GeneratedRegex("([A-Z]+(.))")]
|
[GeneratedRegex("([A-Z]+(.))")]
|
||||||
private static partial Regex UpperCase();
|
private static partial Regex UpperCase();
|
||||||
@ -17,11 +16,9 @@ internal static partial class Helper20250204
|
|||||||
[GeneratedRegex("[\\s!?.,@:;|\\\\/\"'`£$%\\^&*{}[\\]()<>~#+\\-=_¬]+")]
|
[GeneratedRegex("[\\s!?.,@:;|\\\\/\"'`£$%\\^&*{}[\\]()<>~#+\\-=_¬]+")]
|
||||||
private static partial Regex InvalidCharacter();
|
private static partial Regex InvalidCharacter();
|
||||||
|
|
||||||
private record H1ParamCaseAndState(string H1, string ParamCase, string State)
|
private record H1ParamCaseAndState(string H1, string ParamCase, string State) {
|
||||||
{
|
|
||||||
|
|
||||||
private static string GetParamCase(string value)
|
private static string GetParamCase(string value) {
|
||||||
{
|
|
||||||
string result;
|
string result;
|
||||||
StringBuilder stringBuilder = new(value);
|
StringBuilder stringBuilder = new(value);
|
||||||
Match[] matches = UpperCase().Matches(value).ToArray();
|
Match[] matches = UpperCase().Matches(value).ToArray();
|
||||||
@ -33,16 +30,14 @@ internal static partial class Helper20250204
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static string GetState(string value) =>
|
private static string GetState(string value) =>
|
||||||
value switch
|
value switch {
|
||||||
{
|
|
||||||
"New" => "ToDo",
|
"New" => "ToDo",
|
||||||
"Active" => "In Progress",
|
"Active" => "In Progress",
|
||||||
"Closed" => "Done",
|
"Closed" => "Done",
|
||||||
_ => "Backlog",
|
_ => "Backlog",
|
||||||
};
|
};
|
||||||
|
|
||||||
internal static H1ParamCaseAndState Get(WorkItem workItem)
|
internal static H1ParamCaseAndState Get(WorkItem workItem) {
|
||||||
{
|
|
||||||
H1ParamCaseAndState result;
|
H1ParamCaseAndState result;
|
||||||
string paramCase = GetParamCase(workItem.Title);
|
string paramCase = GetParamCase(workItem.Title);
|
||||||
string state = GetState(workItem.State);
|
string state = GetState(workItem.State);
|
||||||
@ -91,8 +86,7 @@ internal static partial class Helper20250204
|
|||||||
string Title,
|
string Title,
|
||||||
string? Violation,
|
string? Violation,
|
||||||
long? WeightedShortestJobFirst,
|
long? WeightedShortestJobFirst,
|
||||||
string WorkItemType)
|
string WorkItemType) {
|
||||||
{
|
|
||||||
|
|
||||||
public override string ToString() => $"{Id} - {WorkItemType} - {Title}";
|
public override string ToString() => $"{Id} - {WorkItemType} - {Title}";
|
||||||
|
|
||||||
@ -100,14 +94,12 @@ internal static partial class Helper20250204
|
|||||||
|
|
||||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||||
[JsonSerializable(typeof(WorkItem))]
|
[JsonSerializable(typeof(WorkItem))]
|
||||||
private partial class WorkItemSourceGenerationContext : JsonSerializerContext
|
private partial class WorkItemSourceGenerationContext : JsonSerializerContext {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||||
[JsonSerializable(typeof(WorkItem[]))]
|
[JsonSerializable(typeof(WorkItem[]))]
|
||||||
private partial class WorkItemCollectionSourceGenerationContext : JsonSerializerContext
|
private partial class WorkItemCollectionSourceGenerationContext : JsonSerializerContext {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string[] GetTaskLines(string directory, string rootDirectory) =>
|
private static string[] GetTaskLines(string directory, string rootDirectory) =>
|
||||||
@ -156,13 +148,11 @@ internal static partial class Helper20250204
|
|||||||
private static string GetTaskText(string directory, string rootDirectory) =>
|
private static string GetTaskText(string directory, string rootDirectory) =>
|
||||||
string.Join(Environment.NewLine, GetTaskLines(directory, rootDirectory));
|
string.Join(Environment.NewLine, GetTaskLines(directory, rootDirectory));
|
||||||
|
|
||||||
private static void WriteTaskFile(string sourceDirectory, string rootDirectory)
|
private static void WriteTaskFile(string sourceDirectory, string rootDirectory) {
|
||||||
{
|
|
||||||
string tasksFile = Path.Combine(sourceDirectory, ".vscode", "tasks.json");
|
string tasksFile = Path.Combine(sourceDirectory, ".vscode", "tasks.json");
|
||||||
string oldText = File.ReadAllText(tasksFile);
|
string oldText = File.ReadAllText(tasksFile);
|
||||||
string jsonSafeDirectory = sourceDirectory.Replace('\\', '/');
|
string jsonSafeDirectory = sourceDirectory.Replace('\\', '/');
|
||||||
if (!oldText.Contains(jsonSafeDirectory))
|
if (!oldText.Contains(jsonSafeDirectory)) {
|
||||||
{
|
|
||||||
string text = GetTaskText(jsonSafeDirectory, rootDirectory);
|
string text = GetTaskText(jsonSafeDirectory, rootDirectory);
|
||||||
File.WriteAllText(tasksFile, text);
|
File.WriteAllText(tasksFile, text);
|
||||||
}
|
}
|
||||||
@ -202,13 +192,11 @@ internal static partial class Helper20250204
|
|||||||
private static string GetIndexText(WorkItem workItem, H1ParamCaseAndState h1ParamCaseAndState, ReadOnlyCollection<H1ParamCaseAndState> collection) =>
|
private static string GetIndexText(WorkItem workItem, H1ParamCaseAndState h1ParamCaseAndState, ReadOnlyCollection<H1ParamCaseAndState> collection) =>
|
||||||
string.Join(Environment.NewLine, GetIndexLines(workItem, h1ParamCaseAndState, collection));
|
string.Join(Environment.NewLine, GetIndexLines(workItem, h1ParamCaseAndState, collection));
|
||||||
|
|
||||||
private static string GetIndexMarkdown(FileInfo fileInfo, ReadOnlyCollection<WorkItem> workItems)
|
private static string GetIndexMarkdown(FileInfo fileInfo, ReadOnlyCollection<WorkItem> workItems) {
|
||||||
{
|
|
||||||
string result;
|
string result;
|
||||||
H1ParamCaseAndState h1ParamCaseAndState;
|
H1ParamCaseAndState h1ParamCaseAndState;
|
||||||
List<H1ParamCaseAndState> collection = [];
|
List<H1ParamCaseAndState> collection = [];
|
||||||
foreach (WorkItem w in workItems)
|
foreach (WorkItem w in workItems) {
|
||||||
{
|
|
||||||
h1ParamCaseAndState = H1ParamCaseAndState.Get(w);
|
h1ParamCaseAndState = H1ParamCaseAndState.Get(w);
|
||||||
collection.Add(h1ParamCaseAndState);
|
collection.Add(h1ParamCaseAndState);
|
||||||
}
|
}
|
||||||
@ -222,13 +210,11 @@ internal static partial class Helper20250204
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ReadOnlyCollection<WorkItem> GetWorkItems(string[] files)
|
private static ReadOnlyCollection<WorkItem> GetWorkItems(string[] files) {
|
||||||
{
|
|
||||||
List<WorkItem> results = [];
|
List<WorkItem> results = [];
|
||||||
string json;
|
string json;
|
||||||
WorkItem? workItem;
|
WorkItem? workItem;
|
||||||
foreach (string file in files)
|
foreach (string file in files) {
|
||||||
{
|
|
||||||
json = File.ReadAllText(file);
|
json = File.ReadAllText(file);
|
||||||
workItem = JsonSerializer.Deserialize(json, WorkItemSourceGenerationContext.Default.WorkItem);
|
workItem = JsonSerializer.Deserialize(json, WorkItemSourceGenerationContext.Default.WorkItem);
|
||||||
if (workItem is null)
|
if (workItem is null)
|
||||||
@ -238,8 +224,7 @@ internal static partial class Helper20250204
|
|||||||
return results.AsReadOnly();
|
return results.AsReadOnly();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ExtractKanban(string searchPattern, string rootDirectory, DirectoryInfo kanbanDirectory, FileInfo fileInfo)
|
private static void ExtractKanban(string searchPattern, string rootDirectory, DirectoryInfo kanbanDirectory, FileInfo fileInfo) {
|
||||||
{
|
|
||||||
string checkFile;
|
string checkFile;
|
||||||
string weekOfYear;
|
string weekOfYear;
|
||||||
string workItemDirectory;
|
string workItemDirectory;
|
||||||
@ -256,8 +241,7 @@ internal static partial class Helper20250204
|
|||||||
string markdownOld = File.Exists(indexFile) ? File.ReadAllText(indexFile) : string.Empty;
|
string markdownOld = File.Exists(indexFile) ? File.ReadAllText(indexFile) : string.Empty;
|
||||||
if (markdown != markdownOld)
|
if (markdown != markdownOld)
|
||||||
File.WriteAllText(indexFile, markdown);
|
File.WriteAllText(indexFile, markdown);
|
||||||
foreach (WorkItem workItem in workItems)
|
foreach (WorkItem workItem in workItems) {
|
||||||
{
|
|
||||||
h1ParamCaseAndState = H1ParamCaseAndState.Get(workItem);
|
h1ParamCaseAndState = H1ParamCaseAndState.Get(workItem);
|
||||||
checkFile = Path.Combine(tasksDirectory, $"{h1ParamCaseAndState.ParamCase}.md");
|
checkFile = Path.Combine(tasksDirectory, $"{h1ParamCaseAndState.ParamCase}.md");
|
||||||
markdownOld = File.Exists(checkFile) ? File.ReadAllText(checkFile) : string.Empty;
|
markdownOld = File.Exists(checkFile) ? File.ReadAllText(checkFile) : string.Empty;
|
||||||
@ -271,14 +255,12 @@ internal static partial class Helper20250204
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string GetSourceDirectory(string directory)
|
private static string GetSourceDirectory(string directory) {
|
||||||
{
|
|
||||||
string? result = null;
|
string? result = null;
|
||||||
DirectoryInfo directoryInfo;
|
DirectoryInfo directoryInfo;
|
||||||
string? checkDirectory = directory;
|
string? checkDirectory = directory;
|
||||||
string? pathRoot = Path.GetPathRoot(directory);
|
string? pathRoot = Path.GetPathRoot(directory);
|
||||||
for (int i = 0; i < int.MaxValue; i++)
|
for (int i = 0; i < int.MaxValue; i++) {
|
||||||
{
|
|
||||||
checkDirectory = Path.GetDirectoryName(checkDirectory);
|
checkDirectory = Path.GetDirectoryName(checkDirectory);
|
||||||
if (string.IsNullOrEmpty(checkDirectory) || checkDirectory == pathRoot)
|
if (string.IsNullOrEmpty(checkDirectory) || checkDirectory == pathRoot)
|
||||||
break;
|
break;
|
||||||
@ -292,8 +274,7 @@ internal static partial class Helper20250204
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void ExtractKanban(ILogger<Worker> logger, List<string> args)
|
internal static void ExtractKanban(ILogger<Worker> logger, List<string> args) {
|
||||||
{
|
|
||||||
string searchPattern = "*.json";
|
string searchPattern = "*.json";
|
||||||
string fullPath = Path.GetFullPath(args[0]);
|
string fullPath = Path.GetFullPath(args[0]);
|
||||||
string sourceDirectory = GetSourceDirectory(fullPath);
|
string sourceDirectory = GetSourceDirectory(fullPath);
|
||||||
|
@ -59,9 +59,6 @@ csharp_space_between_method_declaration_parameter_list_parentheses = false
|
|||||||
csharp_space_between_parentheses = false
|
csharp_space_between_parentheses = false
|
||||||
csharp_space_between_square_brackets = false
|
csharp_space_between_square_brackets = false
|
||||||
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true
|
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true
|
||||||
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true
|
|
||||||
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true
|
|
||||||
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = false
|
|
||||||
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true
|
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true
|
||||||
csharp_style_allow_embedded_statements_on_same_line_experimental = true
|
csharp_style_allow_embedded_statements_on_same_line_experimental = true
|
||||||
csharp_style_conditional_delegate_call = true
|
csharp_style_conditional_delegate_call = true
|
||||||
@ -113,7 +110,7 @@ dotnet_diagnostic.CA1051.severity = error # CA1051: Do not declare visible insta
|
|||||||
dotnet_diagnostic.CA1511.severity = warning # CA1511: Use 'ArgumentException.ThrowIfNullOrEmpty' instead of explicitly throwing a new exception instance
|
dotnet_diagnostic.CA1511.severity = warning # CA1511: Use 'ArgumentException.ThrowIfNullOrEmpty' instead of explicitly throwing a new exception instance
|
||||||
dotnet_diagnostic.CA1513.severity = warning # Use 'ObjectDisposedException.ThrowIf' instead of explicitly throwing a new exception instance
|
dotnet_diagnostic.CA1513.severity = warning # Use 'ObjectDisposedException.ThrowIf' instead of explicitly throwing a new exception instance
|
||||||
dotnet_diagnostic.CA1825.severity = warning # CA1825: Avoid zero-length array allocations
|
dotnet_diagnostic.CA1825.severity = warning # CA1825: Avoid zero-length array allocations
|
||||||
dotnet_diagnostic.CA1829.severity = error # CA1829: Use Length/Count property instead of Count() when available
|
dotnet_diagnostic.CA1829.severity = warning # CA1829: Use Length/Count property instead of Count() when available
|
||||||
dotnet_diagnostic.CA1834.severity = warning # CA1834: Consider using 'StringBuilder.Append(char)' when applicable
|
dotnet_diagnostic.CA1834.severity = warning # CA1834: Consider using 'StringBuilder.Append(char)' when applicable
|
||||||
dotnet_diagnostic.CA1860.severity = error # CA1860: Prefer comparing 'Count' to 0 rather than using 'Any()', both for clarity and for performance
|
dotnet_diagnostic.CA1860.severity = error # CA1860: Prefer comparing 'Count' to 0 rather than using 'Any()', both for clarity and for performance
|
||||||
dotnet_diagnostic.CA1862.severity = warning # CA1862: Prefer using 'string.Equals(string, StringComparison)' to perform a case-insensitive comparison, but keep in mind that this might cause subtle changes in behavior, so make sure to conduct thorough testing after applying the suggestion, or if culturally sensitive comparison is not required, consider using 'StringComparison.OrdinalIgnoreCase'
|
dotnet_diagnostic.CA1862.severity = warning # CA1862: Prefer using 'string.Equals(string, StringComparison)' to perform a case-insensitive comparison, but keep in mind that this might cause subtle changes in behavior, so make sure to conduct thorough testing after applying the suggestion, or if culturally sensitive comparison is not required, consider using 'StringComparison.OrdinalIgnoreCase'
|
||||||
@ -123,7 +120,7 @@ dotnet_diagnostic.CA2254.severity = none # CA2254: The logging message template
|
|||||||
dotnet_diagnostic.IDE0001.severity = warning # IDE0001: Simplify name
|
dotnet_diagnostic.IDE0001.severity = warning # IDE0001: Simplify name
|
||||||
dotnet_diagnostic.IDE0002.severity = warning # Simplify (member access) - System.Version.Equals("1", "2"); Version.Equals("1", "2");
|
dotnet_diagnostic.IDE0002.severity = warning # Simplify (member access) - System.Version.Equals("1", "2"); Version.Equals("1", "2");
|
||||||
dotnet_diagnostic.IDE0004.severity = warning # IDE0004: Cast is redundant.
|
dotnet_diagnostic.IDE0004.severity = warning # IDE0004: Cast is redundant.
|
||||||
dotnet_diagnostic.IDE0005.severity = error # Using directive is unnecessary
|
dotnet_diagnostic.IDE0005.severity = warning # Using directive is unnecessary
|
||||||
dotnet_diagnostic.IDE0010.severity = none # Add missing cases to switch statement (IDE0010)
|
dotnet_diagnostic.IDE0010.severity = none # Add missing cases to switch statement (IDE0010)
|
||||||
dotnet_diagnostic.IDE0028.severity = error # IDE0028: Collection initialization can be simplified
|
dotnet_diagnostic.IDE0028.severity = error # IDE0028: Collection initialization can be simplified
|
||||||
dotnet_diagnostic.IDE0031.severity = warning # Use null propagation (IDE0031)
|
dotnet_diagnostic.IDE0031.severity = warning # Use null propagation (IDE0031)
|
||||||
@ -131,7 +128,7 @@ dotnet_diagnostic.IDE0047.severity = warning # IDE0047: Parentheses can be remov
|
|||||||
dotnet_diagnostic.IDE0048.severity = none # Parentheses preferences (IDE0047 and IDE0048)
|
dotnet_diagnostic.IDE0048.severity = none # Parentheses preferences (IDE0047 and IDE0048)
|
||||||
dotnet_diagnostic.IDE0049.severity = warning # Use language keywords instead of framework type names for type references (IDE0049)
|
dotnet_diagnostic.IDE0049.severity = warning # Use language keywords instead of framework type names for type references (IDE0049)
|
||||||
dotnet_diagnostic.IDE0051.severity = error # Private member '' is unused [, ]
|
dotnet_diagnostic.IDE0051.severity = error # Private member '' is unused [, ]
|
||||||
dotnet_diagnostic.IDE0058.severity = error # IDE0058: Expression value is never used
|
dotnet_diagnostic.IDE0058.severity = warning # IDE0058: Expression value is never used
|
||||||
dotnet_diagnostic.IDE0060.severity = error # IDE0060: Remove unused parameter
|
dotnet_diagnostic.IDE0060.severity = error # IDE0060: Remove unused parameter
|
||||||
dotnet_diagnostic.IDE0074.severity = warning # IDE0074: Use compound assignment
|
dotnet_diagnostic.IDE0074.severity = warning # IDE0074: Use compound assignment
|
||||||
dotnet_diagnostic.IDE0130.severity = none # Namespace does not match folder structure (IDE0130)
|
dotnet_diagnostic.IDE0130.severity = none # Namespace does not match folder structure (IDE0130)
|
||||||
@ -140,7 +137,6 @@ dotnet_diagnostic.IDE0290.severity = none # Use primary constructor [Distance]cs
|
|||||||
dotnet_diagnostic.IDE0300.severity = error # IDE0300: Collection initialization can be simplified
|
dotnet_diagnostic.IDE0300.severity = error # IDE0300: Collection initialization can be simplified
|
||||||
dotnet_diagnostic.IDE0301.severity = error #IDE0301: Collection initialization can be simplified
|
dotnet_diagnostic.IDE0301.severity = error #IDE0301: Collection initialization can be simplified
|
||||||
dotnet_diagnostic.IDE0305.severity = none # IDE0305: Collection initialization can be simplified
|
dotnet_diagnostic.IDE0305.severity = none # IDE0305: Collection initialization can be simplified
|
||||||
dotnet_diagnostic.IDE2000.severity = error # IDE2000: Allow multiple blank lines
|
|
||||||
dotnet_naming_rule.abstract_method_should_be_pascal_case.severity = warning
|
dotnet_naming_rule.abstract_method_should_be_pascal_case.severity = warning
|
||||||
dotnet_naming_rule.abstract_method_should_be_pascal_case.style = pascal_case
|
dotnet_naming_rule.abstract_method_should_be_pascal_case.style = pascal_case
|
||||||
dotnet_naming_rule.abstract_method_should_be_pascal_case.symbols = abstract_method
|
dotnet_naming_rule.abstract_method_should_be_pascal_case.symbols = abstract_method
|
||||||
@ -256,8 +252,8 @@ dotnet_naming_symbols.types.applicable_accessibilities = public, internal, priva
|
|||||||
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
|
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
|
||||||
dotnet_naming_symbols.types.required_modifiers =
|
dotnet_naming_symbols.types.required_modifiers =
|
||||||
dotnet_remove_unnecessary_suppression_exclusions = 0
|
dotnet_remove_unnecessary_suppression_exclusions = 0
|
||||||
dotnet_separate_import_directive_groups = true
|
dotnet_separate_import_directive_groups = false
|
||||||
dotnet_sort_system_directives_first = true
|
dotnet_sort_system_directives_first = false
|
||||||
dotnet_style_allow_multiple_blank_lines_experimental = false:warning
|
dotnet_style_allow_multiple_blank_lines_experimental = false:warning
|
||||||
dotnet_style_allow_statement_immediately_after_block_experimental = true
|
dotnet_style_allow_statement_immediately_after_block_experimental = true
|
||||||
dotnet_style_coalesce_expression = true
|
dotnet_style_coalesce_expression = true
|
||||||
@ -298,84 +294,3 @@ tab_width = 4
|
|||||||
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1822
|
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1822
|
||||||
# https://github.com/dotnet/aspnetcore/blob/main/.editorconfig
|
# https://github.com/dotnet/aspnetcore/blob/main/.editorconfig
|
||||||
# https://github.com/dotnet/project-system/blob/main/.editorconfig
|
# https://github.com/dotnet/project-system/blob/main/.editorconfig
|
||||||
|
|
||||||
# Question
|
|
||||||
csharp_prefer_simple_using_statement = false # Question
|
|
||||||
csharp_style_expression_bodied_constructors = when_on_single_line:none # Question
|
|
||||||
csharp_style_expression_bodied_properties = true # Question
|
|
||||||
csharp_style_implicit_object_creation_when_type_is_apparent = true:warning # Question
|
|
||||||
csharp_style_pattern_matching_over_as_with_null_check = false # Question
|
|
||||||
csharp_style_prefer_pattern_matching = false # Question
|
|
||||||
csharp_style_prefer_range_operator = false # Question
|
|
||||||
csharp_style_prefer_switch_expression = false # Question
|
|
||||||
csharp_style_unused_value_assignment_preference = unused_local_variable # Question
|
|
||||||
csharp_style_unused_value_expression_statement_preference = false # Question
|
|
||||||
csharp_style_var_elsewhere = false:none # Question
|
|
||||||
csharp_style_var_for_built_in_types = false:none # Question
|
|
||||||
csharp_style_var_when_type_is_apparent = false:warning # Question
|
|
||||||
dotnet_diagnostic.CA1001.severity = none # Question - Types that own disposable fields should be disposable
|
|
||||||
dotnet_diagnostic.CA1051.severity = none # Question - Do not declare visible instance fields
|
|
||||||
dotnet_diagnostic.CA1416.severity = none # Question - This call site is reachable on all platforms.
|
|
||||||
dotnet_diagnostic.CA1510.severity = none # Question - Use
|
|
||||||
dotnet_diagnostic.CA1834.severity = none # CA1834: Consider using 'StringBuilder.Append(char)' when applicable
|
|
||||||
dotnet_diagnostic.CA1860.severity = none # Question - Avoid using
|
|
||||||
dotnet_diagnostic.CA1862.severity = none # Question - Prefer using
|
|
||||||
dotnet_diagnostic.CA2208.severity = none # Question - Instantiate argument exceptions correctly
|
|
||||||
dotnet_diagnostic.CA2211.severity = none # Question - Non-constant fields should not be visible
|
|
||||||
dotnet_diagnostic.CA2249.severity = none # Question - Use
|
|
||||||
dotnet_diagnostic.CA2253.severity = none # Question - Named placeholders should not be numeric values
|
|
||||||
dotnet_diagnostic.CS0103.severity = none # Question - The name
|
|
||||||
dotnet_diagnostic.CS0168.severity = none # Question - The variable
|
|
||||||
dotnet_diagnostic.CS0219.severity = none # Question - The variable
|
|
||||||
dotnet_diagnostic.CS0612.severity = none # Question - is obsolete
|
|
||||||
dotnet_diagnostic.CS0618.severity = none # Question - Compiler Warning (level 2)
|
|
||||||
dotnet_diagnostic.CS0659.severity = none # Question - Compiler Warning (level 3)
|
|
||||||
dotnet_diagnostic.CS8019.severity = warning # Question - Unnecessary using directive.
|
|
||||||
dotnet_diagnostic.CS8600.severity = none # Question - Converting null literal or possible null value to non-nullable type
|
|
||||||
dotnet_diagnostic.CS8602.severity = none # Question - Dereference of a possibly null reference.
|
|
||||||
dotnet_diagnostic.CS8603.severity = none # Question - Possible null reference return
|
|
||||||
dotnet_diagnostic.CS8604.severity = none # Question - Possible null reference argument for parameter.
|
|
||||||
dotnet_diagnostic.CS8618.severity = none # Question - Non-nullable variable must contain a non-null value when exiting constructor
|
|
||||||
dotnet_diagnostic.CS8625.severity = none # Question - Cannot convert null literal to non-nullable reference type.
|
|
||||||
dotnet_diagnostic.CS8629.severity = none # Question - Nullable value type may be null
|
|
||||||
dotnet_diagnostic.CS8765.severity = none # Question - Nullability of type of parameter
|
|
||||||
dotnet_diagnostic.IDE0005.severity = none # Question - Remove unnecessary using directives
|
|
||||||
dotnet_diagnostic.IDE0008.severity = warning # Question - Use explicit type instead of
|
|
||||||
dotnet_diagnostic.IDE0017.severity = none # Question - Object initialization can be simplified
|
|
||||||
dotnet_diagnostic.IDE0019.severity = none # Question - Use pattern matching
|
|
||||||
dotnet_diagnostic.IDE0021.severity = none # Question - Use expression body for constructor
|
|
||||||
dotnet_diagnostic.IDE0022.severity = none # Question - Use expression body for method
|
|
||||||
dotnet_diagnostic.IDE0025.severity = none # Question - Use expression body for property
|
|
||||||
dotnet_diagnostic.IDE0027.severity = none # Question - Use expression body for accessor
|
|
||||||
dotnet_diagnostic.IDE0028.severity = none # Question - Use collection initializers or expressions
|
|
||||||
dotnet_diagnostic.IDE0031.severity = none # Question - Null check can be simplified
|
|
||||||
dotnet_diagnostic.IDE0032.severity = none # Question - Use auto property
|
|
||||||
dotnet_diagnostic.IDE0037.severity = none # Question - Member name can be simplified
|
|
||||||
dotnet_diagnostic.IDE0041.severity = none # Question - Null check can be simplified
|
|
||||||
dotnet_diagnostic.IDE0047.severity = none # Question - Parentheses preferences
|
|
||||||
dotnet_diagnostic.IDE0049.severity = warning # Question - Name can be simplified
|
|
||||||
dotnet_diagnostic.IDE0051.severity = none # Question - Remove unused private member
|
|
||||||
dotnet_diagnostic.IDE0053.severity = none # Question - Use expression body for lambdas
|
|
||||||
dotnet_diagnostic.IDE0054.severity = none # Question - Use compound assignment
|
|
||||||
dotnet_diagnostic.IDE0055.severity = none # Question - Formatting rule
|
|
||||||
dotnet_diagnostic.IDE0057.severity = none # Question - Substring can be simplified
|
|
||||||
dotnet_diagnostic.IDE0058.severity = none # Question - Remove unnecessary expression value
|
|
||||||
dotnet_diagnostic.IDE0059.severity = none # Question - Unnecessary assignment of a value to
|
|
||||||
dotnet_diagnostic.IDE0060.severity = none # Question - Remove unused parameter
|
|
||||||
dotnet_diagnostic.IDE0063.severity = none # Question - Use simple
|
|
||||||
dotnet_diagnostic.IDE0065.severity = none # Question -
|
|
||||||
dotnet_diagnostic.IDE0066.severity = none # Question - Use
|
|
||||||
dotnet_diagnostic.IDE0078.severity = none # Question - Use pattern matching (may change code meaning)
|
|
||||||
dotnet_diagnostic.IDE0090.severity = warning # Question - Simplify new expression
|
|
||||||
dotnet_diagnostic.IDE0100.severity = error # Question - Remove redundant equality
|
|
||||||
dotnet_diagnostic.IDE0160.severity = warning # Question - Use block-scoped namespace
|
|
||||||
dotnet_diagnostic.IDE0161.severity = warning # Question - Namespace declaration preferences
|
|
||||||
dotnet_diagnostic.IDE0270.severity = none # Question - Null check can be simplified
|
|
||||||
dotnet_diagnostic.IDE0300.severity = none # Question - Collection initialization can be simplified
|
|
||||||
dotnet_diagnostic.IDE1006.severity = none # Question - Use collection expression for builder dotnet_style_prefer_collection_expression
|
|
||||||
dotnet_style_null_propagation = false # Question
|
|
||||||
dotnet_style_object_initializer = false # Question
|
|
||||||
dotnet_style_prefer_auto_properties = false # Question
|
|
||||||
dotnet_style_allow_statement_immediately_after_block_experimental = true # Question
|
|
||||||
dotnet_style_prefer_inferred_anonymous_type_member_names = false:warning # Question
|
|
||||||
dotnet_style_prefer_is_null_check_over_reference_equality_method = false # Question
|
|
@ -59,9 +59,6 @@ csharp_space_between_method_declaration_parameter_list_parentheses = false
|
|||||||
csharp_space_between_parentheses = false
|
csharp_space_between_parentheses = false
|
||||||
csharp_space_between_square_brackets = false
|
csharp_space_between_square_brackets = false
|
||||||
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true
|
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true
|
||||||
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true
|
|
||||||
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true
|
|
||||||
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = false
|
|
||||||
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true
|
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true
|
||||||
csharp_style_allow_embedded_statements_on_same_line_experimental = true
|
csharp_style_allow_embedded_statements_on_same_line_experimental = true
|
||||||
csharp_style_conditional_delegate_call = true
|
csharp_style_conditional_delegate_call = true
|
||||||
@ -113,7 +110,7 @@ dotnet_diagnostic.CA1051.severity = error # CA1051: Do not declare visible insta
|
|||||||
dotnet_diagnostic.CA1511.severity = warning # CA1511: Use 'ArgumentException.ThrowIfNullOrEmpty' instead of explicitly throwing a new exception instance
|
dotnet_diagnostic.CA1511.severity = warning # CA1511: Use 'ArgumentException.ThrowIfNullOrEmpty' instead of explicitly throwing a new exception instance
|
||||||
dotnet_diagnostic.CA1513.severity = warning # Use 'ObjectDisposedException.ThrowIf' instead of explicitly throwing a new exception instance
|
dotnet_diagnostic.CA1513.severity = warning # Use 'ObjectDisposedException.ThrowIf' instead of explicitly throwing a new exception instance
|
||||||
dotnet_diagnostic.CA1825.severity = warning # CA1825: Avoid zero-length array allocations
|
dotnet_diagnostic.CA1825.severity = warning # CA1825: Avoid zero-length array allocations
|
||||||
dotnet_diagnostic.CA1829.severity = error # CA1829: Use Length/Count property instead of Count() when available
|
dotnet_diagnostic.CA1829.severity = warning # CA1829: Use Length/Count property instead of Count() when available
|
||||||
dotnet_diagnostic.CA1834.severity = warning # CA1834: Consider using 'StringBuilder.Append(char)' when applicable
|
dotnet_diagnostic.CA1834.severity = warning # CA1834: Consider using 'StringBuilder.Append(char)' when applicable
|
||||||
dotnet_diagnostic.CA1860.severity = error # CA1860: Prefer comparing 'Count' to 0 rather than using 'Any()', both for clarity and for performance
|
dotnet_diagnostic.CA1860.severity = error # CA1860: Prefer comparing 'Count' to 0 rather than using 'Any()', both for clarity and for performance
|
||||||
dotnet_diagnostic.CA1862.severity = warning # CA1862: Prefer using 'string.Equals(string, StringComparison)' to perform a case-insensitive comparison, but keep in mind that this might cause subtle changes in behavior, so make sure to conduct thorough testing after applying the suggestion, or if culturally sensitive comparison is not required, consider using 'StringComparison.OrdinalIgnoreCase'
|
dotnet_diagnostic.CA1862.severity = warning # CA1862: Prefer using 'string.Equals(string, StringComparison)' to perform a case-insensitive comparison, but keep in mind that this might cause subtle changes in behavior, so make sure to conduct thorough testing after applying the suggestion, or if culturally sensitive comparison is not required, consider using 'StringComparison.OrdinalIgnoreCase'
|
||||||
@ -123,7 +120,7 @@ dotnet_diagnostic.CA2254.severity = none # CA2254: The logging message template
|
|||||||
dotnet_diagnostic.IDE0001.severity = warning # IDE0001: Simplify name
|
dotnet_diagnostic.IDE0001.severity = warning # IDE0001: Simplify name
|
||||||
dotnet_diagnostic.IDE0002.severity = warning # Simplify (member access) - System.Version.Equals("1", "2"); Version.Equals("1", "2");
|
dotnet_diagnostic.IDE0002.severity = warning # Simplify (member access) - System.Version.Equals("1", "2"); Version.Equals("1", "2");
|
||||||
dotnet_diagnostic.IDE0004.severity = warning # IDE0004: Cast is redundant.
|
dotnet_diagnostic.IDE0004.severity = warning # IDE0004: Cast is redundant.
|
||||||
dotnet_diagnostic.IDE0005.severity = error # Using directive is unnecessary
|
dotnet_diagnostic.IDE0005.severity = warning # Using directive is unnecessary
|
||||||
dotnet_diagnostic.IDE0010.severity = none # Add missing cases to switch statement (IDE0010)
|
dotnet_diagnostic.IDE0010.severity = none # Add missing cases to switch statement (IDE0010)
|
||||||
dotnet_diagnostic.IDE0028.severity = error # IDE0028: Collection initialization can be simplified
|
dotnet_diagnostic.IDE0028.severity = error # IDE0028: Collection initialization can be simplified
|
||||||
dotnet_diagnostic.IDE0031.severity = warning # Use null propagation (IDE0031)
|
dotnet_diagnostic.IDE0031.severity = warning # Use null propagation (IDE0031)
|
||||||
@ -131,7 +128,7 @@ dotnet_diagnostic.IDE0047.severity = warning # IDE0047: Parentheses can be remov
|
|||||||
dotnet_diagnostic.IDE0048.severity = none # Parentheses preferences (IDE0047 and IDE0048)
|
dotnet_diagnostic.IDE0048.severity = none # Parentheses preferences (IDE0047 and IDE0048)
|
||||||
dotnet_diagnostic.IDE0049.severity = warning # Use language keywords instead of framework type names for type references (IDE0049)
|
dotnet_diagnostic.IDE0049.severity = warning # Use language keywords instead of framework type names for type references (IDE0049)
|
||||||
dotnet_diagnostic.IDE0051.severity = error # Private member '' is unused [, ]
|
dotnet_diagnostic.IDE0051.severity = error # Private member '' is unused [, ]
|
||||||
dotnet_diagnostic.IDE0058.severity = error # IDE0058: Expression value is never used
|
dotnet_diagnostic.IDE0058.severity = warning # IDE0058: Expression value is never used
|
||||||
dotnet_diagnostic.IDE0060.severity = error # IDE0060: Remove unused parameter
|
dotnet_diagnostic.IDE0060.severity = error # IDE0060: Remove unused parameter
|
||||||
dotnet_diagnostic.IDE0074.severity = warning # IDE0074: Use compound assignment
|
dotnet_diagnostic.IDE0074.severity = warning # IDE0074: Use compound assignment
|
||||||
dotnet_diagnostic.IDE0130.severity = none # Namespace does not match folder structure (IDE0130)
|
dotnet_diagnostic.IDE0130.severity = none # Namespace does not match folder structure (IDE0130)
|
||||||
@ -140,7 +137,6 @@ dotnet_diagnostic.IDE0290.severity = none # Use primary constructor [Distance]cs
|
|||||||
dotnet_diagnostic.IDE0300.severity = error # IDE0300: Collection initialization can be simplified
|
dotnet_diagnostic.IDE0300.severity = error # IDE0300: Collection initialization can be simplified
|
||||||
dotnet_diagnostic.IDE0301.severity = error #IDE0301: Collection initialization can be simplified
|
dotnet_diagnostic.IDE0301.severity = error #IDE0301: Collection initialization can be simplified
|
||||||
dotnet_diagnostic.IDE0305.severity = none # IDE0305: Collection initialization can be simplified
|
dotnet_diagnostic.IDE0305.severity = none # IDE0305: Collection initialization can be simplified
|
||||||
dotnet_diagnostic.IDE2000.severity = error # IDE2000: Allow multiple blank lines
|
|
||||||
dotnet_naming_rule.abstract_method_should_be_pascal_case.severity = warning
|
dotnet_naming_rule.abstract_method_should_be_pascal_case.severity = warning
|
||||||
dotnet_naming_rule.abstract_method_should_be_pascal_case.style = pascal_case
|
dotnet_naming_rule.abstract_method_should_be_pascal_case.style = pascal_case
|
||||||
dotnet_naming_rule.abstract_method_should_be_pascal_case.symbols = abstract_method
|
dotnet_naming_rule.abstract_method_should_be_pascal_case.symbols = abstract_method
|
||||||
@ -256,8 +252,8 @@ dotnet_naming_symbols.types.applicable_accessibilities = public, internal, priva
|
|||||||
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
|
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
|
||||||
dotnet_naming_symbols.types.required_modifiers =
|
dotnet_naming_symbols.types.required_modifiers =
|
||||||
dotnet_remove_unnecessary_suppression_exclusions = 0
|
dotnet_remove_unnecessary_suppression_exclusions = 0
|
||||||
dotnet_separate_import_directive_groups = true
|
dotnet_separate_import_directive_groups = false
|
||||||
dotnet_sort_system_directives_first = true
|
dotnet_sort_system_directives_first = false
|
||||||
dotnet_style_allow_multiple_blank_lines_experimental = false:warning
|
dotnet_style_allow_multiple_blank_lines_experimental = false:warning
|
||||||
dotnet_style_allow_statement_immediately_after_block_experimental = true
|
dotnet_style_allow_statement_immediately_after_block_experimental = true
|
||||||
dotnet_style_coalesce_expression = true
|
dotnet_style_coalesce_expression = true
|
||||||
@ -298,84 +294,3 @@ tab_width = 4
|
|||||||
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1822
|
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1822
|
||||||
# https://github.com/dotnet/aspnetcore/blob/main/.editorconfig
|
# https://github.com/dotnet/aspnetcore/blob/main/.editorconfig
|
||||||
# https://github.com/dotnet/project-system/blob/main/.editorconfig
|
# https://github.com/dotnet/project-system/blob/main/.editorconfig
|
||||||
|
|
||||||
# Question
|
|
||||||
csharp_prefer_simple_using_statement = false # Question
|
|
||||||
csharp_style_expression_bodied_constructors = when_on_single_line:none # Question
|
|
||||||
csharp_style_expression_bodied_properties = true # Question
|
|
||||||
csharp_style_implicit_object_creation_when_type_is_apparent = true:warning # Question
|
|
||||||
csharp_style_pattern_matching_over_as_with_null_check = false # Question
|
|
||||||
csharp_style_prefer_pattern_matching = false # Question
|
|
||||||
csharp_style_prefer_range_operator = false # Question
|
|
||||||
csharp_style_prefer_switch_expression = false # Question
|
|
||||||
csharp_style_unused_value_assignment_preference = unused_local_variable # Question
|
|
||||||
csharp_style_unused_value_expression_statement_preference = false # Question
|
|
||||||
csharp_style_var_elsewhere = false:none # Question
|
|
||||||
csharp_style_var_for_built_in_types = false:none # Question
|
|
||||||
csharp_style_var_when_type_is_apparent = false:warning # Question
|
|
||||||
dotnet_diagnostic.CA1001.severity = none # Question - Types that own disposable fields should be disposable
|
|
||||||
dotnet_diagnostic.CA1051.severity = none # Question - Do not declare visible instance fields
|
|
||||||
dotnet_diagnostic.CA1416.severity = none # Question - This call site is reachable on all platforms.
|
|
||||||
dotnet_diagnostic.CA1510.severity = none # Question - Use
|
|
||||||
dotnet_diagnostic.CA1834.severity = none # CA1834: Consider using 'StringBuilder.Append(char)' when applicable
|
|
||||||
dotnet_diagnostic.CA1860.severity = none # Question - Avoid using
|
|
||||||
dotnet_diagnostic.CA1862.severity = none # Question - Prefer using
|
|
||||||
dotnet_diagnostic.CA2208.severity = none # Question - Instantiate argument exceptions correctly
|
|
||||||
dotnet_diagnostic.CA2211.severity = none # Question - Non-constant fields should not be visible
|
|
||||||
dotnet_diagnostic.CA2249.severity = none # Question - Use
|
|
||||||
dotnet_diagnostic.CA2253.severity = none # Question - Named placeholders should not be numeric values
|
|
||||||
dotnet_diagnostic.CS0103.severity = none # Question - The name
|
|
||||||
dotnet_diagnostic.CS0168.severity = warning # Question - The variable
|
|
||||||
dotnet_diagnostic.CS0219.severity = none # Question - The variable
|
|
||||||
dotnet_diagnostic.CS0612.severity = none # Question - is obsolete
|
|
||||||
dotnet_diagnostic.CS0618.severity = none # Question - Compiler Warning (level 2)
|
|
||||||
dotnet_diagnostic.CS0659.severity = none # Question - Compiler Warning (level 3)
|
|
||||||
dotnet_diagnostic.CS8019.severity = warning # Question - Unnecessary using directive.
|
|
||||||
dotnet_diagnostic.CS8600.severity = none # Question - Converting null literal or possible null value to non-nullable type
|
|
||||||
dotnet_diagnostic.CS8602.severity = none # Question - Dereference of a possibly null reference.
|
|
||||||
dotnet_diagnostic.CS8603.severity = none # Question - Possible null reference return
|
|
||||||
dotnet_diagnostic.CS8604.severity = none # Question - Possible null reference argument for parameter.
|
|
||||||
dotnet_diagnostic.CS8618.severity = none # Question - Non-nullable variable must contain a non-null value when exiting constructor
|
|
||||||
dotnet_diagnostic.CS8625.severity = none # Question - Cannot convert null literal to non-nullable reference type.
|
|
||||||
dotnet_diagnostic.CS8629.severity = warning # Question - Nullable value type may be null
|
|
||||||
dotnet_diagnostic.CS8765.severity = none # Question - Nullability of type of parameter
|
|
||||||
dotnet_diagnostic.IDE0005.severity = none # Question - Remove unnecessary using directives
|
|
||||||
dotnet_diagnostic.IDE0008.severity = warning # Question - Use explicit type instead of
|
|
||||||
dotnet_diagnostic.IDE0017.severity = none # Question - Object initialization can be simplified
|
|
||||||
dotnet_diagnostic.IDE0019.severity = none # Question - Use pattern matching
|
|
||||||
dotnet_diagnostic.IDE0021.severity = none # Question - Use expression body for constructor
|
|
||||||
dotnet_diagnostic.IDE0022.severity = none # Question - Use expression body for method
|
|
||||||
dotnet_diagnostic.IDE0025.severity = none # Question - Use expression body for property
|
|
||||||
dotnet_diagnostic.IDE0027.severity = none # Question - Use expression body for accessor
|
|
||||||
dotnet_diagnostic.IDE0028.severity = none # Question - Use collection initializers or expressions
|
|
||||||
dotnet_diagnostic.IDE0031.severity = none # Question - Null check can be simplified
|
|
||||||
dotnet_diagnostic.IDE0032.severity = none # Question - Use auto property
|
|
||||||
dotnet_diagnostic.IDE0037.severity = none # Question - Member name can be simplified
|
|
||||||
dotnet_diagnostic.IDE0041.severity = none # Question - Null check can be simplified
|
|
||||||
dotnet_diagnostic.IDE0047.severity = none # Question - Parentheses preferences
|
|
||||||
dotnet_diagnostic.IDE0049.severity = warning # Question - Name can be simplified
|
|
||||||
dotnet_diagnostic.IDE0051.severity = none # Question - Remove unused private member
|
|
||||||
dotnet_diagnostic.IDE0053.severity = none # Question - Use expression body for lambdas
|
|
||||||
dotnet_diagnostic.IDE0054.severity = none # Question - Use compound assignment
|
|
||||||
dotnet_diagnostic.IDE0055.severity = none # Question - Formatting rule
|
|
||||||
dotnet_diagnostic.IDE0057.severity = none # Question - Substring can be simplified
|
|
||||||
dotnet_diagnostic.IDE0058.severity = none # Question - Remove unnecessary expression value
|
|
||||||
dotnet_diagnostic.IDE0059.severity = none # Question - Unnecessary assignment of a value to
|
|
||||||
dotnet_diagnostic.IDE0060.severity = warning # Question - Remove unused parameter
|
|
||||||
dotnet_diagnostic.IDE0063.severity = none # Question - Use simple
|
|
||||||
dotnet_diagnostic.IDE0065.severity = none # Question -
|
|
||||||
dotnet_diagnostic.IDE0066.severity = none # Question - Use
|
|
||||||
dotnet_diagnostic.IDE0078.severity = none # Question - Use pattern matching (may change code meaning)
|
|
||||||
dotnet_diagnostic.IDE0090.severity = warning # Question - Simplify new expression
|
|
||||||
dotnet_diagnostic.IDE0100.severity = error # Question - Remove redundant equality
|
|
||||||
dotnet_diagnostic.IDE0160.severity = warning # Question - Use block-scoped namespace
|
|
||||||
dotnet_diagnostic.IDE0161.severity = warning # Question - Namespace declaration preferences
|
|
||||||
dotnet_diagnostic.IDE0270.severity = none # Question - Null check can be simplified
|
|
||||||
dotnet_diagnostic.IDE0300.severity = none # Question - Collection initialization can be simplified
|
|
||||||
dotnet_diagnostic.IDE1006.severity = none # Question - Use collection expression for builder dotnet_style_prefer_collection_expression
|
|
||||||
dotnet_style_null_propagation = false # Question
|
|
||||||
dotnet_style_object_initializer = false # Question
|
|
||||||
dotnet_style_prefer_auto_properties = false # Question
|
|
||||||
dotnet_style_allow_statement_immediately_after_block_experimental = true # Question
|
|
||||||
dotnet_style_prefer_inferred_anonymous_type_member_names = false:warning # Question
|
|
||||||
dotnet_style_prefer_is_null_check_over_reference_equality_method = false # Question
|
|
@ -11,25 +11,22 @@ namespace IFX.Shared.PasteSpecialXml.EAF.XML.API.Envelope;
|
|||||||
[System.ComponentModel.DesignerCategory("code")]
|
[System.ComponentModel.DesignerCategory("code")]
|
||||||
[System.Xml.Serialization.XmlType(AnonymousType = true, Namespace = "http://www.w3.org/2003/05/soap-envelope")]
|
[System.Xml.Serialization.XmlType(AnonymousType = true, Namespace = "http://www.w3.org/2003/05/soap-envelope")]
|
||||||
[System.Xml.Serialization.XmlRoot(Namespace = "http://www.w3.org/2003/05/soap-envelope", IsNullable = false)]
|
[System.Xml.Serialization.XmlRoot(Namespace = "http://www.w3.org/2003/05/soap-envelope", IsNullable = false)]
|
||||||
public partial class Envelope
|
public partial class Envelope {
|
||||||
{
|
|
||||||
|
|
||||||
private EnvelopeHeader? headerField;
|
private EnvelopeHeader? headerField;
|
||||||
|
|
||||||
private EnvelopeBody? bodyField;
|
private EnvelopeBody? bodyField;
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public EnvelopeHeader Header
|
public EnvelopeHeader Header {
|
||||||
{
|
get => headerField;
|
||||||
get => this.headerField;
|
set => headerField = value;
|
||||||
set => this.headerField = value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public EnvelopeBody Body
|
public EnvelopeBody Body {
|
||||||
{
|
get => bodyField;
|
||||||
get => this.bodyField;
|
set => bodyField = value;
|
||||||
set => this.bodyField = value;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,8 +34,7 @@ public partial class Envelope
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
[System.ComponentModel.DesignerCategory("code")]
|
[System.ComponentModel.DesignerCategory("code")]
|
||||||
[System.Xml.Serialization.XmlType(AnonymousType = true, Namespace = "http://www.w3.org/2003/05/soap-envelope")]
|
[System.Xml.Serialization.XmlType(AnonymousType = true, Namespace = "http://www.w3.org/2003/05/soap-envelope")]
|
||||||
public partial class EnvelopeHeader
|
public partial class EnvelopeHeader {
|
||||||
{
|
|
||||||
|
|
||||||
private Sequence? sequenceField;
|
private Sequence? sequenceField;
|
||||||
private SequenceAcknowledgement? sequenceAcknowledgementField;
|
private SequenceAcknowledgement? sequenceAcknowledgementField;
|
||||||
@ -47,33 +43,29 @@ public partial class EnvelopeHeader
|
|||||||
private string? relatesToField;
|
private string? relatesToField;
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[System.Xml.Serialization.XmlElement(Namespace = "http://schemas.xmlsoap.org/ws/2005/02/rm")]
|
[System.Xml.Serialization.XmlElement(Namespace = "http://schemas.xmlsoap.org/ws/2005/02/rm")]
|
||||||
public Sequence Sequence
|
public Sequence Sequence {
|
||||||
{
|
get => sequenceField;
|
||||||
get => this.sequenceField;
|
set => sequenceField = value;
|
||||||
set => this.sequenceField = value;
|
|
||||||
}
|
}
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[System.Xml.Serialization.XmlElement(Namespace = "http://schemas.xmlsoap.org/ws/2005/02/rm")]
|
[System.Xml.Serialization.XmlElement(Namespace = "http://schemas.xmlsoap.org/ws/2005/02/rm")]
|
||||||
public SequenceAcknowledgement SequenceAcknowledgement
|
public SequenceAcknowledgement SequenceAcknowledgement {
|
||||||
{
|
get => sequenceAcknowledgementField;
|
||||||
get => this.sequenceAcknowledgementField;
|
set => sequenceAcknowledgementField = value;
|
||||||
set => this.sequenceAcknowledgementField = value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[System.Xml.Serialization.XmlElement(Namespace = "http://www.w3.org/2005/08/addressing")]
|
[System.Xml.Serialization.XmlElement(Namespace = "http://www.w3.org/2005/08/addressing")]
|
||||||
public Action Action
|
public Action Action {
|
||||||
{
|
get => actionField;
|
||||||
get => this.actionField;
|
set => actionField = value;
|
||||||
set => this.actionField = value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[System.Xml.Serialization.XmlElement(Namespace = "http://www.w3.org/2005/08/addressing")]
|
[System.Xml.Serialization.XmlElement(Namespace = "http://www.w3.org/2005/08/addressing")]
|
||||||
public string RelatesTo
|
public string RelatesTo {
|
||||||
{
|
get => relatesToField;
|
||||||
get => this.relatesToField;
|
set => relatesToField = value;
|
||||||
set => this.relatesToField = value;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
@ -81,36 +73,31 @@ public partial class EnvelopeHeader
|
|||||||
[System.ComponentModel.DesignerCategory("code")]
|
[System.ComponentModel.DesignerCategory("code")]
|
||||||
[System.Xml.Serialization.XmlType(AnonymousType = true, Namespace = "http://schemas.xmlsoap.org/ws/2005/02/rm")]
|
[System.Xml.Serialization.XmlType(AnonymousType = true, Namespace = "http://schemas.xmlsoap.org/ws/2005/02/rm")]
|
||||||
[System.Xml.Serialization.XmlRoot(Namespace = "http://schemas.xmlsoap.org/ws/2005/02/rm", IsNullable = false)]
|
[System.Xml.Serialization.XmlRoot(Namespace = "http://schemas.xmlsoap.org/ws/2005/02/rm", IsNullable = false)]
|
||||||
public partial class Sequence
|
public partial class Sequence {
|
||||||
{
|
|
||||||
private string? identifierField;
|
private string? identifierField;
|
||||||
private byte messageNumberField;
|
private byte messageNumberField;
|
||||||
private object? lastMessageField;
|
private object? lastMessageField;
|
||||||
private byte mustUnderstandField;
|
private byte mustUnderstandField;
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public string Identifier
|
public string Identifier {
|
||||||
{
|
get => identifierField;
|
||||||
get => this.identifierField;
|
set => identifierField = value;
|
||||||
set => this.identifierField = value;
|
|
||||||
}
|
}
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public byte MessageNumber
|
public byte MessageNumber {
|
||||||
{
|
get => messageNumberField;
|
||||||
get => this.messageNumberField;
|
set => messageNumberField = value;
|
||||||
set => this.messageNumberField = value;
|
|
||||||
}
|
}
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public object LastMessage
|
public object LastMessage {
|
||||||
{
|
get => lastMessageField;
|
||||||
get => this.lastMessageField;
|
set => lastMessageField = value;
|
||||||
set => this.lastMessageField = value;
|
|
||||||
}
|
}
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[System.Xml.Serialization.XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified, Namespace = "http://www.w3.org/2003/05/soap-envelope")]
|
[System.Xml.Serialization.XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified, Namespace = "http://www.w3.org/2003/05/soap-envelope")]
|
||||||
public byte mustUnderstand
|
public byte mustUnderstand {
|
||||||
{
|
get => mustUnderstandField;
|
||||||
get => this.mustUnderstandField;
|
set => mustUnderstandField = value;
|
||||||
set => this.mustUnderstandField = value;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
@ -118,52 +105,45 @@ public partial class Sequence
|
|||||||
[System.ComponentModel.DesignerCategory("code")]
|
[System.ComponentModel.DesignerCategory("code")]
|
||||||
[System.Xml.Serialization.XmlType(AnonymousType = true, Namespace = "http://schemas.xmlsoap.org/ws/2005/02/rm")]
|
[System.Xml.Serialization.XmlType(AnonymousType = true, Namespace = "http://schemas.xmlsoap.org/ws/2005/02/rm")]
|
||||||
[System.Xml.Serialization.XmlRoot(Namespace = "http://schemas.xmlsoap.org/ws/2005/02/rm", IsNullable = false)]
|
[System.Xml.Serialization.XmlRoot(Namespace = "http://schemas.xmlsoap.org/ws/2005/02/rm", IsNullable = false)]
|
||||||
public partial class SequenceAcknowledgement
|
public partial class SequenceAcknowledgement {
|
||||||
{
|
|
||||||
private string? identifierField;
|
private string? identifierField;
|
||||||
private SequenceAcknowledgementAcknowledgementRange? acknowledgementRangeField;
|
private SequenceAcknowledgementAcknowledgementRange? acknowledgementRangeField;
|
||||||
private byte bufferRemainingField;
|
private byte bufferRemainingField;
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public string Identifier
|
public string Identifier {
|
||||||
{
|
get => identifierField;
|
||||||
get => this.identifierField;
|
set => identifierField = value;
|
||||||
set => this.identifierField = value;
|
|
||||||
}
|
}
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public SequenceAcknowledgementAcknowledgementRange AcknowledgementRange
|
public SequenceAcknowledgementAcknowledgementRange AcknowledgementRange {
|
||||||
{
|
get => acknowledgementRangeField;
|
||||||
get => this.acknowledgementRangeField;
|
set => acknowledgementRangeField = value;
|
||||||
set => this.acknowledgementRangeField = value;
|
|
||||||
}
|
}
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[System.Xml.Serialization.XmlElement(Namespace = "http://schemas.microsoft.com/ws/2006/05/rm")]
|
[System.Xml.Serialization.XmlElement(Namespace = "http://schemas.microsoft.com/ws/2006/05/rm")]
|
||||||
public byte BufferRemaining
|
public byte BufferRemaining {
|
||||||
{
|
get => bufferRemainingField;
|
||||||
get => this.bufferRemainingField;
|
set => bufferRemainingField = value;
|
||||||
set => this.bufferRemainingField = value;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[Serializable()]
|
[Serializable()]
|
||||||
[System.ComponentModel.DesignerCategory("code")]
|
[System.ComponentModel.DesignerCategory("code")]
|
||||||
[System.Xml.Serialization.XmlType(AnonymousType = true, Namespace = "http://schemas.xmlsoap.org/ws/2005/02/rm")]
|
[System.Xml.Serialization.XmlType(AnonymousType = true, Namespace = "http://schemas.xmlsoap.org/ws/2005/02/rm")]
|
||||||
public partial class SequenceAcknowledgementAcknowledgementRange
|
public partial class SequenceAcknowledgementAcknowledgementRange {
|
||||||
{
|
|
||||||
private byte lowerField;
|
private byte lowerField;
|
||||||
private byte upperField;
|
private byte upperField;
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[System.Xml.Serialization.XmlAttribute()]
|
[System.Xml.Serialization.XmlAttribute()]
|
||||||
public byte Lower
|
public byte Lower {
|
||||||
{
|
get => lowerField;
|
||||||
get => this.lowerField;
|
set => lowerField = value;
|
||||||
set => this.lowerField = value;
|
|
||||||
}
|
}
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[System.Xml.Serialization.XmlAttribute()]
|
[System.Xml.Serialization.XmlAttribute()]
|
||||||
public byte Upper
|
public byte Upper {
|
||||||
{
|
get => upperField;
|
||||||
get => this.upperField;
|
set => upperField = value;
|
||||||
set => this.upperField = value;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,8 +152,7 @@ public partial class SequenceAcknowledgementAcknowledgementRange
|
|||||||
[System.ComponentModel.DesignerCategory("code")]
|
[System.ComponentModel.DesignerCategory("code")]
|
||||||
[System.Xml.Serialization.XmlType(AnonymousType = true, Namespace = "http://www.w3.org/2005/08/addressing")]
|
[System.Xml.Serialization.XmlType(AnonymousType = true, Namespace = "http://www.w3.org/2005/08/addressing")]
|
||||||
[System.Xml.Serialization.XmlRoot(Namespace = "http://www.w3.org/2005/08/addressing", IsNullable = false)]
|
[System.Xml.Serialization.XmlRoot(Namespace = "http://www.w3.org/2005/08/addressing", IsNullable = false)]
|
||||||
public partial class Action
|
public partial class Action {
|
||||||
{
|
|
||||||
|
|
||||||
private byte mustUnderstandField;
|
private byte mustUnderstandField;
|
||||||
|
|
||||||
@ -181,18 +160,16 @@ public partial class Action
|
|||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[System.Xml.Serialization.XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified, Namespace = "http://www.w3.org/2003/05/soap-envelope")]
|
[System.Xml.Serialization.XmlAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified, Namespace = "http://www.w3.org/2003/05/soap-envelope")]
|
||||||
public byte mustUnderstand
|
public byte mustUnderstand {
|
||||||
{
|
get => mustUnderstandField;
|
||||||
get => this.mustUnderstandField;
|
set => mustUnderstandField = value;
|
||||||
set => this.mustUnderstandField = value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[System.Xml.Serialization.XmlText()]
|
[System.Xml.Serialization.XmlText()]
|
||||||
public string Value
|
public string Value {
|
||||||
{
|
get => valueField;
|
||||||
get => this.valueField;
|
set => valueField = value;
|
||||||
set => this.valueField = value;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -200,17 +177,15 @@ public partial class Action
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
[System.ComponentModel.DesignerCategory("code")]
|
[System.ComponentModel.DesignerCategory("code")]
|
||||||
[System.Xml.Serialization.XmlType(AnonymousType = true, Namespace = "http://www.w3.org/2003/05/soap-envelope")]
|
[System.Xml.Serialization.XmlType(AnonymousType = true, Namespace = "http://www.w3.org/2003/05/soap-envelope")]
|
||||||
public partial class EnvelopeBody
|
public partial class EnvelopeBody {
|
||||||
{
|
|
||||||
|
|
||||||
private CreateSequenceResponse? createSequenceResponseField;
|
private CreateSequenceResponse? createSequenceResponseField;
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[System.Xml.Serialization.XmlElement(Namespace = "http://schemas.xmlsoap.org/ws/2005/02/rm")]
|
[System.Xml.Serialization.XmlElement(Namespace = "http://schemas.xmlsoap.org/ws/2005/02/rm")]
|
||||||
public CreateSequenceResponse CreateSequenceResponse
|
public CreateSequenceResponse CreateSequenceResponse {
|
||||||
{
|
get => createSequenceResponseField;
|
||||||
get => this.createSequenceResponseField;
|
set => createSequenceResponseField = value;
|
||||||
set => this.createSequenceResponseField = value;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -219,25 +194,22 @@ public partial class EnvelopeBody
|
|||||||
[System.ComponentModel.DesignerCategory("code")]
|
[System.ComponentModel.DesignerCategory("code")]
|
||||||
[System.Xml.Serialization.XmlType(AnonymousType = true, Namespace = "http://schemas.xmlsoap.org/ws/2005/02/rm")]
|
[System.Xml.Serialization.XmlType(AnonymousType = true, Namespace = "http://schemas.xmlsoap.org/ws/2005/02/rm")]
|
||||||
[System.Xml.Serialization.XmlRoot(Namespace = "http://schemas.xmlsoap.org/ws/2005/02/rm", IsNullable = false)]
|
[System.Xml.Serialization.XmlRoot(Namespace = "http://schemas.xmlsoap.org/ws/2005/02/rm", IsNullable = false)]
|
||||||
public partial class CreateSequenceResponse
|
public partial class CreateSequenceResponse {
|
||||||
{
|
|
||||||
|
|
||||||
private string? identifierField;
|
private string? identifierField;
|
||||||
|
|
||||||
private CreateSequenceResponseAccept? acceptField;
|
private CreateSequenceResponseAccept? acceptField;
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public string Identifier
|
public string Identifier {
|
||||||
{
|
get => identifierField;
|
||||||
get => this.identifierField;
|
set => identifierField = value;
|
||||||
set => this.identifierField = value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public CreateSequenceResponseAccept Accept
|
public CreateSequenceResponseAccept Accept {
|
||||||
{
|
get => acceptField;
|
||||||
get => this.acceptField;
|
set => acceptField = value;
|
||||||
set => this.acceptField = value;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -245,16 +217,14 @@ public partial class CreateSequenceResponse
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
[System.ComponentModel.DesignerCategory("code")]
|
[System.ComponentModel.DesignerCategory("code")]
|
||||||
[System.Xml.Serialization.XmlType(AnonymousType = true, Namespace = "http://schemas.xmlsoap.org/ws/2005/02/rm")]
|
[System.Xml.Serialization.XmlType(AnonymousType = true, Namespace = "http://schemas.xmlsoap.org/ws/2005/02/rm")]
|
||||||
public partial class CreateSequenceResponseAccept
|
public partial class CreateSequenceResponseAccept {
|
||||||
{
|
|
||||||
|
|
||||||
private CreateSequenceResponseAcceptAcksTo? acksToField;
|
private CreateSequenceResponseAcceptAcksTo? acksToField;
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public CreateSequenceResponseAcceptAcksTo AcksTo
|
public CreateSequenceResponseAcceptAcksTo AcksTo {
|
||||||
{
|
get => acksToField;
|
||||||
get => this.acksToField;
|
set => acksToField = value;
|
||||||
set => this.acksToField = value;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -262,16 +232,14 @@ public partial class CreateSequenceResponseAccept
|
|||||||
[Serializable()]
|
[Serializable()]
|
||||||
[System.ComponentModel.DesignerCategory("code")]
|
[System.ComponentModel.DesignerCategory("code")]
|
||||||
[System.Xml.Serialization.XmlType(AnonymousType = true, Namespace = "http://schemas.xmlsoap.org/ws/2005/02/rm")]
|
[System.Xml.Serialization.XmlType(AnonymousType = true, Namespace = "http://schemas.xmlsoap.org/ws/2005/02/rm")]
|
||||||
public partial class CreateSequenceResponseAcceptAcksTo
|
public partial class CreateSequenceResponseAcceptAcksTo {
|
||||||
{
|
|
||||||
|
|
||||||
private string? addressField;
|
private string? addressField;
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[System.Xml.Serialization.XmlElement(Namespace = "http://www.w3.org/2005/08/addressing")]
|
[System.Xml.Serialization.XmlElement(Namespace = "http://www.w3.org/2005/08/addressing")]
|
||||||
public string Address
|
public string Address {
|
||||||
{
|
get => addressField;
|
||||||
get => this.addressField;
|
set => addressField = value;
|
||||||
set => this.addressField = value;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,12 +1,11 @@
|
|||||||
|
using Microsoft.Extensions.FileSystemGlobbing;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
|
|
||||||
using Microsoft.Extensions.FileSystemGlobbing;
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
|
|
||||||
namespace File_Folder_Helper.ADO2025.PI6;
|
namespace File_Folder_Helper.ADO2025.PI6;
|
||||||
|
|
||||||
internal static partial class Helper20250519 {
|
internal static partial class Helper20250519 {
|
||||||
@ -288,8 +287,9 @@ internal static partial class Helper20250519 {
|
|||||||
if (!baseAddress.StartsWith("http:")) {
|
if (!baseAddress.StartsWith("http:")) {
|
||||||
logger.LogInformation("Not supported URL <{url}>", baseAddress);
|
logger.LogInformation("Not supported URL <{url}>", baseAddress);
|
||||||
} else {
|
} else {
|
||||||
HttpClient httpClient = new();
|
HttpClient httpClient = new() {
|
||||||
httpClient.BaseAddress = new(baseAddress);
|
BaseAddress = new(baseAddress)
|
||||||
|
};
|
||||||
StringContent stringContent = new(json, Encoding.UTF8, "application/json");
|
StringContent stringContent = new(json, Encoding.UTF8, "application/json");
|
||||||
httpResponseMessage = httpClient.PostAsync(page, stringContent);
|
httpResponseMessage = httpClient.PostAsync(page, stringContent);
|
||||||
httpResponseMessage.Wait();
|
httpResponseMessage.Wait();
|
||||||
@ -342,7 +342,7 @@ internal static partial class Helper20250519 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void LiveSync(ILogger<Worker> logger, string page, RelativePath relativePath, HttpClient httpClient, string directory, ReadOnlyCollection<Record> records, HttpMethod? httpMethod, bool delete) {
|
private static void LiveSync(ILogger<Worker> logger, string page, RelativePath relativePath, HttpClient httpClient, string? directory, ReadOnlyCollection<Record> records, HttpMethod? httpMethod, bool delete) {
|
||||||
long sum;
|
long sum;
|
||||||
try { sum = records.Sum(l => l.Size); } catch (Exception) { sum = 0; }
|
try { sum = records.Sum(l => l.Size); } catch (Exception) { sum = 0; }
|
||||||
string size = GetSizeWithSuffix(sum);
|
string size = GetSizeWithSuffix(sum);
|
||||||
@ -374,7 +374,7 @@ internal static partial class Helper20250519 {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void PreformDeletes(ILogger<Worker> logger, string directory, ReadOnlyCollection<Record> records) {
|
private static void PreformDeletes(ILogger<Worker> logger, string? directory, ReadOnlyCollection<Record> records) {
|
||||||
string size;
|
string size;
|
||||||
Record? record;
|
Record? record;
|
||||||
string count = records.Count.ToString("000000");
|
string count = records.Count.ToString("000000");
|
||||||
@ -386,7 +386,7 @@ internal static partial class Helper20250519 {
|
|||||||
progressBar.Tick();
|
progressBar.Tick();
|
||||||
#endif
|
#endif
|
||||||
record = records[i];
|
record = records[i];
|
||||||
if (record is null) {
|
if (record is null || string.IsNullOrEmpty(directory)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
size = GetSizeWithSuffix(record.Size);
|
size = GetSizeWithSuffix(record.Size);
|
||||||
@ -402,7 +402,7 @@ internal static partial class Helper20250519 {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void Preform(ILogger<Worker> logger, string page, string directory, ReadOnlyCollection<Record> records, HttpClient httpClient, HttpMethod httpMethod) {
|
private static void Preform(ILogger<Worker> logger, string page, string? directory, ReadOnlyCollection<Record> records, HttpClient httpClient, HttpMethod httpMethod) {
|
||||||
Verb verb;
|
Verb verb;
|
||||||
long ticks;
|
long ticks;
|
||||||
string size;
|
string size;
|
||||||
@ -430,9 +430,10 @@ internal static partial class Helper20250519 {
|
|||||||
httpRequestMessage = new(httpMethod, $"{page}size={verb.Size}&ticks={verb.Ticks}&path={verb.UrlEncodedFile}");
|
httpRequestMessage = new(httpMethod, $"{page}size={verb.Size}&ticks={verb.Ticks}&path={verb.UrlEncodedFile}");
|
||||||
} else if (httpMethod == HttpMethod.Patch || httpMethod == HttpMethod.Put) {
|
} else if (httpMethod == HttpMethod.Patch || httpMethod == HttpMethod.Put) {
|
||||||
httpRequestMessage = new(httpMethod, $"{page}path={verb.Directory}");
|
httpRequestMessage = new(httpMethod, $"{page}path={verb.Directory}");
|
||||||
multipartFormDataContent = new();
|
multipartFormDataContent = new() {
|
||||||
multipartFormDataContent.Add(new ByteArrayContent(File.ReadAllBytes(verb.File)), "formFiles", verb.Multipart);
|
{ new ByteArrayContent(File.ReadAllBytes(verb.File)), "formFiles", verb.Multipart },
|
||||||
multipartFormDataContent.Add(new StringContent(verb.Directory), "path", iValue);
|
{ new StringContent(verb.Directory), "path", iValue }
|
||||||
|
};
|
||||||
httpRequestMessage.Content = multipartFormDataContent;
|
httpRequestMessage.Content = multipartFormDataContent;
|
||||||
} else
|
} else
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
@ -469,7 +470,7 @@ internal static partial class Helper20250519 {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ReadOnlyCollection<Verb> GetVerbCollection(string directory, ReadOnlyCollection<Record> records) {
|
private static ReadOnlyCollection<Verb> GetVerbCollection(string? directory, ReadOnlyCollection<Record> records) {
|
||||||
List<Verb> results = [];
|
List<Verb> results = [];
|
||||||
Verb verb;
|
Verb verb;
|
||||||
string checkFile;
|
string checkFile;
|
||||||
@ -477,6 +478,9 @@ internal static partial class Helper20250519 {
|
|||||||
string? checkDirectory;
|
string? checkDirectory;
|
||||||
List<Verb> collection = [];
|
List<Verb> collection = [];
|
||||||
foreach (Record record in records) {
|
foreach (Record record in records) {
|
||||||
|
if (string.IsNullOrEmpty(directory)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
checkFile = Path.Combine(directory, record.RelativePath);
|
checkFile = Path.Combine(directory, record.RelativePath);
|
||||||
checkFileName = Path.GetFileName(checkFile);
|
checkFileName = Path.GetFileName(checkFile);
|
||||||
checkDirectory = Path.GetDirectoryName(checkFile);
|
checkDirectory = Path.GetDirectoryName(checkFile);
|
||||||
|
@ -59,12 +59,11 @@ internal static partial class Helper20250521 {
|
|||||||
string datePattern = args[5];
|
string datePattern = args[5];
|
||||||
string searchPattern = args[2];
|
string searchPattern = args[2];
|
||||||
string searchPatternB = args[3];
|
string searchPatternB = args[3];
|
||||||
string columns = args[6].Replace('~', ',');
|
|
||||||
int dateLineSegmentCount = int.Parse(args[4]);
|
int dateLineSegmentCount = int.Parse(args[4]);
|
||||||
string sourceDirectory = Path.GetFullPath(args[0].Split('~')[0]);
|
string sourceDirectory = Path.GetFullPath(args[0].Split('~')[0]);
|
||||||
ReadOnlyDictionary<string, string> keyValuePairs = GetKeyValuePairs(searchPattern, sourceDirectory);
|
ReadOnlyDictionary<string, string> keyValuePairs = GetKeyValuePairs(searchPattern, sourceDirectory);
|
||||||
MoveMatchDirectory(searchPatternB, keyValuePairs, sourceDirectory);
|
MoveMatchDirectory(searchPatternB, keyValuePairs, sourceDirectory);
|
||||||
ReadOnlyCollection<RecordB> records = GetRecords(searchPatternB, sourceDirectory, dateLineSegmentCount, datePattern, columns);
|
ReadOnlyCollection<RecordB> records = GetRecords(searchPatternB, sourceDirectory, dateLineSegmentCount, datePattern);
|
||||||
WriteRecords(sourceDirectory, records);
|
WriteRecords(sourceDirectory, records);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,7 +71,7 @@ internal static partial class Helper20250521 {
|
|||||||
Dictionary<string, string> results = [];
|
Dictionary<string, string> results = [];
|
||||||
string[] files = Directory.GetFiles(sourceDirectory, searchPattern, SearchOption.AllDirectories);
|
string[] files = Directory.GetFiles(sourceDirectory, searchPattern, SearchOption.AllDirectories);
|
||||||
foreach (string file in files) {
|
foreach (string file in files) {
|
||||||
results.Add(Path.GetFileNameWithoutExtension(file), Path.GetDirectoryName(file));
|
results.Add(Path.GetFileNameWithoutExtension(file), Path.GetDirectoryName(file) ?? throw new Exception());
|
||||||
}
|
}
|
||||||
return results.AsReadOnly();
|
return results.AsReadOnly();
|
||||||
}
|
}
|
||||||
@ -92,7 +91,7 @@ internal static partial class Helper20250521 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ReadOnlyCollection<RecordB> GetRecords(string searchPatternB, string sourceDirectory, int dateLineSegmentCount, string datePattern, string columns) {
|
private static ReadOnlyCollection<RecordB> GetRecords(string searchPatternB, string sourceDirectory, int dateLineSegmentCount, string datePattern) {
|
||||||
List<RecordB> results = [];
|
List<RecordB> results = [];
|
||||||
string line;
|
string line;
|
||||||
string[] lines;
|
string[] lines;
|
||||||
@ -110,7 +109,7 @@ internal static partial class Helper20250521 {
|
|||||||
if (lineCheck.EffectiveDate == DateTime.MinValue || lineCheck.TransactionDate == DateTime.MinValue) {
|
if (lineCheck.EffectiveDate == DateTime.MinValue || lineCheck.TransactionDate == DateTime.MinValue) {
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
record = GetRecord(dateLineSegmentCount, datePattern, lines, i, lineCheck.Segments, lineCheck.TransactionDate, lineCheck.EffectiveDate);
|
record = GetRecord(dateLineSegmentCount, datePattern, lines, i, lineCheck.TransactionDate, lineCheck.EffectiveDate);
|
||||||
if (record is not null) {
|
if (record is not null) {
|
||||||
i = record.I;
|
i = record.I;
|
||||||
results.Add(record);
|
results.Add(record);
|
||||||
@ -121,7 +120,7 @@ internal static partial class Helper20250521 {
|
|||||||
return results.AsReadOnly();
|
return results.AsReadOnly();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static RecordB? GetRecord(int dateLineSegmentCount, string datePattern, string[] lines, int i, string[] segments, DateTime transactionDate, DateTime effectiveDate) {
|
private static RecordB? GetRecord(int dateLineSegmentCount, string datePattern, string[] lines, int i, DateTime transactionDate, DateTime effectiveDate) {
|
||||||
RecordB? result = null;
|
RecordB? result = null;
|
||||||
string line;
|
string line;
|
||||||
LineCheck lineCheck;
|
LineCheck lineCheck;
|
||||||
@ -148,7 +147,7 @@ internal static partial class Helper20250521 {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static RecordB GetRecord(DateTime transactionDate, DateTime effectiveDate, ReadOnlyCollection<string> collection, int i) {
|
private static RecordB? GetRecord(DateTime transactionDate, DateTime effectiveDate, ReadOnlyCollection<string> collection, int i) {
|
||||||
RecordB? result;
|
RecordB? result;
|
||||||
List<string> verified = [];
|
List<string> verified = [];
|
||||||
foreach (string check in collection) {
|
foreach (string check in collection) {
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
|
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
|
|
||||||
namespace File_Folder_Helper.ADO2025.PI6;
|
namespace File_Folder_Helper.ADO2025.PI6;
|
||||||
|
|
||||||
internal static partial class Helper20250701 {
|
internal static partial class Helper20250701 {
|
||||||
@ -55,7 +54,7 @@ internal static partial class Helper20250701 {
|
|||||||
FileInfo fileInfo;
|
FileInfo fileInfo;
|
||||||
string? pipeTable;
|
string? pipeTable;
|
||||||
string? collections;
|
string? collections;
|
||||||
string directoryName;
|
string? directoryName;
|
||||||
string checkDirectory;
|
string checkDirectory;
|
||||||
foreach (string directory in directories) {
|
foreach (string directory in directories) {
|
||||||
if (sizeFilter < 987654321 && Path.GetFileName(directory).Contains('-')) {
|
if (sizeFilter < 987654321 && Path.GetFileName(directory).Contains('-')) {
|
||||||
@ -68,6 +67,9 @@ internal static partial class Helper20250701 {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
directoryName = Path.GetFileName(fileInfo.DirectoryName);
|
directoryName = Path.GetFileName(fileInfo.DirectoryName);
|
||||||
|
if (string.IsNullOrEmpty(directoryName)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (fileInfo.Length > sizeFilter && !directoryName.StartsWith('Z')) {
|
if (fileInfo.Length > sizeFilter && !directoryName.StartsWith('Z')) {
|
||||||
checkDirectory = Path.Combine(sourceDirectory, $"Z{directoryName}");
|
checkDirectory = Path.Combine(sourceDirectory, $"Z{directoryName}");
|
||||||
if (!Directory.Exists(checkDirectory)) {
|
if (!Directory.Exists(checkDirectory)) {
|
||||||
@ -158,7 +160,7 @@ internal static partial class Helper20250701 {
|
|||||||
string[] segments;
|
string[] segments;
|
||||||
List<List<string>> collections = [];
|
List<List<string>> collections = [];
|
||||||
string[] columns = lines[columnTitlesLine].Split('\t');
|
string[] columns = lines[columnTitlesLine].Split('\t');
|
||||||
foreach (string column in columns) {
|
foreach (string _ in columns) {
|
||||||
collections.Add([]);
|
collections.Add([]);
|
||||||
}
|
}
|
||||||
for (int i = columnTitlesLine + 1; i < lines.Length; i++) {
|
for (int i = columnTitlesLine + 1; i < lines.Length; i++) {
|
||||||
@ -406,6 +408,9 @@ internal static partial class Helper20250701 {
|
|||||||
}
|
}
|
||||||
keyValuePairs.Add(jsonProperty.Name, jsonProperty.Value.ToString());
|
keyValuePairs.Add(jsonProperty.Name, jsonProperty.Value.ToString());
|
||||||
}
|
}
|
||||||
|
if (columns is null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
foreach (string column in columns) {
|
foreach (string column in columns) {
|
||||||
if (!keyValuePairs.TryGetValue(column, out value)) {
|
if (!keyValuePairs.TryGetValue(column, out value)) {
|
||||||
values.Add(new string(' ', column.Length));
|
values.Add(new string(' ', column.Length));
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
|
using Microsoft.Extensions.Logging;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
|
|
||||||
namespace File_Folder_Helper.ADO2025.PI6;
|
namespace File_Folder_Helper.ADO2025.PI6;
|
||||||
|
|
||||||
internal static partial class Helper20250709 {
|
internal static partial class Helper20250709 {
|
||||||
@ -157,7 +156,6 @@ internal static partial class Helper20250709 {
|
|||||||
string extension = args[4];
|
string extension = args[4];
|
||||||
string searchPattern = args[2];
|
string searchPattern = args[2];
|
||||||
int sizeFilter = int.Parse(args[3]);
|
int sizeFilter = int.Parse(args[3]);
|
||||||
string[] columns = args[5].Split(',');
|
|
||||||
string sourceDirectory = Path.GetFullPath(args[0].Split('~')[0]);
|
string sourceDirectory = Path.GetFullPath(args[0].Split('~')[0]);
|
||||||
string destinationDirectory = Path.GetFullPath(args[6].Split('~')[0]);
|
string destinationDirectory = Path.GetFullPath(args[6].Split('~')[0]);
|
||||||
string[] directories = Directory.GetDirectories(sourceDirectory, "*", SearchOption.TopDirectoryOnly);
|
string[] directories = Directory.GetDirectories(sourceDirectory, "*", SearchOption.TopDirectoryOnly);
|
||||||
@ -172,7 +170,7 @@ internal static partial class Helper20250709 {
|
|||||||
string checkFile;
|
string checkFile;
|
||||||
Reactor? reactor;
|
Reactor? reactor;
|
||||||
FileInfo fileInfo;
|
FileInfo fileInfo;
|
||||||
string directoryName;
|
string? directoryName;
|
||||||
string checkDirectory;
|
string checkDirectory;
|
||||||
foreach (string directory in directories) {
|
foreach (string directory in directories) {
|
||||||
if (sizeFilter < 987654321 && Path.GetFileName(directory).Contains('-')) {
|
if (sizeFilter < 987654321 && Path.GetFileName(directory).Contains('-')) {
|
||||||
@ -185,6 +183,9 @@ internal static partial class Helper20250709 {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
directoryName = Path.GetFileName(fileInfo.DirectoryName);
|
directoryName = Path.GetFileName(fileInfo.DirectoryName);
|
||||||
|
if (string.IsNullOrEmpty(directoryName)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (fileInfo.Length > sizeFilter && !directoryName.StartsWith('Z')) {
|
if (fileInfo.Length > sizeFilter && !directoryName.StartsWith('Z')) {
|
||||||
checkDirectory = Path.Combine(sourceDirectory, $"Z{directoryName}");
|
checkDirectory = Path.Combine(sourceDirectory, $"Z{directoryName}");
|
||||||
if (!Directory.Exists(checkDirectory)) {
|
if (!Directory.Exists(checkDirectory)) {
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
|
using Microsoft.Extensions.Logging;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
|
|
||||||
namespace File_Folder_Helper.ADO2025.PI6;
|
namespace File_Folder_Helper.ADO2025.PI6;
|
||||||
|
|
||||||
internal static partial class Helper20250710 {
|
internal static partial class Helper20250710 {
|
||||||
@ -28,7 +27,7 @@ internal static partial class Helper20250710 {
|
|||||||
string[] files;
|
string[] files;
|
||||||
string checkFile;
|
string checkFile;
|
||||||
FileInfo fileInfo;
|
FileInfo fileInfo;
|
||||||
string directoryName;
|
string? directoryName;
|
||||||
const string extension = ".trc";
|
const string extension = ".trc";
|
||||||
foreach (string directory in directories) {
|
foreach (string directory in directories) {
|
||||||
files = Directory.GetFiles(directory, searchPattern, SearchOption.TopDirectoryOnly);
|
files = Directory.GetFiles(directory, searchPattern, SearchOption.TopDirectoryOnly);
|
||||||
@ -38,6 +37,9 @@ internal static partial class Helper20250710 {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
directoryName = Path.GetFileName(fileInfo.DirectoryName);
|
directoryName = Path.GetFileName(fileInfo.DirectoryName);
|
||||||
|
if (string.IsNullOrEmpty(directoryName)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
checkFile = Path.Combine(directoryName, $"{fileInfo.Name}{extension}");
|
checkFile = Path.Combine(directoryName, $"{fileInfo.Name}{extension}");
|
||||||
if (File.Exists(checkFile)) {
|
if (File.Exists(checkFile)) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -1,16 +1,22 @@
|
|||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Phares.Metadata.Models.Stateless;
|
||||||
|
using Phares.Shared.Models;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
|
|
||||||
using Phares.Metadata.Models.Stateless;
|
|
||||||
using Phares.Shared.Models;
|
|
||||||
|
|
||||||
namespace File_Folder_Helper.ADO2025.PI6;
|
namespace File_Folder_Helper.ADO2025.PI6;
|
||||||
|
|
||||||
internal static partial class Helper20250720 {
|
internal static partial class Helper20250720 {
|
||||||
|
|
||||||
|
private record Helper20250720Settings(ResultSettings? ResultSettings, MetadataSettings? MetadataSettings);
|
||||||
|
|
||||||
|
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||||
|
[JsonSerializable(typeof(Helper20250720Settings))]
|
||||||
|
private partial class Helper20250720SettingsSourceGenerationContext : JsonSerializerContext {
|
||||||
|
}
|
||||||
|
|
||||||
internal static void WriteFaceData(ILogger<Worker> logger, List<string> args) {
|
internal static void WriteFaceData(ILogger<Worker> logger, List<string> args) {
|
||||||
logger.LogInformation(args[0]);
|
logger.LogInformation(args[0]);
|
||||||
logger.LogInformation(args[1]);
|
logger.LogInformation(args[1]);
|
||||||
@ -45,21 +51,17 @@ internal static partial class Helper20250720 {
|
|||||||
logger.LogError("Face file doesn't exist! <{faceFileInfo}>", faceFileInfo.FullName);
|
logger.LogError("Face file doesn't exist! <{faceFileInfo}>", faceFileInfo.FullName);
|
||||||
} else {
|
} else {
|
||||||
string json = File.ReadAllText(jsonFile);
|
string json = File.ReadAllText(jsonFile);
|
||||||
ResultSettings? resultSettings = JsonSerializer.Deserialize(json, ResultSettingsSourceGenerationContext.Default.ResultSettings);
|
Helper20250720Settings? settings = JsonSerializer.Deserialize(json, Helper20250720SettingsSourceGenerationContext.Default.Helper20250720Settings);
|
||||||
MetadataSettings? metadataSettings = JsonSerializer.Deserialize(json, MetadataSettingsSourceGenerationContext.Default.MetadataSettings);
|
if (settings?.ResultSettings is null || settings.ResultSettings.ResultAllInOneSubdirectoryLength < 1 || settings.MetadataSettings is null) {
|
||||||
if (resultSettings is null) {
|
throw new Exception(nameof(Helper20250720Settings));
|
||||||
logger.LogError(nameof(ResultSettings));
|
}
|
||||||
} else if (metadataSettings is null) {
|
WriteFaceData(logger, outputDirectoryName, originalFile, faceFileInfo, digiKamFile, settings.ResultSettings, settings.MetadataSettings);
|
||||||
logger.LogError(nameof(MetadataSettings));
|
ReadOnlyDictionary<long, ReadOnlyCollection<string>> keyValuePairsXMP = GetKeyValuePairs(searchPatternXMP, pathRootXMP);
|
||||||
|
ReadOnlyDictionary<long, ReadOnlyCollection<ExifDirectory>> keyValuePairs = GetKeyValuePairs(searchPattern, pathRoot, settings.ResultSettings, settings.MetadataSettings);
|
||||||
|
if (keyValuePairs.Count == 0) {
|
||||||
|
logger.LogError("Didn't find any valid file(s)!");
|
||||||
} else {
|
} else {
|
||||||
WriteFaceData(logger, outputDirectoryName, originalFile, faceFileInfo, digiKamFile, resultSettings, metadataSettings);
|
WriteFaceData(logger, outputDirectoryName, keyValuePairs, keyValuePairsXMP);
|
||||||
ReadOnlyDictionary<long, ReadOnlyCollection<string>> keyValuePairsXMP = GetKeyValuePairs(searchPatternXMP, pathRootXMP);
|
|
||||||
ReadOnlyDictionary<long, ReadOnlyCollection<ExifDirectory>> keyValuePairs = GetKeyValuePairs(searchPattern, pathRoot, resultSettings, metadataSettings);
|
|
||||||
if (keyValuePairs.Count == 0) {
|
|
||||||
logger.LogError("Didn't find any valid file(s)!");
|
|
||||||
} else {
|
|
||||||
WriteFaceData(logger, outputDirectoryName, keyValuePairs, keyValuePairsXMP);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -116,6 +118,8 @@ internal static partial class Helper20250720 {
|
|||||||
FaceFile faceFile;
|
FaceFile faceFile;
|
||||||
string descriptionLine = "</rdf:Description>";
|
string descriptionLine = "</rdf:Description>";
|
||||||
faceFile = keyValuePairs.ElementAt(0).Value;
|
faceFile = keyValuePairs.ElementAt(0).Value;
|
||||||
|
if (faceFile.Location is null || faceFile.OutputResolution is null)
|
||||||
|
throw new Exception();
|
||||||
List<string> regionLines = [
|
List<string> regionLines = [
|
||||||
"<MP:RegionInfo rdf:parseType=\"Resource\">",
|
"<MP:RegionInfo rdf:parseType=\"Resource\">",
|
||||||
"<MPRI:Regions>",
|
"<MPRI:Regions>",
|
||||||
@ -138,6 +142,8 @@ internal static partial class Helper20250720 {
|
|||||||
foreach (KeyValuePair<string, FaceFile> keyValuePair in keyValuePairs) {
|
foreach (KeyValuePair<string, FaceFile> keyValuePair in keyValuePairs) {
|
||||||
personKey = keyValuePair.Key;
|
personKey = keyValuePair.Key;
|
||||||
faceFile = keyValuePair.Value;
|
faceFile = keyValuePair.Value;
|
||||||
|
if (faceFile.Location is null || faceFile.OutputResolution is null)
|
||||||
|
throw new Exception();
|
||||||
width = faceFile.Location.Right - faceFile.Location.Left;
|
width = faceFile.Location.Right - faceFile.Location.Left;
|
||||||
height = faceFile.Location.Bottom - faceFile.Location.Top;
|
height = faceFile.Location.Bottom - faceFile.Location.Top;
|
||||||
if (!string.IsNullOrEmpty(originalFile) && File.Exists(originalFile)) {
|
if (!string.IsNullOrEmpty(originalFile) && File.Exists(originalFile)) {
|
||||||
@ -233,8 +239,8 @@ internal static partial class Helper20250720 {
|
|||||||
// </dc:subject>
|
// </dc:subject>
|
||||||
subjectLines.Add($"<rdf:li>{personKey}</rdf:li>");
|
subjectLines.Add($"<rdf:li>{personKey}</rdf:li>");
|
||||||
}
|
}
|
||||||
regionLines.AddRange(["</rdf:Bag>","</MPRI:Regions>","</MP:RegionInfo>"]);
|
regionLines.AddRange(["</rdf:Bag>", "</MPRI:Regions>", "</MP:RegionInfo>"]);
|
||||||
regionsLinesB.AddRange(["</rdf:Bag>", "</mwg-rs:RegionList>","</mwg-rs:Regions>"]);
|
regionsLinesB.AddRange(["</rdf:Bag>", "</mwg-rs:RegionList>", "</mwg-rs:Regions>"]);
|
||||||
digiKamLines.AddRange(["</rdf:Seq>", "</digiKam:TagsList>"]);
|
digiKamLines.AddRange(["</rdf:Seq>", "</digiKam:TagsList>"]);
|
||||||
microsoftPhotoLines.AddRange(["</rdf:Bag>", "</MicrosoftPhoto:LastKeywordXMP>"]);
|
microsoftPhotoLines.AddRange(["</rdf:Bag>", "</MicrosoftPhoto:LastKeywordXMP>"]);
|
||||||
hierarchicalSubjectLines.AddRange(["</rdf:Bag>", "</lr:hierarchicalSubject>"]);
|
hierarchicalSubjectLines.AddRange(["</rdf:Bag>", "</lr:hierarchicalSubject>"]);
|
||||||
@ -292,7 +298,7 @@ internal static partial class Helper20250720 {
|
|||||||
|
|
||||||
private static ReadOnlyDictionary<string, FaceFile> GetKeyValuePairs(ILogger<Worker> logger, ReadOnlyCollection<ExifDirectory> exifDirectories) {
|
private static ReadOnlyDictionary<string, FaceFile> GetKeyValuePairs(ILogger<Worker> logger, ReadOnlyCollection<ExifDirectory> exifDirectories) {
|
||||||
Dictionary<string, FaceFile> results = [];
|
Dictionary<string, FaceFile> results = [];
|
||||||
string personKey;
|
string? personKey;
|
||||||
FaceFile? faceFile;
|
FaceFile? faceFile;
|
||||||
foreach (ExifDirectory exifDirectory in exifDirectories) {
|
foreach (ExifDirectory exifDirectory in exifDirectories) {
|
||||||
faceFile = IMetadata.GetFaceFile(exifDirectory);
|
faceFile = IMetadata.GetFaceFile(exifDirectory);
|
||||||
@ -304,6 +310,9 @@ internal static partial class Helper20250720 {
|
|||||||
logger.LogWarning("faceFile output-resolution orientation is not aloud!");
|
logger.LogWarning("faceFile output-resolution orientation is not aloud!");
|
||||||
} else {
|
} else {
|
||||||
personKey = Path.GetFileName(Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(exifDirectory.FilePath.FullName))));
|
personKey = Path.GetFileName(Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(exifDirectory.FilePath.FullName))));
|
||||||
|
if (string.IsNullOrEmpty(personKey)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (results.ContainsKey(personKey)) {
|
if (results.ContainsKey(personKey)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -12,13 +12,13 @@ namespace File_Folder_Helper.ADO2025.PI6;
|
|||||||
|
|
||||||
internal static partial class Helper20250726 {
|
internal static partial class Helper20250726 {
|
||||||
|
|
||||||
private record Settings(ResultSettings? ResultSettings, MetadataSettings? MetadataSettings);
|
private record Helper20250726Settings(ResultSettings? ResultSettings, MetadataSettings? MetadataSettings);
|
||||||
|
|
||||||
private record Record(CombinedEnumAndIndex CombinedEnumAndIndex, FilePath FilePath, bool HasFlagHidden);
|
private record Record(CombinedEnumAndIndex CombinedEnumAndIndex, FilePath FilePath, bool HasFlagHidden);
|
||||||
|
|
||||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||||
[JsonSerializable(typeof(Settings))]
|
[JsonSerializable(typeof(Helper20250726Settings))]
|
||||||
private partial class SettingsSourceGenerationContext : JsonSerializerContext {
|
private partial class Helper20250726SettingsSourceGenerationContext : JsonSerializerContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void CopyToCombinedEnumAndIndexFormat(ILogger<Worker> logger, List<string> args) {
|
internal static void CopyToCombinedEnumAndIndexFormat(ILogger<Worker> logger, List<string> args) {
|
||||||
@ -35,9 +35,9 @@ internal static partial class Helper20250726 {
|
|||||||
string json = File.ReadAllText(jsonFile);
|
string json = File.ReadAllText(jsonFile);
|
||||||
string sourceDirectory = Path.GetFullPath(args[0].Split('~')[0]);
|
string sourceDirectory = Path.GetFullPath(args[0].Split('~')[0]);
|
||||||
string destinationDirectory = Path.GetFullPath(args[4].Split('~')[0]);
|
string destinationDirectory = Path.GetFullPath(args[4].Split('~')[0]);
|
||||||
Settings? settings = JsonSerializer.Deserialize(json, SettingsSourceGenerationContext.Default.Settings);
|
Helper20250726Settings? settings = JsonSerializer.Deserialize(json, Helper20250726SettingsSourceGenerationContext.Default.Helper20250726Settings);
|
||||||
if (settings.ResultSettings is null || settings.ResultSettings.ResultAllInOneSubdirectoryLength < 1 || settings.MetadataSettings is null) {
|
if (settings?.ResultSettings is null || settings.ResultSettings.ResultAllInOneSubdirectoryLength < 1 || settings.MetadataSettings is null) {
|
||||||
throw new Exception(nameof(Settings));
|
throw new Exception(nameof(Helper20250726Settings));
|
||||||
}
|
}
|
||||||
string[] files = Directory.GetFiles(sourceDirectory, searchPattern, SearchOption.AllDirectories);
|
string[] files = Directory.GetFiles(sourceDirectory, searchPattern, SearchOption.AllDirectories);
|
||||||
ReadOnlyDictionary<int, ReadOnlyDictionary<byte, ReadOnlyCollection<string>>> keyValuePairs = GetKeyValuePairs(destinationDirectory, settings.ResultSettings);
|
ReadOnlyDictionary<int, ReadOnlyDictionary<byte, ReadOnlyCollection<string>>> keyValuePairs = GetKeyValuePairs(destinationDirectory, settings.ResultSettings);
|
||||||
|
Reference in New Issue
Block a user