diff --git a/.editorconfig b/.editorconfig
index a3ebdb2..b48db8a 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,137 +1,10 @@
-# Remove the line below if you want to inherit .editorconfig settings from higher directories
-root = true
-
-# C# files
[*.cs]
-
-#### Core EditorConfig Options ####
-
-# Indentation and spacing
-indent_size = 4
-indent_style = space
-tab_width = 4
-
-# New line preferences
-end_of_line = crlf
-insert_final_newline = false
-
-#### .NET Coding Conventions ####
-
-# Organize usings
-dotnet_separate_import_directive_groups = false
-dotnet_sort_system_directives_first = false
-file_header_template = unset
-
-# this. and Me. preferences
-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
-
-# Language keywords vs BCL types preferences
-dotnet_style_predefined_type_for_locals_parameters_members = true
-dotnet_style_predefined_type_for_member_access = true
-
-# Parentheses preferences
-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
-
-# Modifier preferences
-dotnet_style_require_accessibility_modifiers = for_non_interface_members
-
-# Expression-level preferences
-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_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
-
-# Field preferences
-dotnet_style_readonly_field = true:warning
-
-# Parameter preferences
-dotnet_code_quality_unused_parameters = all
-
-# Suppression preferences
-dotnet_remove_unnecessary_suppression_exclusions = 0
-
-# New line preferences
-dotnet_style_allow_multiple_blank_lines_experimental = false:warning
-dotnet_style_allow_statement_immediately_after_block_experimental = true
-
-#### C# Coding Conventions ####
-
-# var preferences
-csharp_style_var_elsewhere = false:warning
-csharp_style_var_for_built_in_types = false:warning
-csharp_style_var_when_type_is_apparent = false:warning
-
-# Expression-bodied members
-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
-
-# Pattern matching preferences
-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_not_pattern = true:warning
-csharp_style_prefer_pattern_matching = true:warning
-csharp_style_prefer_switch_expression = true:warning
-
-# Null-checking preferences
-csharp_style_conditional_delegate_call = true
-
-# Modifier preferences
-csharp_prefer_static_local_function = true:warning
-csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async
-
-# Code-block preferences
-csharp_prefer_braces = false
-csharp_prefer_simple_using_statement = true:warning
-csharp_style_namespace_declarations = file_scoped:warning
-
-# Expression-level preferences
-csharp_prefer_simple_default_expression = true:warning
-csharp_style_deconstructed_variable_declaration = false
-csharp_style_implicit_object_creation_when_type_is_apparent = true:warning
-csharp_style_inlined_variable_declaration = false
-csharp_style_pattern_local_over_anonymous_function = true:warning
-csharp_style_prefer_index_operator = false:warning
-csharp_style_prefer_null_check_over_type_check = true
-csharp_style_prefer_range_operator = false: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
-
-# 'using' directive preferences
-csharp_using_directive_placement = outside_namespace
-
-# New line preferences
-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
-
-#### C# Formatting Rules ####
-
-# New line preferences
+csharp_indent_block_contents = true
+csharp_indent_braces = false
+csharp_indent_case_contents = true
+csharp_indent_case_contents_when_block = true
+csharp_indent_labels = one_less_than_current
+csharp_indent_switch_labels = true
csharp_new_line_before_catch = true
csharp_new_line_before_else = true
csharp_new_line_before_finally = true
@@ -139,16 +12,13 @@ csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_open_brace = all
csharp_new_line_between_query_expression_clauses = true
-
-# Indentation preferences
-csharp_indent_block_contents = true
-csharp_indent_braces = false
-csharp_indent_case_contents = true
-csharp_indent_case_contents_when_block = true
-csharp_indent_labels = one_less_than_current
-csharp_indent_switch_labels = true
-
-# Space preferences
+csharp_prefer_braces = false
+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
@@ -171,166 +41,202 @@ 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
-
-# Wrapping preferences
-csharp_preserve_single_line_blocks = true
-csharp_preserve_single_line_statements = false
-
-#### Naming styles ####
-
-# Naming rules
-
-dotnet_naming_rule.interface_should_be_begins_with_i.severity = warning
-dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
-dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
-
-dotnet_naming_rule.types_should_be_pascal_case.severity = warning
-dotnet_naming_rule.types_should_be_pascal_case.symbols = types
-dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
-
-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.symbols = private_or_internal_field
-dotnet_naming_rule.private_or_internal_field_should_be_private_of_internal_field.style = private_of_internal_field
-
-dotnet_naming_rule.enum_should_be_pascal_case.severity = warning
-dotnet_naming_rule.enum_should_be_pascal_case.symbols = enum
-dotnet_naming_rule.enum_should_be_pascal_case.style = pascal_case
-
-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.symbols = public_or_protected_field
-dotnet_naming_rule.public_or_protected_field_should_be_private_of_internal_field.style = private_of_internal_field
-
-dotnet_naming_rule.class_should_be_pascal_case.severity = warning
-dotnet_naming_rule.class_should_be_pascal_case.symbols = class
-dotnet_naming_rule.class_should_be_pascal_case.style = pascal_case
-
-dotnet_naming_rule.method_should_be_pascal_case.severity = warning
-dotnet_naming_rule.method_should_be_pascal_case.symbols = method
-dotnet_naming_rule.method_should_be_pascal_case.style = pascal_case
-
-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.symbols = private_or_internal_static_field
-dotnet_naming_rule.private_or_internal_static_field_should_be_private_of_internal_field.style = private_of_internal_field
-
-dotnet_naming_rule.static_field_should_be_pascal_case.severity = warning
-dotnet_naming_rule.static_field_should_be_pascal_case.symbols = static_field
-dotnet_naming_rule.static_field_should_be_pascal_case.style = pascal_case
-
-dotnet_naming_rule.property_should_be_pascal_case.severity = warning
-dotnet_naming_rule.property_should_be_pascal_case.symbols = property
-dotnet_naming_rule.property_should_be_pascal_case.style = pascal_case
-
-dotnet_naming_rule.static_method_should_be_pascal_case.severity = warning
-dotnet_naming_rule.static_method_should_be_pascal_case.symbols = static_method
-dotnet_naming_rule.static_method_should_be_pascal_case.style = pascal_case
-
+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_code_quality_unused_parameters = all
+dotnet_code_quality_unused_parameters = non_public # IDE0060: Remove unused parameter
+dotnet_code_quality.CAXXXX.api_surface = private, internal
+dotnet_diagnostic.CA1825.severity = warning # CA1823: 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.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.IDE0005.severity = warning # Using directive is unnecessary using System.Text;
+dotnet_diagnostic.IDE0060.severity = warning # IDE0060: Remove unused parameter
dotnet_naming_rule.abstract_method_should_be_pascal_case.severity = warning
-dotnet_naming_rule.abstract_method_should_be_pascal_case.symbols = abstract_method
dotnet_naming_rule.abstract_method_should_be_pascal_case.style = pascal_case
-
-dotnet_naming_rule.private_method_should_be_pascal_case.severity = warning
-dotnet_naming_rule.private_method_should_be_pascal_case.symbols = private_method
-dotnet_naming_rule.private_method_should_be_pascal_case.style = pascal_case
-
-dotnet_naming_rule.event_should_be_pascal_case.severity = warning
-dotnet_naming_rule.event_should_be_pascal_case.symbols = event
-dotnet_naming_rule.event_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.symbols = delegate
dotnet_naming_rule.delegate_should_be_pascal_case.style = pascal_case
-
-dotnet_naming_rule.struct_should_be_pascal_case.severity = warning
-dotnet_naming_rule.struct_should_be_pascal_case.symbols = struct
-dotnet_naming_rule.struct_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.symbols = non_field_members
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
-
-# Symbol specifications
-
-dotnet_naming_symbols.class.applicable_kinds = class
-dotnet_naming_symbols.class.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
-dotnet_naming_symbols.class.required_modifiers =
-
-dotnet_naming_symbols.interface.applicable_kinds = interface
-dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
-dotnet_naming_symbols.interface.required_modifiers =
-
-dotnet_naming_symbols.struct.applicable_kinds = struct
-dotnet_naming_symbols.struct.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
-dotnet_naming_symbols.struct.required_modifiers =
-
-dotnet_naming_symbols.enum.applicable_kinds = enum
-dotnet_naming_symbols.enum.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
-dotnet_naming_symbols.enum.required_modifiers =
-
-dotnet_naming_symbols.delegate.applicable_kinds = delegate
-dotnet_naming_symbols.delegate.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
-dotnet_naming_symbols.delegate.required_modifiers =
-
-dotnet_naming_symbols.event.applicable_kinds = event
-dotnet_naming_symbols.event.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
-dotnet_naming_symbols.event.required_modifiers =
-
-dotnet_naming_symbols.method.applicable_kinds = method
-dotnet_naming_symbols.method.applicable_accessibilities = public
-dotnet_naming_symbols.method.required_modifiers =
-
-dotnet_naming_symbols.private_method.applicable_kinds = method
-dotnet_naming_symbols.private_method.applicable_accessibilities = private
-dotnet_naming_symbols.private_method.required_modifiers =
-
-dotnet_naming_symbols.abstract_method.applicable_kinds = method
-dotnet_naming_symbols.abstract_method.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
-dotnet_naming_symbols.abstract_method.required_modifiers = abstract
-
-dotnet_naming_symbols.static_method.applicable_kinds = method
-dotnet_naming_symbols.static_method.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
-dotnet_naming_symbols.static_method.required_modifiers = static
-
-dotnet_naming_symbols.property.applicable_kinds = property
-dotnet_naming_symbols.property.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
-dotnet_naming_symbols.property.required_modifiers =
-
-dotnet_naming_symbols.public_or_protected_field.applicable_kinds = field
-dotnet_naming_symbols.public_or_protected_field.applicable_accessibilities = public, protected
-dotnet_naming_symbols.public_or_protected_field.required_modifiers =
-
-dotnet_naming_symbols.static_field.applicable_kinds = field
-dotnet_naming_symbols.static_field.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
-dotnet_naming_symbols.static_field.required_modifiers = static
-
-dotnet_naming_symbols.private_or_internal_field.applicable_kinds = field
-dotnet_naming_symbols.private_or_internal_field.applicable_accessibilities = internal, private, private_protected
-dotnet_naming_symbols.private_or_internal_field.required_modifiers =
-
-dotnet_naming_symbols.private_or_internal_static_field.applicable_kinds = field
-dotnet_naming_symbols.private_or_internal_static_field.applicable_accessibilities = internal, private, private_protected
-dotnet_naming_symbols.private_or_internal_static_field.required_modifiers = static
-
-dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
-dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
-dotnet_naming_symbols.types.required_modifiers =
-
-dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
-dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
-dotnet_naming_symbols.non_field_members.required_modifiers =
-
-# Naming styles
-
-dotnet_naming_style.pascal_case.required_prefix =
-dotnet_naming_style.pascal_case.required_suffix =
-dotnet_naming_style.pascal_case.word_separator =
-dotnet_naming_style.pascal_case.capitalization = 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.begins_with_i.capitalization = pascal_case
-
+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_style.private_of_internal_field.capitalization = pascal_case
+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
+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
\ No newline at end of file
diff --git a/.groovy b/.groovy
new file mode 100644
index 0000000..3cce7fa
--- /dev/null
+++ b/.groovy
@@ -0,0 +1,267 @@
+#!/usr/bin/env groovy
+/* groovylint-disable CompileStatic, ConsecutiveStringConcatenation, DuplicateNumberLiteral, DuplicateStringLiteral, LineLength, NestedBlockDepth, NoDef, VariableTypeRequired */
+import groovy.transform.Field
+
+@Field String _DDrive = 'D:/'
+@Field String _ExePath = '...'
+@Field String _NGINXFile = '...'
+@Field String _PortNumber = '...'
+@Field String _AssemblyName = '...'
+@Field String _NetVersion = 'net6.0'
+@Field String _TargetLocation = '...'
+@Field String _GitCommitSeven = '...'
+@Field String _GitName = 'EDA-Viewer'
+@Field String _FirstBeforePlus = '5000'
+@Field String _MonARessource = 'EDA_Viewer'
+@Field String _ProjectDirectory = 'EDA Viewer'
+@Field String _WorkingDirectoryName = 'IFXApps'
+@Field String _AgentStaging = 'mestsa07ec-ecmeseaf'
+@Field String _AgentProduction = 'messa08ec-ecmeseaf'
+@Field String _DDriveNet = "${_DDrive}${_NetVersion}"
+@Field String _CredentialsId = 'EDA-Username-Password'
+@Field String _AgentDevelopment = 'mestsa003-mesedasvc'
+@Field String _Company = 'Infineon Technologies Americas Corp.'
+@Field String _ProgramFilesDotnet = 'C:/program files/dotnet/dotnet.exe'
+
+pipeline {
+ agent {
+ label env.JENKINS_ENVIRONMENT == 'Development' ? _AgentDevelopment : env.JENKINS_ENVIRONMENT == 'Staging' ? _AgentStaging : env.JENKINS_ENVIRONMENT == 'Production' ? _AgentProduction : 'Else'
+ }
+ parameters {
+ string(name: 'MONA_SUFFIX', defaultValue: env.JENKINS_ENVIRONMENT == 'Development' ? '_IFX' : '_EC', description: 'MonA Suffix')
+ string(name: 'GIT_SERVER', defaultValue: env.JENKINS_ENVIRONMENT == 'Development' ? 'mestsa003.infineon.com' : 'mestsa07ec.ec.local', description: 'git server')
+ string(name: 'DEFAULT_FILE_SERVER', defaultValue: env.JENKINS_ENVIRONMENT == 'Development' ? 'messv02ecc1_ec_local' : 'messv02ecc1.ec.local', description: 'Default file server...')
+ }
+ stages {
+ stage('Git') {
+ steps {
+ bat(returnStatus: true, script: 'git init')
+ bat(returnStatus: true, script: 'git remote add origin \\\\' + params.GIT_SERVER + '\\Git\\' + _GitName + '.git')
+ bat(returnStatus: true, script: 'git pull origin master')
+ }
+ }
+ stage('Setup') {
+ steps {
+ script {
+ _AssemblyName = "${env.JOB_NAME}"
+ _GitCommitSeven = '1234567'
+ // _GitCommitSeven = env.GIT_COMMIT.substring(0, 7)
+ dir(_ProjectDirectory) {
+ def files = findFiles(glob: '*.csproj')
+ if (files.length != 1) {
+ error("Build failed because couldn't find a *.csproj file")
+ }
+ echo """
+ ${files[0].name}
+ ${files[0].path}
+ ${files[0].directory}
+ ${files[0].length}
+ ${files[0].lastModified}
+ """
+ _AssemblyName = files[0].name.split('[.]csproj')[0]
+ }
+ _TargetLocation = "\\\\${params.DEFAULT_FILE_SERVER}\\EC_EAFRepository\\${env.JENKINS_ENVIRONMENT}\\DeploymentStorage\\Adaptation_${_AssemblyName}"
+ withCredentials([usernamePassword(credentialsId: _CredentialsId, passwordVariable: 'password', usernameVariable: 'username')]) {
+ dir("C:/Users/${username}/AppData/Local/IFXApps/nginx-1.20.1/conf/includes") {
+ _NGINXFile = "C:/Users/${username}/AppData/Local/IFXApps/nginx-1.20.1/conf/includes/${_AssemblyName}.conf"
+ def files = findFiles(glob: "${_AssemblyName}.conf")
+ if (files.length != 1) {
+ writeFile(file: _NGINXFile, text: "location / { proxy_pass http://localhost:${_FirstBeforePlus}; }")
+ }
+ }
+ }
+ }
+ }
+ }
+ stage('Read NGINX') {
+ steps {
+ script {
+ String text = readFile(file: _NGINXFile)
+ String check = text == null ? _FirstBeforePlus : text.split(';')[0]
+ String[] segments = check.split(':')
+ if (segments.length != 3) {
+ _PortNumber = check
+ }
+ else {
+ _PortNumber = (segments[2].toInteger() + 2).toString()
+ }
+ _ExePath = "${_DDriveNet}/${_GitCommitSeven}-${env.BUILD_NUMBER}-${_PortNumber}-${env.JOB_NAME}/${_AssemblyName}.exe"
+ }
+ }
+ }
+ stage('Info') {
+ steps {
+ // echo "GIT_URL_N - ${env.GIT_URL_N}"
+ // echo "BRANCH_NAME ${env.BRANCH_NAME}"
+ // echo "DEPLOY_VERSION ${env.DEPLOY_VERSION}"
+ // echo "GIT_AUTHOR_NAME ${env.GIT_AUTHOR_NAME}"
+ // echo "GIT_LOCAL_BRANCH ${env.GIT_LOCAL_BRANCH}"
+ // echo "GIT_COMMITTER_EMAIL ${env.GIT_COMMITTER_EMAIL}"
+ // echo "GIT_PREVIOUS_COMMIT ${env.GIT_PREVIOUS_COMMIT}"
+ // echo "GIT_PREVIOUS_SUCCESSFUL_COMMIT ${env.GIT_PREVIOUS_SUCCESSFUL_COMMIT}"
+ echo "_AssemblyName ${_AssemblyName}" // ...
+ echo "_ExePath ${_ExePath}" // ...
+ echo "_PortNumber ${_PortNumber}" // ...
+ echo "BUILD_NUMBER ${env.BUILD_NUMBER}" // 11
+ echo "DEFAULT_FILE_SERVER ${params.DEFAULT_FILE_SERVER}" // 11
+ echo "GIT_BRANCH ${env.GIT_BRANCH}" // origin/master
+ echo "GIT_COMMIT ${env.GIT_COMMIT}" // 73b814069f2cf0173a62a8228815a9bc9ba93c41
+ echo "GIT_SERVER ${params.GIT_SERVER}" // ...
+ echo "GIT_URL ${env.GIT_URL}" // D:\ProgramData\Git\....git
+ echo "JENKINS_ENVIRONMENT ${env.JENKINS_ENVIRONMENT}" // 11
+ echo "JENKINS_URL ${env.JENKINS_URL}" // http://localhost:8080/
+ echo "JOB_NAME ${env.JOB_NAME}" // ...
+ echo "WORKSPACE ${env.WORKSPACE}" // D:\.jenkins\_\...
+ }
+ }
+ // stage('Restore') {
+ // steps {
+ // bat(returnStatus: true, script: 'dotnet --info')
+ // }
+ // }
+ stage('Safe storage of app secrets') {
+ steps {
+ withCredentials([usernamePassword(credentialsId: _CredentialsId, passwordVariable: 'password', usernameVariable: 'username')]) {
+ dir(_ProjectDirectory) {
+ bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' +
+ 'user-secrets init')
+ bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' +
+ 'user-secrets set "Company" "' + _Company + '"')
+ bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' +
+ 'user-secrets set "ServiceUser" "' + username + '"')
+ bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' +
+ 'user-secrets set "BuildNumber" "' + env.BUILD_NUMBER + '"')
+ bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' +
+ 'user-secrets set "GitCommitSeven" "' + _GitCommitSeven + '"')
+ bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' +
+ 'user-secrets set "Server" "' + params.DEFAULT_FILE_SERVER + '"')
+ bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' +
+ 'user-secrets set "URLs" "' + 'http://localhost:' + _PortNumber)
+ bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' +
+ 'user-secrets set "WorkingDirectoryName" "' + _WorkingDirectoryName + '"')
+ bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' +
+ 'user-secrets set "MonARessource" "' + _MonARessource + env.MONA_SUFFIX + '"')
+ }
+ }
+ }
+ }
+ // stage('Core Build (packagemanagement.eu.infineon.com)') {
+ // steps {
+ // echo "Build number is ${currentBuild.number}"
+ // dir(_ProjectDirectory) {
+ // bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' +
+ // 'build --runtime win-x64 --self-contained --verbosity quiet --source ' +
+ // 'https://packagemanagement.eu.infineon.com:4430/api/v2/')
+ // }
+ // }
+ // }
+ stage('Core Build') {
+ steps {
+ echo "Build number is ${currentBuild.number}"
+ dir(_ProjectDirectory) {
+ bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' +
+ 'build --runtime win-x64 --self-contained --verbosity quiet')
+ }
+ }
+ }
+ stage('Commit Id') {
+ steps {
+ dir(_ProjectDirectory) {
+ writeFile(file: 'bin/Debug/' + _NetVersion + "/win-x64/${env.GIT_COMMIT}-${env.BUILD_NUMBER}.txt", text: "${env.GIT_URL}")
+ }
+ }
+ }
+ // stage('Test') {
+ // options {
+ // timeout(time: 10, unit: 'MINUTES')
+ // }
+ // steps {
+ // dir(_ProjectDirectory) {
+ // bat('dotnet --info')
+ // }
+ // }
+ // }
+ // stage('Version') {
+ // steps {
+ // bat('dotnet --info')
+ // }
+ // }
+ stage('Package') {
+ steps {
+ dir(_ProjectDirectory) {
+ fileOperations([fileZipOperation(folderPath: 'bin/Debug/' + _NetVersion + '/win-x64', outputFolderPath: "${_DDriveNet}/${_GitCommitSeven}-${env.BUILD_NUMBER}-${_PortNumber}-${env.JOB_NAME}-Debug")])
+ fileOperations([fileCopyOperation(excludes: '', flattenFiles: true, includes: "${_AssemblyName}*", renameFiles: false, sourceCaptureExpression: '', targetLocation: "${_DDriveNet}/${_GitCommitSeven}-${env.BUILD_NUMBER}-${_PortNumber}-${env.JOB_NAME}-Debug", targetNameExpression: '')])
+ }
+ }
+ }
+ stage('Publish') {
+ steps {
+ dir(_ProjectDirectory) {
+ bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' +
+ 'remove reference "../Client/' + env.JOB_NAME + '.Client.csproj"')
+ bat(returnStatus: true, script: '"' + _ProgramFilesDotnet + '" ' +
+ 'publish --configuration Release --runtime win-x64 --verbosity quiet ' +
+ "--self-contained true --p:Version=6.0.202-${_GitCommitSeven}-${env.BUILD_NUMBER} -o " +
+ '"' + "${_DDriveNet}/${_GitCommitSeven}-${env.BUILD_NUMBER}-${_PortNumber}-${env.JOB_NAME}" + '"')
+ }
+ }
+ }
+ stage('Service') {
+ steps {
+ withCredentials([usernamePassword(credentialsId: _CredentialsId, passwordVariable: 'password', usernameVariable: 'username')]) {
+ bat(returnStatus: true, script: 'sc create "' + "${env.JOB_NAME}-${_PortNumber}" + '" ' +
+ 'start= delayed-auto DisplayName="' + "${env.JOB_NAME}-${_PortNumber}" + '" ' +
+ 'binPath= "' + _ExePath + '" ' +
+ 'obj= "' + "${env.USERDOMAIN}\\${username}" + '" password= "' + password + '"')
+ bat(returnStatus: true, script: 'sc start "' + "${env.JOB_NAME}-${_PortNumber}" + '"')
+ }
+ }
+ }
+ stage('Upadate NGINX') {
+ steps {
+ writeFile(file: _NGINXFile, text: "location / { proxy_pass http://localhost:${_PortNumber}; }")
+ }
+ }
+ stage('NGINX Test and Reload') {
+ steps {
+ withCredentials([usernamePassword(credentialsId: _CredentialsId, passwordVariable: 'password', usernameVariable: 'username')]) {
+ dir("C:/Users/${username}/AppData/Local/IFXApps/nginx-1.20.1") {
+ script {
+ int returnStatus = bat(returnStatus: true, script: 'nginx.exe -t')
+ println("returnStatus ################ ${returnStatus} ####################")
+ if (returnStatus == 0) {
+ bat(returnStatus: true, script: 'nginx.exe -s reload')
+ }
+ }
+ }
+ }
+ }
+ }
+ // stage('Force Fail') {
+ // steps {
+ // error("Build failed because of this and that..")
+ // }
+ // }
+ // stage('Copy Files to: file-share') {
+ // steps {
+ // dir(_ProjectDirectory + '/bin/Debug/' + _NetVersion + '/win-x64') {
+ // fileOperations([fileCopyOperation(excludes: '', flattenFiles: true, includes: "${_AssemblyName}*.txt", renameFiles: false, sourceCaptureExpression: '', targetLocation: _TargetLocation, targetNameExpression: '')])
+ // fileOperations([fileCopyOperation(excludes: '', flattenFiles: true, includes: "${_AssemblyName}*.dll", renameFiles: false, sourceCaptureExpression: '', targetLocation: _TargetLocation, targetNameExpression: '')])
+ // fileOperations([fileCopyOperation(excludes: '', flattenFiles: true, includes: "${_AssemblyName}*.exe", renameFiles: false, sourceCaptureExpression: '', targetLocation: _TargetLocation, targetNameExpression: '')])
+ // fileOperations([fileCopyOperation(excludes: '', flattenFiles: true, includes: "${_AssemblyName}*.pdb", renameFiles: false, sourceCaptureExpression: '', targetLocation: _TargetLocation, targetNameExpression: '')])
+ // }
+ // }
+ // }
+ }
+ post {
+ always {
+ dir(_ProjectDirectory + '/bin') {
+ deleteDir()
+ }
+ dir(_ProjectDirectory + '/obj') {
+ deleteDir()
+ }
+ // cleanWs()
+ }
+ }
+}
diff --git a/EDA Viewer/.vscode/format-report.json b/EDA Viewer/.vscode/format-report.json
new file mode 100644
index 0000000..30ff645
--- /dev/null
+++ b/EDA Viewer/.vscode/format-report.json
@@ -0,0 +1,20 @@
+[
+ {
+ "DocumentId": {
+ "ProjectId": {
+ "Id": "1c39e10e-5359-42ab-be77-db59c291586c"
+ },
+ "Id": "81852d1e-25b8-4230-9e00-0399608db1e6"
+ },
+ "FileName": "Background.cshtml.cs",
+ "FilePath": "G:\\Mesa_FI\\EDA-Viewer\\EDA Viewer\\Pages\\Background.cshtml.cs",
+ "FileChanges": [
+ {
+ "LineNumber": 1,
+ "CharNumber": 1,
+ "DiagnosticId": "IMPORTS",
+ "FormatDescription": "Fix imports ordering."
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/EDA Viewer/.vscode/launch.json b/EDA Viewer/.vscode/launch.json
new file mode 100644
index 0000000..cf1e333
--- /dev/null
+++ b/EDA Viewer/.vscode/launch.json
@@ -0,0 +1,33 @@
+{
+ // Use IntelliSense to learn about possible attributes.
+ // Hover to view descriptions of existing attributes.
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "name": ".NET Core Launch (web)",
+ "type": "coreclr",
+ "request": "launch",
+ "preLaunchTask": "build",
+ "program": "${workspaceFolder}/bin/Debug/net6.0/win-x64/EDA Viewer.dll",
+ "args": [],
+ "cwd": "${workspaceFolder}",
+ "stopAtEntry": false,
+ "serverReadyAction": {
+ "action": "openExternally",
+ "pattern": "\\bNow listening on:\\s+(https?://\\S+)"
+ },
+ "env": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "sourceFileMap": {
+ "/Views": "${workspaceFolder}/Views"
+ }
+ },
+ {
+ "name": ".NET Core Attach",
+ "type": "coreclr",
+ "request": "attach"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/EDA Viewer/.vscode/tasks.json b/EDA Viewer/.vscode/tasks.json
new file mode 100644
index 0000000..2f27760
--- /dev/null
+++ b/EDA Viewer/.vscode/tasks.json
@@ -0,0 +1,41 @@
+{
+ "version": "2.0.0",
+ "tasks": [
+ {
+ "label": "build",
+ "command": "dotnet",
+ "type": "process",
+ "args": [
+ "build",
+ "${workspaceFolder}/EDA Viewer.csproj",
+ "/property:GenerateFullPaths=true",
+ "/consoleloggerparameters:NoSummary"
+ ],
+ "problemMatcher": "$msCompile"
+ },
+ {
+ "label": "publish",
+ "command": "dotnet",
+ "type": "process",
+ "args": [
+ "publish",
+ "${workspaceFolder}/EDA Viewer.csproj",
+ "/property:GenerateFullPaths=true",
+ "/consoleloggerparameters:NoSummary"
+ ],
+ "problemMatcher": "$msCompile"
+ },
+ {
+ "label": "watch",
+ "command": "dotnet",
+ "type": "process",
+ "args": [
+ "watch",
+ "run",
+ "--project",
+ "${workspaceFolder}/EDA Viewer.csproj"
+ ],
+ "problemMatcher": "$msCompile"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/EDA Viewer/Blazor/Counter.razor b/EDA Viewer/Blazor/Counter.razor
deleted file mode 100644
index ee23e7a..0000000
--- a/EDA Viewer/Blazor/Counter.razor
+++ /dev/null
@@ -1,16 +0,0 @@
-
Counter
-
-
- Current Count: @i
-
-
-
-
-@code {
- int i = 0;
-
- private void IncrementCounter()
- {
- i += 1;
- }
-}
diff --git a/EDA Viewer/Controllers/HomeController.cs b/EDA Viewer/Controllers/HomeController.cs
deleted file mode 100644
index cdd721b..0000000
--- a/EDA Viewer/Controllers/HomeController.cs
+++ /dev/null
@@ -1,167 +0,0 @@
-using EDAViewer.Models;
-using Microsoft.AspNetCore.Http;
-using Microsoft.AspNetCore.Mvc;
-using Microsoft.AspNetCore.Mvc.Rendering;
-using Microsoft.Extensions.Logging;
-using Shared;
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.IO;
-using System.Linq;
-using System.Web;
-
-namespace EDAViewer.Controllers
-{
-
- public class HomeController : Controller, IHomeController
- {
-
- private readonly Log _Log;
- private readonly AppSettings _AppSettings;
- private readonly IsEnvironment _IsEnvironment;
- private readonly Singleton.IBackground _Background;
-
- public HomeController(ILogger logger, IsEnvironment isEnvironment, Singleton.IBackground background, AppSettings appSettings)
- {
- _Log = new Log(logger);
- _Background = background;
- _AppSettings = appSettings;
- _IsEnvironment = isEnvironment;
- }
-
- public IActionResult Index()
- {
- return View();
- }
-
- public IActionResult Privacy()
- {
- return View();
- }
-
- [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
- public IActionResult Error()
- {
- return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
- }
-
- public IActionResult Encode(string value = null)
- {
- string result = string.Empty;
- if (!string.IsNullOrEmpty(value))
- result = HttpUtility.UrlEncode(value);
- return Content(result, "text/plain");
- }
-
- public IActionResult Background(bool? message_clear = null, bool? exceptions_clear = null, bool? set_is_primary_instance = null, int? invoke_eda_dcp = null)
- {
- _Background.SendStatusOk();
- if (message_clear.HasValue && message_clear.Value)
- _Background.ClearMessage();
- if (exceptions_clear.HasValue && exceptions_clear.Value)
- _Background.Exceptions.Clear();
- if (set_is_primary_instance.HasValue)
- {
- if (set_is_primary_instance.Value)
- _Background.SetIsPrimaryInstance();
- else
- _Background.ClearIsPrimaryInstance();
- }
- string message;
- if (string.IsNullOrWhiteSpace(_Background.Message))
- message = "N/A";
- else
- message = _Background.Message;
- //Response.AppendToLog(_Background.Message);
- List exceptions = new();
- foreach (Exception exception in _Background.Exceptions)
- exceptions.Add(exception);
- ViewBag.Message = message;
- ViewBag.Exceptions = exceptions;
- ViewBag.URLs = _AppSettings.URLs;
- ViewBag.Profile = _IsEnvironment.Profile;
- ViewBag.WorkingDirectory = _Background.WorkingDirectory;
- ViewBag.IsPrimaryInstance = _Background.IsPrimaryInstance();
- ViewBag.ExceptionsCount = string.Concat("Exception(s) - ", exceptions.Count);
- return View();
- }
-
- public ActionResult> GetDirectoriesOrFiles(string path = null, bool? upDirectory = null, string filter = null)
- {
- List results = new();
- //System.Threading.Thread.Sleep(1500);
- //path = @"D:\Tmp";
- if (string.IsNullOrEmpty(path))
- path = string.Concat(@"\\", _AppSettings.Server, @"\EC_EDA");
- if (string.IsNullOrEmpty(filter))
- filter = "*";
- if (upDirectory.HasValue && upDirectory.Value && path.Contains('|'))
- {
- string[] segments = path.Split('|');
- path = segments[^1];
- }
- //System.IO.File.AppendAllText(string.Concat(@"\\", _AppSettings.Server, @"\EC_EDA\a.txt"), path);
- string gold = "Gold";
- if (System.IO.File.Exists(path))
- {
- string[] files = Directory.GetFiles(Path.GetDirectoryName(path), filter, SearchOption.TopDirectoryOnly);
- foreach (string item in files)
- results.Add(new SelectListItem() { Value = item, Text = Path.GetFileName(item), Group = new SelectListGroup() { Name = "File(s)" } });
- if (results.Count > 1)
- results.Insert(0, new SelectListItem() { Value = string.Empty, Text = string.Concat("Select - ", 0, " - ", files.Length) });
- }
- else if (Directory.Exists(path))
- {
- string[] files = Directory.GetFiles(path, filter, SearchOption.TopDirectoryOnly);
- string[] directories = Directory.GetDirectories(path, filter, SearchOption.TopDirectoryOnly).Where(l => Path.GetFileName(l) != gold).ToArray();
- for (short i = 0; i < short.MaxValue; i++)
- {
- if (directories.Length != 1 || files.Length != 0)
- break;
- else
- {
- path = directories[0];
- files = Directory.GetFiles(path, filter, SearchOption.TopDirectoryOnly);
- directories = Directory.GetDirectories(path, filter, SearchOption.TopDirectoryOnly).Where(l => Path.GetFileName(l) != gold).ToArray();
- if (directories.Length == 0 && files.Length == 0)
- {
- directories = new string[] { path };
- break;
- }
- }
- }
- foreach (string item in directories)
- results.Add(new SelectListItem() { Value = item, Text = Path.GetFileName(item), Group = new SelectListGroup() { Name = "Directorie(s)" } });
- foreach (string item in files)
- results.Add(new SelectListItem() { Value = item, Text = Path.GetFileName(item), Group = new SelectListGroup() { Name = "File(s)" } });
- if (results.Count > 1)
- results.Insert(0, new SelectListItem() { Value = string.Empty, Text = string.Concat("Select - ", directories.Length, " - ", files.Length) });
- }
- //System.IO.File.AppendAllText(string.Concat(@"\\", _AppSettings.Server, @"\EC_EDA\b.txt"), results.Count.ToString());
- if (!results.Any())
- results.Add(new SelectListItem() { Value = path, Text = string.Concat("Nothing Found *{", path, "}") });
- return results;
- }
-
- public IActionResult ViewEdaHtmlDiff(WithEnvironment withEnvironment = null)
- {
- if (withEnvironment is null)
- withEnvironment = new WithEnvironment();
- string path = string.Concat(@"\\", _AppSettings.Server, @"\EC_EDA");
- if (!Directory.Exists(path))
- path = @"C:\";
- EdaHtmlDiff model = new(withEnvironment, path);
- ViewBag.message = model.message;
- return View(model);
- }
-
- }
-
-}
-// dotnet publish --configuration Release --runtime win-x64 --verbosity normal --self-contained true -o "L:\net5.0\EDAViewer"
-// dotnet publish --configuration Release --runtime win-x64 --verbosity normal --self-contained true -o "D:\net5.0\EDAViewer"
-// dotnet publish --configuration Release --runtime win-x64 --verbosity normal --self-contained true -o "D:\.jenkins\publish\manual-Mesa-0\EDAViewer"
-//http://eaf-dev.mes.infineon.com:8080/job/Mesa/buildWithParameters?token=DotnetRules&projectName=EDA%20Viewer
-//http://eaf-prod.mes.infineon.com:8080/job/Mesa/buildWithParameters?token=DotnetRules&projectName=EDA%20Viewer
-//sc create EDAViewer_5003 binPath="D:\.jenkins\publish\manual-Mesa-0\EDAViewer\EDA Viewer.exe"
\ No newline at end of file
diff --git a/EDA Viewer/EDA Viewer.csproj b/EDA Viewer/EDA Viewer.csproj
index 3678b76..4d49b32 100644
--- a/EDA Viewer/EDA Viewer.csproj
+++ b/EDA Viewer/EDA Viewer.csproj
@@ -6,11 +6,16 @@
SAK
- 9.0
- net6.0
- EDAViewer
OutOfProcess
- d71a673c-be39-45b5-ae5f-4c22639be045
+ enable
+ false
+ 10.0
+ enable
+ EDAViewer
+ win-x64
+ net6.0
+
+
true
true
true
@@ -26,24 +31,18 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/EDA Viewer/GlobalSuppressions.cs b/EDA Viewer/GlobalSuppressions.cs
deleted file mode 100644
index 40157e5..0000000
--- a/EDA Viewer/GlobalSuppressions.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-// This file is used by Code Analysis to maintain SuppressMessage
-// attributes that are applied to this project.
-// Project-level suppressions either have no target or are given
-// a specific target and scoped to a namespace, type, member, etc.
-
-using System.Diagnostics.CodeAnalysis;
-[assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "", Scope = "member", Target = "~P:EDAViewer.Models.WithEnvironment.message")]
-[assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "", Scope = "member", Target = "~P:EDAViewer.Models.WithEnvironment.now_ticks")]
-[assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "", Scope = "member", Target = "~P:EDAViewer.Models.WithEnvironment.user_name")]
-[assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "", Scope = "member", Target = "~P:EDAViewer.Models.WithEnvironment.machine_name")]
\ No newline at end of file
diff --git a/EDA Viewer/HostedService/TimedHostedService.cs b/EDA Viewer/HostedService/TimedHostedService.cs
index 85aa0a1..5c8c474 100644
--- a/EDA Viewer/HostedService/TimedHostedService.cs
+++ b/EDA Viewer/HostedService/TimedHostedService.cs
@@ -1,174 +1,171 @@
+using EDAViewer.Models.Methods;
+using EDAViewer.Models.Stateless;
+using EDAViewer.Models.Stateless.Methods;
using EDAViewer.Singleton;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Hosting;
-using Microsoft.Extensions.Logging;
-using Shared;
-using System;
-using System.IO;
-using System.Threading;
-using System.Threading.Tasks;
+using IFX.Shared;
+using Serilog.Context;
-namespace EDAViewer.HostedService
+namespace EDAViewer.HostedService;
+
+public class TimedHostedService : IHostedService, IDisposable
{
- public class TimedHostedService : IHostedService, IDisposable
+ private readonly Timer _EDAOutputArchiveTimer;
+ private readonly Timer _LogPathCleanUpByWeekTimer;
+ private readonly Timer _EdaDataCollectionPlansTimer;
+
+ private readonly int _ExecutionCount;
+ private readonly Serilog.ILogger _Log;
+ private readonly IsEnvironment _IsEnvironment;
+ private readonly IBackground _BackgroundMethods;
+ private readonly Models.Properties.IBackground _Background;
+
+ public TimedHostedService(IsEnvironment isEnvironment, Background background)
{
+ _ExecutionCount = 0;
+ _Background = background;
+ _IsEnvironment = isEnvironment;
+ _BackgroundMethods = background;
+ _Log = Serilog.Log.ForContext();
+ _EDAOutputArchiveTimer = new Timer(EDAOutputArchiveCallback, null, Timeout.Infinite, Timeout.Infinite);
+ _LogPathCleanUpByWeekTimer = new Timer(LogPathCleanUpByWeekCallback, null, Timeout.Infinite, Timeout.Infinite);
+ _EdaDataCollectionPlansTimer = new Timer(EdaDataCollectionPlansCallback, null, Timeout.Infinite, Timeout.Infinite);
+ }
- private readonly int _ExecutionCount;
- private readonly Background _Background;
- private readonly IsEnvironment _IsEnvironment;
- private readonly ILogger _Log;
-
- private Timer _EDAOutputArchiveTimer;
- private Timer _LogPathCleanUpByWeekTimer;
- private Timer _EdaDataCollectionPlansTimer;
-
- public TimedHostedService(IsEnvironment isEnvironment, Background background, IServiceProvider serviceProvider)
+ public Task StartAsync(CancellationToken stoppingToken)
+ {
+ string? methodName = IMethodName.GetActualAsyncMethodName();
+ using (LogContext.PushProperty("MethodName", methodName))
{
- _ExecutionCount = 0;
- _Background = background;
- _IsEnvironment = isEnvironment;
- _Log = serviceProvider.GetRequiredService>();
- _EDAOutputArchiveTimer = new Timer(EDAOutputArchiveCallback, null, Timeout.Infinite, Timeout.Infinite);
- _LogPathCleanUpByWeekTimer = new Timer(LogPathCleanUpByWeekCallback, null, Timeout.Infinite, Timeout.Infinite);
- _EdaDataCollectionPlansTimer = new Timer(EdaDataCollectionPlansCallback, null, Timeout.Infinite, Timeout.Infinite);
- }
-
- public Task StartAsync(CancellationToken stoppingToken)
- {
- _Log.LogInformation(string.Concat("Timed Hosted Service: ", nameof(Background), ":", _IsEnvironment.Profile, ":", Environment.ProcessId, " running."));
- _Background.Update(_Log);
+ _Log.Info(string.Concat("Timed Hosted Service: ", _IsEnvironment.Profile, ":", Environment.ProcessId, " running."));
+ int milliSeconds = 3000;
if (_IsEnvironment.Development)
{
- int milliSeconds = 3000;
- _EdaDataCollectionPlansTimer.Change(milliSeconds, Timeout.Infinite);
- ;
+ _BackgroundMethods.Update(milliSeconds);
+ _ = _EdaDataCollectionPlansTimer.Change(milliSeconds, Timeout.Infinite);
_Background.Timers.Add(_EdaDataCollectionPlansTimer);
milliSeconds += 2000;
}
else if (_IsEnvironment.Staging)
{
- int milliSeconds = 3000;
- _LogPathCleanUpByWeekTimer.Change(milliSeconds, Timeout.Infinite);
- ;
- _Background.Timers.Add(_LogPathCleanUpByWeekTimer);
- milliSeconds += 2000;
- _EdaDataCollectionPlansTimer.Change(milliSeconds, Timeout.Infinite);
- ;
+ _BackgroundMethods.Update(milliSeconds);
+ _ = _EdaDataCollectionPlansTimer.Change(milliSeconds, Timeout.Infinite);
_Background.Timers.Add(_EdaDataCollectionPlansTimer);
milliSeconds += 2000;
- _EDAOutputArchiveTimer.Change(milliSeconds, Timeout.Infinite);
- ;
+ _ = _EDAOutputArchiveTimer.Change(milliSeconds, Timeout.Infinite);
_Background.Timers.Add(_EDAOutputArchiveTimer);
milliSeconds += 2000;
+ _ = _LogPathCleanUpByWeekTimer.Change(milliSeconds, Timeout.Infinite);
+ _Background.Timers.Add(_LogPathCleanUpByWeekTimer);
+ milliSeconds += 2000;
}
else if (_IsEnvironment.Production)
{
- int milliSeconds = 3000;
- _LogPathCleanUpByWeekTimer.Change(milliSeconds, Timeout.Infinite);
- ;
- _Background.Timers.Add(_LogPathCleanUpByWeekTimer);
- milliSeconds += 2000;
- _EdaDataCollectionPlansTimer.Change(milliSeconds, Timeout.Infinite);
- ;
+ _BackgroundMethods.Update(milliSeconds);
+ _ = _EdaDataCollectionPlansTimer.Change(milliSeconds, Timeout.Infinite);
_Background.Timers.Add(_EdaDataCollectionPlansTimer);
milliSeconds += 2000;
- _EDAOutputArchiveTimer.Change(milliSeconds, Timeout.Infinite);
- ;
+ _ = _EDAOutputArchiveTimer.Change(milliSeconds, Timeout.Infinite);
_Background.Timers.Add(_EDAOutputArchiveTimer);
milliSeconds += 2000;
+ _ = _LogPathCleanUpByWeekTimer.Change(milliSeconds, Timeout.Infinite);
+ _Background.Timers.Add(_LogPathCleanUpByWeekTimer);
+ milliSeconds += 2000;
}
else
throw new Exception();
if (_IsEnvironment.Staging || _IsEnvironment.Production)
{
- string countDirectory = _Background.GetCountDirectory("Start");
- string checkDirectory = Path.GetPathRoot(countDirectory);
+ string countDirectory = _BackgroundMethods.GetCountDirectory("Start");
+ string? checkDirectory = Path.GetPathRoot(countDirectory);
if (Directory.Exists(checkDirectory))
- Directory.CreateDirectory(countDirectory);
+ _ = Directory.CreateDirectory(countDirectory);
}
- return Task.CompletedTask;
}
+ return Task.CompletedTask;
+ }
- public Task StopAsync(CancellationToken stoppingToken)
+ public Task StopAsync(CancellationToken stoppingToken)
+ {
+ string? methodName = IMethodName.GetActualAsyncMethodName();
+ using (LogContext.PushProperty("MethodName", methodName))
{
- _Log.LogInformation(string.Concat("Timed Hosted Service: ", nameof(Background), ":", _IsEnvironment.Profile, ":", Environment.ProcessId, " is stopping."));
- _Background.Stop(immediate: true);
+ _Log.Info(string.Concat("Timed Hosted Service: ", _IsEnvironment.Profile, ":", Environment.ProcessId, " is stopping."));
+ _BackgroundMethods.Stop(immediate: true);
for (short i = 0; i < short.MaxValue; i++)
{
Thread.Sleep(500);
if (_ExecutionCount == 0)
break;
}
- return Task.CompletedTask;
}
+ return Task.CompletedTask;
+ }
- public void Dispose()
+ public void Dispose()
+ {
+ _BackgroundMethods.Dispose();
+ GC.SuppressFinalize(this);
+ }
+
+ private void LogPathCleanUpByWeekCallback(object? state)
+ {
+ try
{
- _Background.Dispose();
+ if (!_BackgroundMethods.IsPrimaryInstance())
+ _BackgroundMethods.LogPathCleanUpByWeekCallback();
}
-
- private void LogPathCleanUpByWeekCallback(object state)
+ catch (Exception e) { _Log.Error(e, "Error: "); }
+ try
{
- try
- {
- if (_Background.IsPrimaryInstance())
- _Background.LogPathCleanUpByWeekCallback();
- }
- catch (Exception e) { _Background.Catch(e); }
- try
- {
- TimeSpan timeSpan;
- if (!_Background.IsPrimaryInstance())
- timeSpan = new TimeSpan(DateTime.Now.AddSeconds(15).Ticks - DateTime.Now.Ticks);
- else
- timeSpan = new TimeSpan(DateTime.Now.AddHours(6).Ticks - DateTime.Now.Ticks);
- _LogPathCleanUpByWeekTimer.Change((int)timeSpan.TotalMilliseconds, Timeout.Infinite);
- }
- catch (Exception e) { _Background.Catch(e); }
+ TimeSpan timeSpan;
+ if (!_BackgroundMethods.IsPrimaryInstance())
+ timeSpan = new TimeSpan(DateTime.Now.AddSeconds(15).Ticks - DateTime.Now.Ticks);
+ else
+ timeSpan = new TimeSpan(DateTime.Now.AddHours(6).Ticks - DateTime.Now.Ticks);
+ _ = _LogPathCleanUpByWeekTimer.Change((int)timeSpan.TotalMilliseconds, Timeout.Infinite);
}
+ catch (Exception e) { _Log.Error(e, "Error: "); }
+ }
- private void EDAOutputArchiveCallback(object state)
+ private void EDAOutputArchiveCallback(object? state)
+ {
+ try
{
- try
- {
- if (_Background.IsPrimaryInstance())
- _Background.EDAOutputArchiveCallback();
- }
- catch (Exception e) { _Background.Catch(e); }
- try
- {
- TimeSpan timeSpan;
- if (!_Background.IsPrimaryInstance())
- timeSpan = new TimeSpan(DateTime.Now.AddSeconds(15).Ticks - DateTime.Now.Ticks);
- else
- timeSpan = new TimeSpan(DateTime.Now.AddHours(6).Ticks - DateTime.Now.Ticks);
- _EDAOutputArchiveTimer.Change((int)timeSpan.TotalMilliseconds, Timeout.Infinite);
- }
- catch (Exception e) { _Background.Catch(e); }
+ if (!_BackgroundMethods.IsPrimaryInstance())
+ _BackgroundMethods.EDAOutputArchiveCallback();
}
-
- private void EdaDataCollectionPlansCallback(object state)
+ catch (Exception e) { _Log.Error(e, "Error: "); }
+ try
{
- try
- {
- if (_Background.IsPrimaryInstance())
- _Background.EdaDataCollectionPlansCallback();
- }
- catch (Exception e) { _Background.Catch(e); }
- try
- {
- TimeSpan timeSpan;
- if (!_Background.IsPrimaryInstance())
- timeSpan = new TimeSpan(DateTime.Now.AddSeconds(15).Ticks - DateTime.Now.Ticks);
- else
- timeSpan = new TimeSpan(DateTime.Now.AddHours(2).Ticks - DateTime.Now.Ticks);
- _EdaDataCollectionPlansTimer.Change((int)timeSpan.TotalMilliseconds, Timeout.Infinite);
- }
- catch (Exception e) { _Background.Catch(e); }
+ TimeSpan timeSpan;
+ if (!_BackgroundMethods.IsPrimaryInstance())
+ timeSpan = new TimeSpan(DateTime.Now.AddSeconds(15).Ticks - DateTime.Now.Ticks);
+ else
+ timeSpan = new TimeSpan(DateTime.Now.AddHours(6).Ticks - DateTime.Now.Ticks);
+ _ = _EDAOutputArchiveTimer.Change((int)timeSpan.TotalMilliseconds, Timeout.Infinite);
}
+ catch (Exception e) { _Log.Error(e, "Error: "); }
+ }
-
+ private void EdaDataCollectionPlansCallback(object? state)
+ {
+ try
+ {
+ if (!_BackgroundMethods.IsPrimaryInstance())
+ _BackgroundMethods.EdaDataCollectionPlansCallback();
+ }
+ catch (Exception e) { _Log.Error(e, "Error: "); }
+ try
+ {
+ TimeSpan timeSpan;
+ if (!_BackgroundMethods.IsPrimaryInstance())
+ timeSpan = new TimeSpan(DateTime.Now.AddSeconds(15).Ticks - DateTime.Now.Ticks);
+ else
+ timeSpan = new TimeSpan(DateTime.Now.AddHours(2).Ticks - DateTime.Now.Ticks);
+ _ = _EdaDataCollectionPlansTimer.Change((int)timeSpan.TotalMilliseconds, Timeout.Infinite);
+ }
+ catch (Exception e) { _Log.Error(e, "Error: "); }
}
}
\ No newline at end of file
diff --git a/EDA Viewer/IFX/Shared/IsEnvironment.cs b/EDA Viewer/IFX/Shared/IsEnvironment.cs
new file mode 100644
index 0000000..93b802f
--- /dev/null
+++ b/EDA Viewer/IFX/Shared/IsEnvironment.cs
@@ -0,0 +1,167 @@
+using System.Diagnostics;
+using System.Runtime.InteropServices;
+
+namespace IFX.Shared;
+
+public class IsEnvironment
+{
+
+ public enum Name
+ {
+ LinuxDevelopment,
+ LinuxProduction,
+ LinuxStaging,
+ OSXDevelopment,
+ OSXProduction,
+ OSXStaging,
+ WindowsDevelopment,
+ WindowsProduction,
+ WindowsStaging
+ }
+
+ public bool DebuggerWasAttachedDuringConstructor { get; private set; }
+ public bool Development { get; private set; }
+ public bool Linux { get; private set; }
+ public bool OSX { get; private set; }
+ public bool Production { get; private set; }
+ public bool Staging { get; private set; }
+ public bool Windows { get; private set; }
+ public string Profile { get; private set; }
+ public string AppSettingsFileName { get; private set; }
+ public string? ASPNetCoreEnvironment { get; private set; }
+
+ public IsEnvironment(string testCategory)
+ {
+ if (testCategory.EndsWith(".json"))
+ {
+ Production = testCategory == "appsettings.json";
+ Staging = testCategory.EndsWith(nameof(Staging));
+ OSX = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
+ Development = testCategory.EndsWith(nameof(Development));
+ Linux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
+ DebuggerWasAttachedDuringConstructor = Debugger.IsAttached;
+ Windows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
+ ASPNetCoreEnvironment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
+ }
+ else
+ {
+ DebuggerWasAttachedDuringConstructor = Debugger.IsAttached;
+ OSX = !string.IsNullOrEmpty(testCategory) && testCategory.StartsWith(nameof(OSX));
+ ASPNetCoreEnvironment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
+ Linux = !string.IsNullOrEmpty(testCategory) && testCategory.StartsWith(nameof(Linux));
+ Staging = !string.IsNullOrEmpty(testCategory) && testCategory.EndsWith(nameof(Staging));
+ Windows = !string.IsNullOrEmpty(testCategory) && testCategory.StartsWith(nameof(Windows));
+ Production = !string.IsNullOrEmpty(testCategory) && testCategory.EndsWith(nameof(Production));
+ Development = !string.IsNullOrEmpty(testCategory) && testCategory.EndsWith(nameof(Development));
+ }
+ Profile = GetProfile();
+ AppSettingsFileName = GetAppSettingsFileName(processesCount: null);
+ }
+
+ public IsEnvironment(bool isDevelopment, bool isStaging, bool isProduction)
+ {
+ Staging = isStaging;
+ Production = isProduction;
+ Development = isDevelopment;
+ OSX = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
+ Linux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
+ DebuggerWasAttachedDuringConstructor = Debugger.IsAttached;
+ Windows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
+ ASPNetCoreEnvironment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
+ Profile = GetProfile();
+ AppSettingsFileName = GetAppSettingsFileName(processesCount: null);
+ }
+
+ public IsEnvironment(int? processesCount, bool nullASPNetCoreEnvironmentIsDevelopment, bool nullASPNetCoreEnvironmentIsProduction)
+ {
+ OSX = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
+ Linux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
+ DebuggerWasAttachedDuringConstructor = Debugger.IsAttached;
+ Windows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
+ ASPNetCoreEnvironment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
+ if (nullASPNetCoreEnvironmentIsDevelopment && nullASPNetCoreEnvironmentIsProduction)
+ throw new Exception();
+ else if (string.IsNullOrEmpty(ASPNetCoreEnvironment) && nullASPNetCoreEnvironmentIsProduction)
+ Production = true;
+ else if (string.IsNullOrEmpty(ASPNetCoreEnvironment) && nullASPNetCoreEnvironmentIsDevelopment)
+ Development = true;
+ else if (string.IsNullOrEmpty(ASPNetCoreEnvironment) && !nullASPNetCoreEnvironmentIsDevelopment && !nullASPNetCoreEnvironmentIsProduction)
+ throw new Exception();
+ else
+ {
+ Staging = ASPNetCoreEnvironment is not null && ASPNetCoreEnvironment.EndsWith(nameof(Staging));
+ Production = ASPNetCoreEnvironment is not null && ASPNetCoreEnvironment.EndsWith(nameof(Production));
+ Development = ASPNetCoreEnvironment is not null && ASPNetCoreEnvironment.EndsWith(nameof(Development));
+ }
+ Profile = GetProfile();
+ AppSettingsFileName = GetAppSettingsFileName(processesCount);
+ }
+
+ private string GetProfile()
+ {
+ string result;
+ if (Windows && Production)
+ result = nameof(Production);
+ else if (Windows && Staging)
+ result = nameof(Staging);
+ else if (Windows && Development)
+ result = nameof(Development);
+ else if (Linux && Production)
+ result = nameof(Name.LinuxProduction);
+ else if (Linux && Staging)
+ result = nameof(Name.LinuxStaging);
+ else if (Linux && Development)
+ result = nameof(Name.LinuxDevelopment);
+ else if (OSX && Production)
+ result = nameof(Name.OSXProduction);
+ else if (OSX && Staging)
+ result = nameof(Name.OSXStaging);
+ else if (OSX && Development)
+ result = nameof(Name.OSXDevelopment);
+ else
+ throw new Exception();
+ return result;
+ }
+
+ private string GetAppSettingsFileName(int? processesCount)
+ {
+ string result;
+ if (Production)
+ {
+ if (processesCount is null)
+ result = "appsettings.json";
+ else
+ result = $"appsettings.{processesCount}.json";
+ }
+ else
+ {
+ string environment;
+ if (Staging)
+ environment = nameof(Staging);
+ else if (Development)
+ environment = nameof(Development);
+ else
+ throw new Exception();
+ if (processesCount is null)
+ result = $"appsettings.{environment}.json";
+ else
+ result = $"appsettings.{environment}.{processesCount}.json";
+ }
+ return result;
+ }
+
+ public static string GetEnvironmentName(IsEnvironment isEnvironment)
+ {
+ string result;
+ if (isEnvironment.Windows)
+ result = nameof(Windows);
+ else if (isEnvironment.Linux)
+ result = nameof(Linux);
+ else if (isEnvironment.OSX)
+ result = nameof(OSX);
+ else
+ throw new Exception();
+ return result;
+ }
+
+}
\ No newline at end of file
diff --git a/EDA Viewer/IFX/Shared/RijndaelEncryption.cs b/EDA Viewer/IFX/Shared/RijndaelEncryption.cs
new file mode 100644
index 0000000..1ebbf72
--- /dev/null
+++ b/EDA Viewer/IFX/Shared/RijndaelEncryption.cs
@@ -0,0 +1,93 @@
+#pragma warning disable SYSLIB0022
+
+using System.Security.Cryptography;
+using System.Text;
+using System.Text.RegularExpressions;
+
+namespace IFX.Shared;
+
+public static class RijndaelEncryption
+{
+ ///
+ /// Change the Inputkey GUID when you use this code in your own program.
+ /// Keep this inputkey very safe and prevent someone from decoding it some way!!
+ /// Generated 2021-08-10
+ ///
+ internal const string _Inputkey = "970CCEF6-4307-4F6A-9AC8-377DADB889BD";
+
+ ///
+ /// Encrypt the given text and give the byte array back as a BASE64 string
+ ///
+ /// The text to encrypt
+ /// The pasword salt
+ /// The encrypted text
+ public static string Encrypt(string text, string salt)
+ {
+ string result;
+ if (string.IsNullOrEmpty(text))
+ throw new ArgumentNullException(nameof(text));
+ RijndaelManaged aesAlg = NewRijndaelManaged(salt);
+ ICryptoTransform encryptor = aesAlg.CreateEncryptor(aesAlg.Key, aesAlg.IV);
+ MemoryStream msEncrypt = new();
+ using (CryptoStream csEncrypt = new(msEncrypt, encryptor, CryptoStreamMode.Write))
+ using (StreamWriter swEncrypt = new(csEncrypt))
+ swEncrypt.Write(text);
+ result = Convert.ToBase64String(msEncrypt.ToArray());
+ return result;
+ }
+
+ ///
+ /// Checks if a string is base64 encoded
+ ///
+ /// The base64 encoded string
+ ///
+ public static bool IsBase64String(string base64String)
+ {
+ bool result;
+ base64String = base64String.Trim();
+ result = (base64String.Length % 4 == 0) && Regex.IsMatch(base64String, @"^[a-zA-Z0-9\+/]*={0,3}$", RegexOptions.None);
+ return result;
+ }
+
+ ///
+ /// Decrypts the given text
+ ///
+ /// The encrypted BASE64 text
+ /// The pasword salt
+ /// De gedecrypte text
+ public static string Decrypt(string cipherText, string salt)
+ {
+ if (string.IsNullOrEmpty(cipherText))
+ throw new ArgumentNullException(nameof(cipherText));
+ if (!IsBase64String(cipherText))
+ throw new Exception("The cipherText input parameter is not base64 encoded");
+ string text;
+ RijndaelManaged aesAlg = NewRijndaelManaged(salt);
+ ICryptoTransform decryptor = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV);
+ byte[] cipher = Convert.FromBase64String(cipherText);
+ using (MemoryStream msDecrypt = new(cipher))
+ {
+ using CryptoStream csDecrypt = new(msDecrypt, decryptor, CryptoStreamMode.Read);
+ using StreamReader srDecrypt = new(csDecrypt);
+ text = srDecrypt.ReadToEnd();
+ }
+ return text;
+ }
+
+ ///
+ /// Create a new RijndaelManaged class and initialize it
+ ///
+ /// The pasword salt
+ ///
+ private static RijndaelManaged NewRijndaelManaged(string salt)
+ {
+ if (salt == null)
+ throw new ArgumentNullException(nameof(salt));
+ byte[] saltBytes = Encoding.ASCII.GetBytes(salt);
+ Rfc2898DeriveBytes key = new(_Inputkey, saltBytes);
+ RijndaelManaged aesAlg = new();
+ aesAlg.Key = key.GetBytes(aesAlg.KeySize / 8);
+ aesAlg.IV = key.GetBytes(aesAlg.BlockSize / 8);
+ return aesAlg;
+ }
+}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/Core/AutoGenerated/BackboneComponent.cs b/EDA Viewer/Library/Eaf/Core/AutoGenerated/BackboneComponent.cs
deleted file mode 100644
index 02f026c..0000000
--- a/EDA Viewer/Library/Eaf/Core/AutoGenerated/BackboneComponent.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace Library.Eaf.Core
-{
- public class BackboneComponent
- {
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/Core/AutoGenerated/BackboneStatusCache.cs b/EDA Viewer/Library/Eaf/Core/AutoGenerated/BackboneStatusCache.cs
deleted file mode 100644
index 3f03747..0000000
--- a/EDA Viewer/Library/Eaf/Core/AutoGenerated/BackboneStatusCache.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace Library.Eaf.Core
-{
- public class BackboneStatusCache
- {
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/Core/AutoGenerated/ILoggingSetupManager.cs b/EDA Viewer/Library/Eaf/Core/AutoGenerated/ILoggingSetupManager.cs
deleted file mode 100644
index d8de627..0000000
--- a/EDA Viewer/Library/Eaf/Core/AutoGenerated/ILoggingSetupManager.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace Library.Eaf.Core
-{
- public interface ILoggingSetupManager
- {
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/Core/AutoGenerated/StatusItem.cs b/EDA Viewer/Library/Eaf/Core/AutoGenerated/StatusItem.cs
deleted file mode 100644
index c895fc2..0000000
--- a/EDA Viewer/Library/Eaf/Core/AutoGenerated/StatusItem.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace Library.Eaf.Core
-{
- public class StatusItem
- {
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/Core/Backbone.cs b/EDA Viewer/Library/Eaf/Core/Backbone.cs
deleted file mode 100644
index 845b46b..0000000
--- a/EDA Viewer/Library/Eaf/Core/Backbone.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-using Library.PeerGroup.GCL.Annotations;
-using System;
-using System.Collections.Generic;
-
-namespace Library.Eaf.Core
-{
- public class Backbone
- {
- public const string STATE_ERROR = "Error";
- public const string STATE_OFFLINE = "Offline";
- public const string STATE_RUNNING = "Running";
- public const string STATE_SHUTDOWN = "Shutting Down";
- public const string STATE_STARTING = "Starting";
-
- protected Backbone() { }
-
- [NotNull]
- public static Backbone Instance { get; }
- [NotNull]
- public ILoggingSetupManager LoggingConfigurationManager { get; set; }
- public BackboneStatusCache Status { get; }
- public bool IsAutomatedRestartActive { get; }
- public bool IsReadyForRestart { get; }
- public string StartTime { get; }
- public string State { get; }
- public string Name { get; }
- public string ConfigurationServiceAddress { get; }
- public string CellName { get; }
- protected bool IsInitialized { get; set; }
- protected Dictionary BackboneComponents { get; }
-
- public void AddBackboneComponent(BackboneComponent backboneComponent) { }
- public bool ContainsBackboneComponent(string id) { throw new NotImplementedException(); }
- [Obsolete("Use the capabilities exposed via the Status property -> GetAll. Will be removed with next major release.")]
- public List GetAllStatuses() { throw new NotImplementedException(); }
- public BackboneComponent GetBackboneComponentById(string id) { throw new NotImplementedException(); }
- public List GetBackboneComponentsOfType() { throw new NotImplementedException(); }
- public List GetBackboneComponentsOfType(Type type) { throw new NotImplementedException(); }
- public void RegisterSubprocess(int pid) { }
- [Obsolete("Use the capabilities exposed via the Status property -> SetValue. Will be removed with next major release.")]
- public void SetStatus(string statusName, string statusValue) { }
- [Obsolete("Use the capabilities exposed via the Status property -> SetValue. Will be removed with next major release.")]
- public void SetStatus(BackboneComponent source, string statusName, string statusValue) { }
- protected void CloseConnectionOfComponents(List components) { }
- protected virtual void StopAllComponents() { }
- protected void StopComponents(List components) { }
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/Core/Smtp/EmailMessage.cs b/EDA Viewer/Library/Eaf/Core/Smtp/EmailMessage.cs
deleted file mode 100644
index c727cd5..0000000
--- a/EDA Viewer/Library/Eaf/Core/Smtp/EmailMessage.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using System;
-
-namespace Library.Eaf.Core.Smtp
-{
-
- public class EmailMessage
- {
- public EmailMessage() { }
- public EmailMessage(string subject, string body, MailPriority priority = MailPriority.Normal) { }
-
- public string Body { get; }
- public MailPriority Priority { get; }
- public string Subject { get; }
-
- public EmailMessage PriorityHigh() { throw new NotImplementedException(); }
- public EmailMessage PriorityLow() { throw new NotImplementedException(); }
- public EmailMessage PriorityNormal() { throw new NotImplementedException(); }
- public EmailMessage SetBody(string body) { throw new NotImplementedException(); }
- public EmailMessage SetPriority(MailPriority priority) { throw new NotImplementedException(); }
- public EmailMessage SetSubject(string subject) { throw new NotImplementedException(); }
-
- }
-
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/Core/Smtp/ISmtp.cs b/EDA Viewer/Library/Eaf/Core/Smtp/ISmtp.cs
deleted file mode 100644
index d7604c3..0000000
--- a/EDA Viewer/Library/Eaf/Core/Smtp/ISmtp.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-namespace Library.Eaf.Core.Smtp
-{
-
- public interface ISmtp
- {
- void Send(EmailMessage message);
- }
-
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/Core/Smtp/MailPriority.cs b/EDA Viewer/Library/Eaf/Core/Smtp/MailPriority.cs
deleted file mode 100644
index e6d37a0..0000000
--- a/EDA Viewer/Library/Eaf/Core/Smtp/MailPriority.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-namespace Library.Eaf.Core.Smtp
-{
-
- public enum MailPriority
- {
- Low = 0,
- Normal = 1,
- High = 2
- }
-
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/ChangeDataCollectionHandler.cs b/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/ChangeDataCollectionHandler.cs
deleted file mode 100644
index 869066d..0000000
--- a/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/ChangeDataCollectionHandler.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace Library.Eaf.EquipmentCore.Control
-{
- public class ChangeDataCollectionHandler
- {
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/DataCollectionRequest.cs b/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/DataCollectionRequest.cs
deleted file mode 100644
index e901799..0000000
--- a/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/DataCollectionRequest.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace Library.Eaf.EquipmentCore.Control
-{
- public class DataCollectionRequest
- {
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/EquipmentEvent.cs b/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/EquipmentEvent.cs
deleted file mode 100644
index 9a2dea9..0000000
--- a/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/EquipmentEvent.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace Library.Eaf.EquipmentCore.Control
-{
- public class EquipmentEvent
- {
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/EquipmentException.cs b/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/EquipmentException.cs
deleted file mode 100644
index 6542474..0000000
--- a/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/EquipmentException.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace Library.Eaf.EquipmentCore.Control
-{
- public class EquipmentException
- {
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/EquipmentSelfDescription.cs b/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/EquipmentSelfDescription.cs
deleted file mode 100644
index c325af1..0000000
--- a/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/EquipmentSelfDescription.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace Library.Eaf.EquipmentCore.Control
-{
- public class EquipmentSelfDescription
- {
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/GetParameterValuesHandler.cs b/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/GetParameterValuesHandler.cs
deleted file mode 100644
index 385ef82..0000000
--- a/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/GetParameterValuesHandler.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace Library.Eaf.EquipmentCore.Control
-{
- public class GetParameterValuesHandler
- {
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IConnectionControl.cs b/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IConnectionControl.cs
deleted file mode 100644
index b346524..0000000
--- a/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IConnectionControl.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace Library.Eaf.EquipmentCore.Control
-{
- public interface IConnectionControl
- {
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IDataTracingHandler.cs b/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IDataTracingHandler.cs
deleted file mode 100644
index 3e73a9d..0000000
--- a/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IDataTracingHandler.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace Library.Eaf.EquipmentCore.Control
-{
- public interface IDataTracingHandler
- {
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IEquipmentCommandService.cs b/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IEquipmentCommandService.cs
deleted file mode 100644
index d00a9ce..0000000
--- a/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IEquipmentCommandService.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace Library.Eaf.EquipmentCore.Control
-{
- public interface IEquipmentCommandService
- {
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IEquipmentControl.cs b/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IEquipmentControl.cs
deleted file mode 100644
index 647d1ec..0000000
--- a/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IEquipmentControl.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using Library.PeerGroup.GCL.Annotations;
-
-namespace Library.Eaf.EquipmentCore.Control
-{
- public interface IEquipmentControl : IPackageSource
- {
- [NotNull]
- IEquipmentSelfDescriptionBuilder SelfDescriptionBuilder { get; }
- [NotNull]
- IEquipmentDataCollection DataCollection { get; }
- [NotNull]
- IEquipmentCommandService Commands { get; }
- [NotNull]
- IConnectionControl Connection { get; }
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IEquipmentSelfDescriptionBuilder.cs b/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IEquipmentSelfDescriptionBuilder.cs
deleted file mode 100644
index 15ca25f..0000000
--- a/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IEquipmentSelfDescriptionBuilder.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace Library.Eaf.EquipmentCore.Control
-{
- public interface IEquipmentSelfDescriptionBuilder
- {
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IPackage.cs b/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IPackage.cs
deleted file mode 100644
index 0df5871..0000000
--- a/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IPackage.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace Library.Eaf.EquipmentCore.Control
-{
- public interface IPackage
- {
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/ISelfDescriptionLookup.cs b/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/ISelfDescriptionLookup.cs
deleted file mode 100644
index 6c04747..0000000
--- a/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/ISelfDescriptionLookup.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace Library.Eaf.EquipmentCore.Control
-{
- public interface ISelfDescriptionLookup
- {
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IVirtualParameterValuesHandler.cs b/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IVirtualParameterValuesHandler.cs
deleted file mode 100644
index 7d8b40e..0000000
--- a/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/IVirtualParameterValuesHandler.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace Library.Eaf.EquipmentCore.Control
-{
- public interface IVirtualParameterValuesHandler
- {
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/SetParameterValuesHandler.cs b/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/SetParameterValuesHandler.cs
deleted file mode 100644
index 6371ae8..0000000
--- a/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/SetParameterValuesHandler.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace Library.Eaf.EquipmentCore.Control
-{
- public class SetParameterValuesHandler
- {
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/TraceRequest.cs b/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/TraceRequest.cs
deleted file mode 100644
index cee5da9..0000000
--- a/EDA Viewer/Library/Eaf/EquipmentCore/Control/AutoGenerated/TraceRequest.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace Library.Eaf.EquipmentCore.Control
-{
- public class TraceRequest
- {
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/EquipmentCore/Control/IEquipmentDataCollection.cs b/EDA Viewer/Library/Eaf/EquipmentCore/Control/IEquipmentDataCollection.cs
deleted file mode 100644
index e0f09e8..0000000
--- a/EDA Viewer/Library/Eaf/EquipmentCore/Control/IEquipmentDataCollection.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-using Library.Eaf.EquipmentCore.DataCollection.Reporting;
-using Library.Eaf.EquipmentCore.SelfDescription.ElementDescription;
-using System;
-using System.Collections.Generic;
-
-namespace Library.Eaf.EquipmentCore.Control
-{
- public interface IEquipmentDataCollection
- {
- IVirtualParameterValuesHandler VirtualParameterValuesHandler { get; }
- ISelfDescriptionLookup SelfDescriptionLookup { get; }
- EquipmentSelfDescription SelfDescription { get; }
- IEnumerable ActiveRequests { get; }
- IDataTracingHandler DataTracingHandler { get; }
-
- ParameterValue CreateParameterValue(EquipmentParameter parameter, object value);
- void NotifyDataTracingAvailable(bool isAvailable);
- void RegisterChangeDataCollectionHandler(ChangeDataCollectionHandler handler);
- void RegisterDataTracingHandler(IDataTracingHandler handler);
- void RegisterGetParameterValuesHandler(GetParameterValuesHandler handler);
- void RegisterSetParameterValuesHandler(SetParameterValuesHandler handler);
- void TriggerDeactivate(DataCollectionRequest deactivateRequest);
- void TriggerEvent(EquipmentEvent equipmentEvent, IEnumerable parameters);
- void TriggerEvent(EquipmentEvent equipmentEvent, IEnumerable parameters, IPackage sourcePackage);
- void TriggerExceptionClear(EquipmentException equipmentException, IEnumerable parameters);
- void TriggerExceptionClear(EquipmentException equipmentException, IEnumerable parameters, IPackage sourcePackage);
- void TriggerExceptionClear(EquipmentException equipmentException, IEnumerable parameters, string severityOverride, string descriptionOverride);
- void TriggerExceptionClear(EquipmentException equipmentException, IEnumerable parameters, string severityOverride, string descriptionOverride, IPackage sourcePackage);
- void TriggerExceptionSet(EquipmentException equipmentException, IEnumerable parameters, string severityOverride, string descriptionOverride, IPackage sourcePackage);
- void TriggerExceptionSet(EquipmentException equipmentException, IEnumerable parameters, string severityOverride, string descriptionOverride);
- void TriggerExceptionSet(EquipmentException equipmentException, IEnumerable parameters, IPackage sourcePackage);
- void TriggerExceptionSet(EquipmentException equipmentException, IEnumerable parameters);
- void TriggerPerformanceRestored();
- void TriggerPerformanceWarning();
- void TriggerTraceSample(TraceRequest traceRequest, long sampleId, IEnumerable parameters);
- void TriggerTraceSample(TraceRequest traceRequest, long sampleId, IEnumerable parameters, IPackage sourcePackage);
- void TriggerTraceSample(TraceRequest traceRequest, long sampleId, IEnumerable parameters, DateTime equipmentTimeStamp);
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/EquipmentCore/Control/IPackageSource.cs b/EDA Viewer/Library/Eaf/EquipmentCore/Control/IPackageSource.cs
deleted file mode 100644
index 4771a37..0000000
--- a/EDA Viewer/Library/Eaf/EquipmentCore/Control/IPackageSource.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace Library.Eaf.EquipmentCore.Control
-{
- public interface IPackageSource
- {
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/EquipmentCore/DataCollection/Reporting/ParameterValue.cs b/EDA Viewer/Library/Eaf/EquipmentCore/DataCollection/Reporting/ParameterValue.cs
deleted file mode 100644
index ae30878..0000000
--- a/EDA Viewer/Library/Eaf/EquipmentCore/DataCollection/Reporting/ParameterValue.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using Library.Eaf.EquipmentCore.SelfDescription.ElementDescription;
-using Library.PeerGroup.GCL.Annotations;
-using System;
-
-namespace Library.Eaf.EquipmentCore.DataCollection.Reporting
-{
- public class ParameterValue
- {
- public ParameterValue(EquipmentParameter definition, object value) { }
- public ParameterValue(EquipmentParameter definition, object value, DateTime timestamp) { }
-
- public virtual object Value { get; protected internal set; }
- [NotNull]
- public EquipmentParameter Definition { get; }
- public DateTime Timestamp { get; protected set; }
-
- public virtual ParameterValue Clone(EquipmentParameter newDefinition) { throw new NotImplementedException(); }
- public override string ToString() { return base.ToString(); }
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/EquipmentCore/SelfDescription/ElementDescription/EquipmentParameter.cs b/EDA Viewer/Library/Eaf/EquipmentCore/SelfDescription/ElementDescription/EquipmentParameter.cs
deleted file mode 100644
index bcd9b96..0000000
--- a/EDA Viewer/Library/Eaf/EquipmentCore/SelfDescription/ElementDescription/EquipmentParameter.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using Library.Eaf.EquipmentCore.SelfDescription.ParameterTypes;
-
-namespace Library.Eaf.EquipmentCore.SelfDescription.ElementDescription
-{
- public class EquipmentParameter
- {
- public EquipmentParameter(EquipmentParameter source, ParameterTypeDefinition typeDefinition) { }
- public EquipmentParameter(string name, ParameterTypeDefinition typeDefinition, string description, bool isTransient = false, bool isReadOnly = true) { }
- public EquipmentParameter(string id, string name, ParameterTypeDefinition typeDefinition, string description, bool isTransient = false, bool isReadOnly = true) { }
-
- public string Name { get; }
- public string Id { get; }
- public string Description { get; }
- public string SourcePath { get; }
- public string SourceEquipment { get; }
- public ParameterTypeDefinition TypeDefinition { get; }
- public bool IsTransient { get; }
- public bool IsReadOnly { get; }
-
- public override string ToString() { return base.ToString(); }
- public string ToStringWithDetails() { return base.ToString(); }
- }
-
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/EquipmentCore/SelfDescription/ParameterTypes/Field.cs b/EDA Viewer/Library/Eaf/EquipmentCore/SelfDescription/ParameterTypes/Field.cs
deleted file mode 100644
index a31b67a..0000000
--- a/EDA Viewer/Library/Eaf/EquipmentCore/SelfDescription/ParameterTypes/Field.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-namespace Library.Eaf.EquipmentCore.SelfDescription.ParameterTypes
-{
- public class Field
- {
- public Field(string name, string description, bool canBeNull, ParameterTypeDefinition typeDefinition) { }
-
- public string Name { get; }
- public string Description { get; }
- public ParameterTypeDefinition TypeDefinition { get; }
- public bool CanBeNull { get; }
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/EquipmentCore/SelfDescription/ParameterTypes/ParameterTypeDefinition.cs b/EDA Viewer/Library/Eaf/EquipmentCore/SelfDescription/ParameterTypes/ParameterTypeDefinition.cs
deleted file mode 100644
index 4d32eae..0000000
--- a/EDA Viewer/Library/Eaf/EquipmentCore/SelfDescription/ParameterTypes/ParameterTypeDefinition.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-namespace Library.Eaf.EquipmentCore.SelfDescription.ParameterTypes
-{
- public abstract class ParameterTypeDefinition
- {
- public ParameterTypeDefinition(string name, string description) { }
-
- public string Name { get; }
- public string Description { get; }
-
- public override string ToString() { return base.ToString(); }
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/EquipmentCore/SelfDescription/ParameterTypes/StructuredType.cs b/EDA Viewer/Library/Eaf/EquipmentCore/SelfDescription/ParameterTypes/StructuredType.cs
deleted file mode 100644
index 5913805..0000000
--- a/EDA Viewer/Library/Eaf/EquipmentCore/SelfDescription/ParameterTypes/StructuredType.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using System.Collections.Generic;
-
-namespace Library.Eaf.EquipmentCore.SelfDescription.ParameterTypes
-{
- public class StructuredType : ParameterTypeDefinition
- {
-
- public StructuredType(string name, string description, IList fields) : base(name, description) { }
-
- public IList Fields { get; }
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/Management/ConfigurationData/CellAutomation/IConfigurationObject.cs b/EDA Viewer/Library/Eaf/Management/ConfigurationData/CellAutomation/IConfigurationObject.cs
deleted file mode 100644
index e7dc564..0000000
--- a/EDA Viewer/Library/Eaf/Management/ConfigurationData/CellAutomation/IConfigurationObject.cs
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace Library.Eaf.Management.ConfigurationData.CellAutomation
-{
- public interface IConfigurationObject
- {
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/Management/ConfigurationData/CellAutomation/ModelObjectParameterDefinition.cs b/EDA Viewer/Library/Eaf/Management/ConfigurationData/CellAutomation/ModelObjectParameterDefinition.cs
deleted file mode 100644
index 537bbcf..0000000
--- a/EDA Viewer/Library/Eaf/Management/ConfigurationData/CellAutomation/ModelObjectParameterDefinition.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using System;
-
-namespace Library.Eaf.Management.ConfigurationData.CellAutomation
-{
- [System.Runtime.Serialization.DataContractAttribute(IsReference = true)]
- public class ModelObjectParameterDefinition : IConfigurationObject
- {
- public ModelObjectParameterDefinition() { }
- public ModelObjectParameterDefinition(string name, ModelObjectParameterType valueType, object defaultValue) { }
- public ModelObjectParameterDefinition(string name, Type enumType, object defaultValue) { }
-
- [System.Runtime.Serialization.DataMemberAttribute]
- public virtual long Id { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public virtual string Name { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public virtual string Value { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public virtual ModelObjectParameterType ValueType { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public virtual string EnumType { get; set; }
-
- public virtual ModelObjectParameterDefinition Clone() { return null; }
- public virtual bool IsValidValue(string value) { return false; }
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/Management/ConfigurationData/CellAutomation/ModelObjectParameterType.cs b/EDA Viewer/Library/Eaf/Management/ConfigurationData/CellAutomation/ModelObjectParameterType.cs
deleted file mode 100644
index 9d25435..0000000
--- a/EDA Viewer/Library/Eaf/Management/ConfigurationData/CellAutomation/ModelObjectParameterType.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-namespace Library.Eaf.Management.ConfigurationData.CellAutomation
-{
- public enum ModelObjectParameterType
- {
- String = 0,
- Bool = 1,
- Byte = 2,
- SignedByte = 3,
- Integer = 4,
- UnsignedInteger = 5,
- LongInteger = 6,
- UnsignedLongInteger = 7,
- Double = 8,
- Float = 9,
- Enum = 10
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Eaf/Management/ConfigurationData/Semiconductor/CellInstances/SecsConnectionConfiguration.cs b/EDA Viewer/Library/Eaf/Management/ConfigurationData/Semiconductor/CellInstances/SecsConnectionConfiguration.cs
deleted file mode 100644
index 91ef359..0000000
--- a/EDA Viewer/Library/Eaf/Management/ConfigurationData/Semiconductor/CellInstances/SecsConnectionConfiguration.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-using Library.PeerGroup.GCL.SecsDriver;
-using System;
-
-namespace Library.Eaf.Management.ConfigurationData.Semiconductor.CellInstances
-{
- [System.Runtime.Serialization.DataContractAttribute]
- public class SecsConnectionConfiguration
- {
- public SecsConnectionConfiguration() { }
-
- [System.Runtime.Serialization.DataMemberAttribute]
- public virtual TimeSpan T6HsmsControlMessage { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public virtual TimeSpan T5ConnectionSeperation { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public virtual TimeSpan T4InterBlock { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public virtual TimeSpan T3MessageReply { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public virtual TimeSpan T2Protocol { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public virtual TimeSpan T1InterCharacter { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public virtual SerialBaudRate? BaudRate { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public virtual SecsTransportType? PortType { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public virtual long? Port { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public virtual TimeSpan LinkTestTimer { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public virtual string Host { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public virtual long? DeviceId { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public virtual HsmsSessionMode? SessionMode { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public virtual HsmsConnectionMode? ConnectionMode { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public virtual TimeSpan T7ConnectionIdle { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public virtual TimeSpan T8NetworkIntercharacter { get; set; }
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Ifx/Eaf/Common/Configuration/ConnectionSetting.cs b/EDA Viewer/Library/Ifx/Eaf/Common/Configuration/ConnectionSetting.cs
deleted file mode 100644
index eaea75b..0000000
--- a/EDA Viewer/Library/Ifx/Eaf/Common/Configuration/ConnectionSetting.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-namespace Library.Ifx.Eaf.Common.Configuration
-{
- [System.Runtime.Serialization.DataContractAttribute]
- public class ConnectionSetting
- {
- public ConnectionSetting(string name, string value) { }
-
- [System.Runtime.Serialization.DataMemberAttribute]
- public string Name { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public string Value { get; set; }
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Ifx/Eaf/EquipmentConnector/File/Component/File.cs b/EDA Viewer/Library/Ifx/Eaf/EquipmentConnector/File/Component/File.cs
deleted file mode 100644
index 79f855c..0000000
--- a/EDA Viewer/Library/Ifx/Eaf/EquipmentConnector/File/Component/File.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace Library.Ifx.Eaf.EquipmentConnector.File.Component
-{
- public class File
- {
- public File(string filePath) { throw new NotImplementedException(); }
- public File(string filePath, DateTime timeFileFound) { throw new NotImplementedException(); }
-
- public string Path { get; }
- public DateTime TimeFound { get; }
- public bool IsErrorFile { get; }
- public Dictionary ContentParameters { get; }
-
- public File UpdateContentParameters(Dictionary contentParameters) { throw new NotImplementedException(); }
- public File UpdateParsingStatus(bool isErrorFile) { throw new NotImplementedException(); }
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Ifx/Eaf/EquipmentConnector/File/Component/FilePathGenerator.cs b/EDA Viewer/Library/Ifx/Eaf/EquipmentConnector/File/Component/FilePathGenerator.cs
deleted file mode 100644
index 8dafbc1..0000000
--- a/EDA Viewer/Library/Ifx/Eaf/EquipmentConnector/File/Component/FilePathGenerator.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using Library.Ifx.Eaf.EquipmentConnector.File.Configuration;
-using System;
-using System.Collections.Generic;
-
-namespace Library.Ifx.Eaf.EquipmentConnector.File.Component
-{
- public class FilePathGenerator
- {
- public const char PLACEHOLDER_IDENTIFIER = '%';
- public const char PLACEHOLDER_SEPARATOR = ':';
- public const string PLACEHOLDER_NOT_AVAILABLE = "NA";
- public const string PLACEHOLDER_ORIGINAL_FILE_NAME = "OriginalFileName";
- public const string PLACEHOLDER_ORIGINAL_FILE_EXTENSION = "OriginalFileExtension";
- public const string PLACEHOLDER_DATE_TIME = "DateTime";
- public const string PLACEHOLDER_SUB_FOLDER = "SubFolder";
- public const string PLACEHOLDER_CELL_NAME = "CellName";
-
- public FilePathGenerator(FileConnectorConfiguration config, Dictionary customPattern = null) { throw new NotImplementedException(); }
- public FilePathGenerator(FileConnectorConfiguration config, File file, bool isErrorFile = false, Dictionary customPattern = null) { throw new NotImplementedException(); }
- public FilePathGenerator(FileConnectorConfiguration config, string sourceFilePath, bool isErrorFile = false, Dictionary customPattern = null) { throw new NotImplementedException(); }
-
- protected string SubFolderPath { get; }
- protected FileConnectorConfiguration Configuration { get; }
- protected File File { get; }
- protected bool IsErrorFile { get; }
- protected string DefaultPlaceHolderValue { get; }
-
- public string GetFullTargetPath() { throw new NotImplementedException(); }
- public virtual string GetTargetFileName() { throw new NotImplementedException(); }
- public string GetTargetFolder(bool throwExceptionIfNotExist = true) { throw new NotImplementedException(); }
- protected virtual string GetSubFolder(string folderPattern, string subFolderPath) { throw new NotImplementedException(); }
- protected virtual string PrepareFolderPath(string targetFolderPath, string subFolderPath) { throw new NotImplementedException(); }
- protected string ReplacePlaceholder(string inputPath) { throw new NotImplementedException(); }
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Ifx/Eaf/EquipmentConnector/File/Configuration/FileConnectorConfiguration.cs b/EDA Viewer/Library/Ifx/Eaf/EquipmentConnector/File/Configuration/FileConnectorConfiguration.cs
deleted file mode 100644
index 5dc949d..0000000
--- a/EDA Viewer/Library/Ifx/Eaf/EquipmentConnector/File/Configuration/FileConnectorConfiguration.cs
+++ /dev/null
@@ -1,135 +0,0 @@
-using Library.Ifx.Eaf.Common.Configuration;
-using System;
-using System.Collections.Generic;
-
-namespace Library.Ifx.Eaf.EquipmentConnector.File.Configuration
-{
- [System.Runtime.Serialization.DataContractAttribute]
- public class FileConnectorConfiguration
- {
- public const ulong IDLE_EVENT_WAIT_TIME_DEFAULT = 360;
- public const ulong FILE_HANDLE_TIMEOUT_DEFAULT = 15;
-
- [System.Runtime.Serialization.DataMemberAttribute]
- public virtual bool? TriggerOnChanged { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public virtual long? PostProcessingRetries { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public virtual bool? CopySourceFolderStructure { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public IfPostProcessingFailsEnum? IfPostProcessingFailsAction { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public string AlternateTargetFolder { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public long? FileHandleTimeout { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public bool? DeleteEmptySourceSubFolders { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public long? IdleEventWaitTimeInSeconds { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public string FileAgeThreshold { get; set; }
- public bool? FolderAgeCheckIndividualSubFolders { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public virtual ZipModeEnum? ZipMode { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public FileAgeFilterEnum? FileAgeFilterMode { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public string ZipTargetFileName { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public string ZipErrorTargetFileName { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public long? ZipFileSubFolderLevel { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public string DefaultPlaceHolderValue { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public bool? UseZip64Mode { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public List ConnectionSettings { get; set; }
- public string SourceDirectoryCloaking { get; set; }
- public string FolderAgeThreshold { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public virtual long? FileScanningIntervalInSeconds { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public virtual bool? TriggerOnCreated { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public virtual long? ZipFileTime { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public string SourceFileLocation { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public string SourceFileFilter { get; set; }
- public List SourceFileFilters { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public virtual bool? IncludeSubDirectories { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public virtual FileScanningOptionEnum? FileScanningOption { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public string TargetFileLocation { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public string ErrorTargetFileLocation { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public string TargetFileName { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public virtual long? FileHandleWaitTime { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public IfFileExistEnum? IfFileExistAction { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public long? ConnectionRetryInterval { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public PreProcessingModeEnum? PreProcessingMode { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public PostProcessingModeEnum? PostProcessingMode { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public PostProcessingModeEnum? ErrorPostProcessingMode { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public virtual long? ZipFileAmount { get; set; }
- [System.Runtime.Serialization.DataMemberAttribute]
- public string ErrorTargetFileName { get; set; }
-
- public void Initialize() { throw new NotImplementedException(); }
-
- public enum PostProcessingModeEnum
- {
- None = 0,
- Move = 1,
- Copy = 2,
- Rename = 3,
- Zip = 4,
- Delete = 5,
- MoveFolder = 6,
- CopyFolder = 7,
- DeleteFolder = 8
- }
- public enum PreProcessingModeEnum
- {
- None = 0,
- Process = 1
- }
- public enum IfFileExistEnum
- {
- Overwrite = 0,
- LeaveFiles = 1,
- Delete = 2
- }
- public enum IfPostProcessingFailsEnum
- {
- LeaveFiles = 0,
- Delete = 1
- }
- public enum FileScanningOptionEnum
- {
- FileWatcher = 0,
- TimeBased = 1
- }
- public enum ZipModeEnum
- {
- ZipByAmountOrTime = 0,
- ZipByFileName = 1,
- ZipBySubFolderName = 2
- }
- public enum FileAgeFilterEnum
- {
- IgnoreNewer = 0,
- IgnoreOlder = 1
- }
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/Ifx/Eaf/EquipmentConnector/File/SelfDescription/FileConnectorParameterTypeDefinitionProvider.cs b/EDA Viewer/Library/Ifx/Eaf/EquipmentConnector/File/SelfDescription/FileConnectorParameterTypeDefinitionProvider.cs
deleted file mode 100644
index 23353cb..0000000
--- a/EDA Viewer/Library/Ifx/Eaf/EquipmentConnector/File/SelfDescription/FileConnectorParameterTypeDefinitionProvider.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using Library.Eaf.EquipmentCore.SelfDescription.ParameterTypes;
-using System;
-using System.Collections.Generic;
-
-namespace Library.Ifx.Eaf.EquipmentConnector.File.SelfDescription
-{
- public class FileConnectorParameterTypeDefinitionProvider
- {
- public FileConnectorParameterTypeDefinitionProvider() { }
-
- public IEnumerable GetAllParameterTypeDefinition() { return null; }
- public ParameterTypeDefinition GetParameterTypeDefinition(string name) { return null; }
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/PeerGroup/GCL/Annotations/NotNullAttribute.cs b/EDA Viewer/Library/PeerGroup/GCL/Annotations/NotNullAttribute.cs
deleted file mode 100644
index fa311f4..0000000
--- a/EDA Viewer/Library/PeerGroup/GCL/Annotations/NotNullAttribute.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using System;
-
-namespace Library.PeerGroup.GCL.Annotations
-{
- [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.Delegate, AllowMultiple = false, Inherited = true)]
- public sealed class NotNullAttribute : Attribute
- {
- public NotNullAttribute() { }
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/PeerGroup/GCL/SecsDriver/HsmsConnectionMode.cs b/EDA Viewer/Library/PeerGroup/GCL/SecsDriver/HsmsConnectionMode.cs
deleted file mode 100644
index 21ecf38..0000000
--- a/EDA Viewer/Library/PeerGroup/GCL/SecsDriver/HsmsConnectionMode.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-namespace Library.PeerGroup.GCL.SecsDriver
-{
- public enum HsmsConnectionMode
- {
- Active = 0,
- Passive = 1
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/PeerGroup/GCL/SecsDriver/HsmsSessionMode.cs b/EDA Viewer/Library/PeerGroup/GCL/SecsDriver/HsmsSessionMode.cs
deleted file mode 100644
index 6ea9d07..0000000
--- a/EDA Viewer/Library/PeerGroup/GCL/SecsDriver/HsmsSessionMode.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-namespace Library.PeerGroup.GCL.SecsDriver
-{
- public enum HsmsSessionMode
- {
- MultiSession = 0,
- SingleSession = 1
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/PeerGroup/GCL/SecsDriver/SecsTransportType.cs b/EDA Viewer/Library/PeerGroup/GCL/SecsDriver/SecsTransportType.cs
deleted file mode 100644
index f5afda3..0000000
--- a/EDA Viewer/Library/PeerGroup/GCL/SecsDriver/SecsTransportType.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-namespace Library.PeerGroup.GCL.SecsDriver
-{
- public enum SecsTransportType
- {
- HSMS = 0,
- Serial = 1
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Library/PeerGroup/GCL/SecsDriver/SerialBaudRate.cs b/EDA Viewer/Library/PeerGroup/GCL/SecsDriver/SerialBaudRate.cs
deleted file mode 100644
index c3ffd63..0000000
--- a/EDA Viewer/Library/PeerGroup/GCL/SecsDriver/SerialBaudRate.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-namespace Library.PeerGroup.GCL.SecsDriver
-{
- public enum SerialBaudRate
- {
- Baud9600 = 0,
- Baud19200 = 1,
- Baud4800 = 2,
- Baud2400 = 3,
- Baud1200 = 4,
- Baud300 = 5,
- Baud150 = 6,
- Baud38400 = 7,
- Baud57600 = 8,
- Baud115200 = 9
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Models/AppSettings.cs b/EDA Viewer/Models/AppSettings.cs
index 2fe1229..c3ff1c7 100644
--- a/EDA Viewer/Models/AppSettings.cs
+++ b/EDA Viewer/Models/AppSettings.cs
@@ -1,15 +1,52 @@
-namespace EDAViewer.Models
+using System.Text.Json;
+using System.Text.Json.Serialization;
+
+namespace EDAViewer.Models;
+
+public class AppSettings
{
- public class AppSettings
+
+ protected string _BuildNumber;
+ protected string _Company;
+ protected string _ECEDADatabasePassword;
+ protected string _GitCommitSeven;
+ protected string _IFXEDADatabasePassword;
+ protected string _MonARessource;
+ protected string _Server;
+ protected string _URLs;
+ protected string _WorkingDirectoryName;
+ public string BuildNumber => _BuildNumber;
+ public string Company => _Company;
+ public string ECEDADatabasePassword => _ECEDADatabasePassword;
+ public string GitCommitSeven => _GitCommitSeven;
+ public string IFXEDADatabasePassword => _IFXEDADatabasePassword;
+ public string MonARessource => _MonARessource;
+ public string Server => _Server;
+ public string URLs => _URLs;
+ public string WorkingDirectoryName => _WorkingDirectoryName;
+
+ // public AppSettings()
+ // {
+ // }
+
+ [JsonConstructor]
+ public AppSettings(string buildNumber, string company, string ecEDADatabasePassword, string gitCommitSeven, string ifxEDADatabasePassword, string monARessource, string server, string urls, string workingDirectoryName)
{
- public string Company { get; set; }
- public string ECEDADatabasePassword { get; set; }
- public string EncryptedPassword { get; set; }
- public string IFXEDADatabasePassword { get; set; }
- public string MonARessource { get; set; }
- public string Server { get; set; }
- public string ServiceUser { get; set; }
- public string URLs { get; set; }
- public string WorkingDirectoryName { get; set; }
+ _BuildNumber = buildNumber;
+ _Company = company;
+ _ECEDADatabasePassword = ecEDADatabasePassword;
+ _GitCommitSeven = gitCommitSeven;
+ _IFXEDADatabasePassword = ifxEDADatabasePassword;
+ _MonARessource = monARessource;
+ _Server = server;
+ _URLs = urls;
+ _WorkingDirectoryName = workingDirectoryName;
}
+
+ public override string ToString()
+ {
+ string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
+ return result;
+ }
+
}
\ No newline at end of file
diff --git a/EDA Viewer/Models/Binder/AppSettings.cs b/EDA Viewer/Models/Binder/AppSettings.cs
new file mode 100644
index 0000000..44755d8
--- /dev/null
+++ b/EDA Viewer/Models/Binder/AppSettings.cs
@@ -0,0 +1,38 @@
+using System.ComponentModel.DataAnnotations;
+using System.Text.Json;
+
+namespace EDAViewer.Models.Binder;
+
+public class AppSettings
+{
+
+ [Display(Name = "Build Number"), Required] public string BuildNumber { get; set; }
+ [Display(Name = "Company"), Required] public string Company { get; set; }
+ [Display(Name = "EC EDA Database Password"), Required] public string ECEDADatabasePassword { get; set; }
+ [Display(Name = "Git Commit Seven"), Required] public string GitCommitSeven { get; set; }
+ [Display(Name = "IFX EDA Database Password"), Required] public string IFXEDADatabasePassword { get; set; }
+ [Display(Name = "MonA Ressource"), Required] public string MonARessource { get; set; }
+ [Display(Name = "Server"), Required] public string Server { get; set; }
+ [Display(Name = "URLs"), Required] public string URLs { get; set; }
+ [Display(Name = "Working Directory Name"), Required] public string WorkingDirectoryName { get; set; }
+
+ public AppSettings()
+ {
+ BuildNumber = string.Empty;
+ Company = string.Empty;
+ ECEDADatabasePassword = string.Empty;
+ GitCommitSeven = string.Empty;
+ IFXEDADatabasePassword = string.Empty;
+ MonARessource = string.Empty;
+ Server = string.Empty;
+ URLs = string.Empty;
+ WorkingDirectoryName = string.Empty;
+ }
+
+ public override string ToString()
+ {
+ string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
+ return result;
+ }
+
+}
\ No newline at end of file
diff --git a/EDA Viewer/Models/EdaHtmlDiff.cs b/EDA Viewer/Models/EdaHtmlDiff.cs
deleted file mode 100644
index ef0a35d..0000000
--- a/EDA Viewer/Models/EdaHtmlDiff.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-using EDAViewer.Models;
-using System;
-using System.ComponentModel.DataAnnotations;
-
-namespace EDAViewer.Models
-{
-
- public class EdaHtmlDiff : WithEnvironment
- {
-
- public string Paths { get; set; }
- public string CurrentPath { get; set; }
- public string PathAndFileName { get; set; }
-
- [Display(Name = "FileName")]
- [DisplayFormat(ConvertEmptyStringToNull = false)]
- [Required(ErrorMessage = "Please select an file name", AllowEmptyStrings = false)]
- public string FileName { get; set; }
-
- public EdaHtmlDiff()
- {
- Common(path: string.Empty);
- }
-
- public EdaHtmlDiff(WithEnvironment withEnvironment, string path)
- {
- Common(path);
- if (string.IsNullOrEmpty(withEnvironment.user_name))
- user_name = "AUTO";
- else
- user_name = withEnvironment.user_name;
- if (string.IsNullOrEmpty(withEnvironment.machine_name))
- machine_name = "IFX";
- else
- machine_name = withEnvironment.machine_name;
- if (withEnvironment.now_ticks == 0)
- now_ticks = DateTime.Now.Ticks;
- else
- now_ticks = withEnvironment.now_ticks;
- message = withEnvironment.message;
- }
-
- private void Common(string path)
- {
- Paths = string.Empty;
- CurrentPath = path;
- FileName = string.Empty;
- }
-
- }
-
-}
\ No newline at end of file
diff --git a/EDA Viewer/Models/ErrorViewModel.cs b/EDA Viewer/Models/ErrorViewModel.cs
index ac6c445..7e2d620 100644
--- a/EDA Viewer/Models/ErrorViewModel.cs
+++ b/EDA Viewer/Models/ErrorViewModel.cs
@@ -1,9 +1,8 @@
-namespace EDAViewer.Models
-{
- public class ErrorViewModel
- {
- public string RequestId { get; set; }
+namespace EDAViewer.Models;
- public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
- }
+public class ErrorViewModel
+{
+ public string? RequestId { get; set; }
+
+ public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
}
\ No newline at end of file
diff --git a/EDA Viewer/Models/IBackground.cs b/EDA Viewer/Models/IBackground.cs
deleted file mode 100644
index 1fbb28f..0000000
--- a/EDA Viewer/Models/IBackground.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-namespace EDAViewer.Models
-{
-
- public interface IBackground
- {
- void EdaDataCollectionPlansCallback();
- // public void EdaDataCollectionPlans()
- // {
- // long ticks = DateTime.Now.Ticks;
- // Logic2021Q1 logic2021Q1 = new Logic2021Q1(_Log);
- // string server = GetServer(debugIsNotEC: false);
- // string cSharpFormat = "yyyy-MM-dd_hh:mm:ss tt";
- // string oracleFormat = "yyyy-MM-dd_hh:mi:ss AM";
- // string edaDataCollectionPlansLastRun = "2020-07-02_10:45:01 AM";
- // logic2021Q1.EdaDataCollectionPlans(server, server.Contains("_ec_"), edaDataCollectionPlansLastRun, cSharpFormat, oracleFormat);
- // _Log.Debug(string.Concat("Took ", new TimeSpan(DateTime.Now.Ticks - ticks).TotalSeconds, " second(s)"));
- // }
- void EDAOutputArchiveCallback();
- // public void EDAOutputArchive()
- // {
- // long ticks = DateTime.Now.Ticks;
- // string server = GetServer(debugIsNotEC: true);
- // string sourceDirectory = string.Concat(@"\\", server, @"\ec_eda\Staging\Traces");
- // if (!Directory.Exists(sourceDirectory))
- // _Log.Debug(string.Concat("// Source directory <", sourceDirectory, "> doesn't exist."));
- // else
- // {
- // Logic2019Q4 logic2019Q4 = new Logic2019Q4(_Log);
- // logic2019Q4.EDAOutputArchive(sourceDirectory);
- // }
- // _Log.Debug(string.Concat("Took ", new TimeSpan(DateTime.Now.Ticks - ticks).TotalSeconds, " second(s)"));
- // }
- void LogPathCleanUpByWeekCallback();
- // public void LogPathCleanUpByWeek()
- // {
- // long ticks = DateTime.Now.Ticks;
- // string server = GetServer(debugIsNotEC: true);
- // Logic2019Q3 logic2019Q3 = new Logic2019Q3(_Log);
- // logic2019Q3.LogPathCleanUpByWeek(server, isEDA: true);
- // logic2019Q3.LogPathCleanUpByWeek(server, isEAFLog: true);
- // _Log.Debug(string.Concat("Took ", new TimeSpan(DateTime.Now.Ticks - ticks).TotalSeconds, " second(s)"));
- // }
-
- }
-
-}
\ No newline at end of file
diff --git a/EDA Viewer/Models/IHomeController.cs b/EDA Viewer/Models/IHomeController.cs
deleted file mode 100644
index 3030d14..0000000
--- a/EDA Viewer/Models/IHomeController.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using Microsoft.AspNetCore.Mvc;
-using Microsoft.AspNetCore.Mvc.Rendering;
-using System.Collections.Generic;
-
-namespace EDAViewer.Models
-{
- public interface IHomeController
- {
- IActionResult Background(bool? message_clear = null, bool? exceptions_clear = null, bool? set_is_primary_instance = null, int? invoke_eda_dcp = null);
- IActionResult Encode(string value = null);
- IActionResult Error();
- IActionResult Index();
- IActionResult Privacy();
- IActionResult ViewEdaHtmlDiff(WithEnvironment withEnvironment = null);
- ActionResult> GetDirectoriesOrFiles(string path = null, bool? upDirectory = null, string filter = null);
- }
-}
\ No newline at end of file
diff --git a/EDA Viewer/Models/Methods/IBackground.cs b/EDA Viewer/Models/Methods/IBackground.cs
new file mode 100644
index 0000000..c1081f9
--- /dev/null
+++ b/EDA Viewer/Models/Methods/IBackground.cs
@@ -0,0 +1,20 @@
+namespace EDAViewer.Models.Methods;
+
+public interface IBackground
+{
+
+ void Catch(Exception exception);
+ void ClearIsPrimaryInstance();
+ void ClearMessage();
+ void Dispose();
+ bool IsPrimaryInstance();
+ void SetIsPrimaryInstance();
+ void Stop(bool immediate);
+ void Update(int milliSeconds);
+
+ string GetCountDirectory(string verb);
+
+ void EDAOutputArchiveCallback();
+ void EdaDataCollectionPlansCallback();
+ void LogPathCleanUpByWeekCallback();
+}
\ No newline at end of file
diff --git a/EDA Viewer/Models/Properties/IBackground.cs b/EDA Viewer/Models/Properties/IBackground.cs
new file mode 100644
index 0000000..f722458
--- /dev/null
+++ b/EDA Viewer/Models/Properties/IBackground.cs
@@ -0,0 +1,8 @@
+namespace EDAViewer.Models.Properties;
+
+public interface IBackground
+{
+
+ public List Timers { get; }
+
+}
\ No newline at end of file
diff --git a/EDA Viewer/Models/Properties/IBackgroundPage.cs b/EDA Viewer/Models/Properties/IBackgroundPage.cs
new file mode 100644
index 0000000..4de5637
--- /dev/null
+++ b/EDA Viewer/Models/Properties/IBackgroundPage.cs
@@ -0,0 +1,10 @@
+namespace EDAViewer.Models.Properties;
+
+public interface IBackgroundPage
+{
+
+ public List Exceptions { get; }
+ public string Message { get; }
+ public string WorkingDirectory { get; }
+
+}
\ No newline at end of file
diff --git a/EDA Viewer/Models/Stateless/AppSettings.cs b/EDA Viewer/Models/Stateless/AppSettings.cs
new file mode 100644
index 0000000..b546bc8
--- /dev/null
+++ b/EDA Viewer/Models/Stateless/AppSettings.cs
@@ -0,0 +1,39 @@
+using System.Text.Json;
+
+namespace EDAViewer.Models.Stateless;
+
+public abstract class AppSettings
+{
+
+ public static Models.AppSettings Get(IConfigurationRoot configurationRoot)
+ {
+ Models.AppSettings? result;
+ Binder.AppSettings appSettings = configurationRoot.Get();
+ string json = JsonSerializer.Serialize(appSettings, new JsonSerializerOptions() { WriteIndented = true });
+ result = JsonSerializer.Deserialize(json);
+ if (result is null)
+ throw new Exception(json);
+ if (string.IsNullOrEmpty(result.Company))
+ throw new Exception(json);
+ string jsonThis = result.ToString();
+ if (jsonThis != json)
+ {
+ int? check = null;
+ int min = new int[] { json.Length, jsonThis.Length }.Min();
+ for (int i = 0; i < min; i++)
+ {
+ if (json[i] == jsonThis[i])
+ continue;
+ check = i;
+ break;
+ }
+ if (check is null)
+ throw new Exception();
+ string a = json[..check.Value].Split(',')[^1];
+ string b = json[check.Value..].Split(',')[0];
+ throw new Exception($"{a}{b}");
+ }
+ return result;
+ }
+
+}
\ No newline at end of file
diff --git a/EDA Viewer/Models/Stateless/Methods/IBackgroundPage.cs b/EDA Viewer/Models/Stateless/Methods/IBackgroundPage.cs
new file mode 100644
index 0000000..1d59081
--- /dev/null
+++ b/EDA Viewer/Models/Stateless/Methods/IBackgroundPage.cs
@@ -0,0 +1,10 @@
+namespace EDAViewer.Models.Stateless.Methods;
+
+public interface IBackgroundPage
+{
+
+ void OnGet(bool? message_clear = null, bool? exceptions_clear = null, bool? set_is_primary_instance = null);
+
+ static string GetRouteName() => nameof(IBackgroundPage).Replace("Page", string.Empty)[1..];
+
+}
\ No newline at end of file
diff --git a/EDA Viewer/Models/Stateless/Methods/IMethodName.cs b/EDA Viewer/Models/Stateless/Methods/IMethodName.cs
new file mode 100644
index 0000000..badc839
--- /dev/null
+++ b/EDA Viewer/Models/Stateless/Methods/IMethodName.cs
@@ -0,0 +1,10 @@
+using System.Runtime.CompilerServices;
+
+namespace EDAViewer.Models.Stateless.Methods;
+
+public interface IMethodName
+{
+
+ static string? GetActualAsyncMethodName([CallerMemberName] string? name = null) => name;
+
+}
\ No newline at end of file
diff --git a/EDA Viewer/Models/Stateless/Methods/IWorkingDirectory.cs b/EDA Viewer/Models/Stateless/Methods/IWorkingDirectory.cs
new file mode 100644
index 0000000..6ae61e3
--- /dev/null
+++ b/EDA Viewer/Models/Stateless/Methods/IWorkingDirectory.cs
@@ -0,0 +1,8 @@
+namespace EDAViewer.Models.Stateless.Methods;
+
+public interface IWorkingDirectory
+{
+
+ static string GetWorkingDirectory(string? executingAssemblyName, string subDirectoryName) => WorkingDirectory.GetWorkingDirectory(executingAssemblyName, subDirectoryName);
+
+}
\ No newline at end of file
diff --git a/EDA Viewer/Models/Stateless/Methods/WorkingDirectory.cs b/EDA Viewer/Models/Stateless/Methods/WorkingDirectory.cs
new file mode 100644
index 0000000..4f1fd80
--- /dev/null
+++ b/EDA Viewer/Models/Stateless/Methods/WorkingDirectory.cs
@@ -0,0 +1,50 @@
+namespace EDAViewer.Models.Stateless.Methods;
+
+internal abstract class WorkingDirectory
+{
+
+ internal static string GetWorkingDirectory(string? executingAssemblyName, string subDirectoryName)
+ {
+ string result = string.Empty;
+ if (executingAssemblyName is null)
+ throw new Exception();
+ string traceFile;
+ List directories = new();
+ Environment.SpecialFolder[] specialFolders = new Environment.SpecialFolder[]
+ {
+ Environment.SpecialFolder.LocalApplicationData,
+ Environment.SpecialFolder.ApplicationData,
+ Environment.SpecialFolder.History,
+ Environment.SpecialFolder.CommonApplicationData,
+ Environment.SpecialFolder.InternetCache
+ };
+ foreach (Environment.SpecialFolder specialFolder in specialFolders)
+ directories.Add(Path.Combine(Environment.GetFolderPath(specialFolder), subDirectoryName, executingAssemblyName));
+ foreach (string directory in directories)
+ {
+ for (int i = 1; i < 3; i++)
+ {
+ if (i == 1)
+ result = directory;
+ else
+ result = string.Concat("D", directory[1..]);
+ try
+ {
+ if (!Directory.Exists(result))
+ _ = Directory.CreateDirectory(result);
+ traceFile = string.Concat(result, @"\", DateTime.Now.Ticks, ".txt");
+ File.WriteAllText(traceFile, traceFile);
+ File.Delete(traceFile);
+ break;
+ }
+ catch (Exception) { result = string.Empty; }
+ }
+ if (!string.IsNullOrEmpty(result))
+ break;
+ }
+ if (string.IsNullOrEmpty(result))
+ throw new Exception("Unable to set working directory!");
+ return result;
+ }
+
+}
\ No newline at end of file
diff --git a/EDA Viewer/Models/Stateless/SerilogExtensionMethods.cs b/EDA Viewer/Models/Stateless/SerilogExtensionMethods.cs
new file mode 100644
index 0000000..13736cf
--- /dev/null
+++ b/EDA Viewer/Models/Stateless/SerilogExtensionMethods.cs
@@ -0,0 +1,10 @@
+namespace EDAViewer.Models.Stateless;
+
+public static class SerilogExtensionMethods
+{
+
+ internal static void Warn(this Serilog.ILogger log, string messageTemplate) => log.Warning(messageTemplate);
+
+ internal static void Info(this Serilog.ILogger log, string messageTemplate) => log.Information(messageTemplate);
+
+}
\ No newline at end of file
diff --git a/EDA Viewer/Models/WithEnvironment.cs b/EDA Viewer/Models/WithEnvironment.cs
deleted file mode 100644
index 81980fb..0000000
--- a/EDA Viewer/Models/WithEnvironment.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-namespace EDAViewer.Models
-{
-
- public class WithEnvironment
- {
-
- public string message { get; set; }
- public string user_name { get; set; }
- public string machine_name { get; set; }
- public long now_ticks { get; set; }
-
- }
-
-}
\ No newline at end of file
diff --git a/EDA Viewer/Pages/Background.cshtml b/EDA Viewer/Pages/Background.cshtml
new file mode 100644
index 0000000..e3dccf4
--- /dev/null
+++ b/EDA Viewer/Pages/Background.cshtml
@@ -0,0 +1,68 @@
+@page
+@model EDAViewer.Pages.BackgroundPage
+@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
+
+
+
+
+
+
+
+ Background
+
+
+
+
+
+
+
+
+
@(nameof(EDAViewer)) -
+ @(Model.IsPrimaryInstance) -
+ @(Model.IsEnvironmentProfile) -
+ @(Model.AppSettingsBuildNumber) -
+ @(Model.AppSettingsGitCommitSeven) -
+ @(Model.AppSettingsURLs)
+
@(Model.WorkingDirectory)
+
@(Model.Message)
+
@(string.Concat("Exception(s) - ", Model.Exceptions.Count))
+
+
+
+
+
+
+
+
+
+
diff --git a/EDA Viewer/Pages/Background.cshtml.cs b/EDA Viewer/Pages/Background.cshtml.cs
new file mode 100644
index 0000000..54d78da
--- /dev/null
+++ b/EDA Viewer/Pages/Background.cshtml.cs
@@ -0,0 +1,74 @@
+using EDAViewer.Models.Stateless.Methods;
+using IFX.Shared;
+using Microsoft.AspNetCore.Mvc.RazorPages;
+using Serilog.Context;
+using System.Text.Json;
+
+namespace EDAViewer.Pages;
+
+public class BackgroundPage : PageModel, Models.Properties.IBackgroundPage, IBackgroundPage
+{
+
+ protected readonly string _AppSettingsBuildNumber;
+ protected readonly string _AppSettingsGitCommitSeven;
+ protected readonly string _AppSettingsURLs;
+ protected readonly List _Exceptions;
+ protected readonly string _IsEnvironmentProfile;
+ protected string _IsPrimaryInstance;
+ protected readonly string _Message;
+ protected readonly string _WorkingDirectory;
+ public string AppSettingsBuildNumber => _AppSettingsBuildNumber;
+ public string AppSettingsGitCommitSeven => _AppSettingsGitCommitSeven;
+ public string AppSettingsURLs => _AppSettingsURLs;
+ public List Exceptions => _Exceptions;
+ public string IsEnvironmentProfile => _IsEnvironmentProfile;
+ public string IsPrimaryInstance => _IsPrimaryInstance;
+ public string Message => _Message;
+ public string WorkingDirectory => _WorkingDirectory;
+
+ private readonly Serilog.ILogger _Log;
+ private readonly Models.Methods.IBackground _BackgroundMethods;
+
+ public BackgroundPage(IsEnvironment isEnvironment, Models.AppSettings appSettings, Singleton.Background background)
+ {
+ _Message = background.Message;
+ _BackgroundMethods = background;
+ _AppSettingsURLs = appSettings.URLs;
+ _Exceptions = background.Exceptions;
+ _IsEnvironmentProfile = isEnvironment.Profile;
+ _Log = Serilog.Log.ForContext();
+ _WorkingDirectory = background.WorkingDirectory;
+ _AppSettingsBuildNumber = appSettings.BuildNumber;
+ _AppSettingsGitCommitSeven = appSettings.GitCommitSeven;
+ Models.Methods.IBackground backgroundMethods = background;
+ _IsPrimaryInstance = backgroundMethods.IsPrimaryInstance().ToString();
+ }
+
+ public override string ToString()
+ {
+ string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
+ return result;
+ }
+
+ public void OnGet(bool? message_clear = null, bool? exceptions_clear = null, bool? set_is_primary_instance = null)
+ {
+ string? methodName = IMethodName.GetActualAsyncMethodName();
+ using (LogContext.PushProperty("MethodName", methodName))
+ {
+ _Log.Debug("() => ...");
+ if (message_clear.HasValue && message_clear.Value)
+ _BackgroundMethods.ClearMessage();
+ if (exceptions_clear.HasValue && exceptions_clear.Value)
+ _Exceptions.Clear();
+ if (set_is_primary_instance.HasValue)
+ {
+ if (set_is_primary_instance.Value)
+ _BackgroundMethods.SetIsPrimaryInstance();
+ else
+ _BackgroundMethods.ClearIsPrimaryInstance();
+ _IsPrimaryInstance = _BackgroundMethods.IsPrimaryInstance().ToString();
+ }
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/EDA Viewer/Pages/Error.cshtml b/EDA Viewer/Pages/Error.cshtml
new file mode 100644
index 0000000..cd86153
--- /dev/null
+++ b/EDA Viewer/Pages/Error.cshtml
@@ -0,0 +1,42 @@
+@page
+@model EDAViewer.Pages.ErrorModel
+
+
+
+
+
+
+
+ Error
+
+
+
+
+
+
+
+
Error.
+
An error occurred while processing your request.
+
+ @if (Model.ShowRequestId)
+ {
+
+ Request ID: @Model.RequestId
+
+ }
+
+
Development Mode
+
+ Swapping to the Development environment displays detailed information about the error that occurred.
+
+
+ The Development environment shouldn't be enabled for deployed applications.
+ It can result in displaying sensitive information from exceptions to end users.
+ For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
+ and restarting the app.
+
+
+
+
+
+
diff --git a/EDA Viewer/Pages/Error.cshtml.cs b/EDA Viewer/Pages/Error.cshtml.cs
new file mode 100644
index 0000000..2656e08
--- /dev/null
+++ b/EDA Viewer/Pages/Error.cshtml.cs
@@ -0,0 +1,20 @@
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc.RazorPages;
+using System.Diagnostics;
+
+namespace EDAViewer.Pages;
+
+[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
+[IgnoreAntiforgeryToken]
+public class ErrorModel : PageModel
+{
+ public string? RequestId { get; set; }
+
+ public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
+
+ private readonly ILogger _Logger;
+
+ public ErrorModel(ILogger logger) => _Logger = logger;
+
+ public void OnGet() => RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
+}
\ No newline at end of file
diff --git a/EDA Viewer/Program.cs b/EDA Viewer/Program.cs
index 35a1000..8f69da4 100644
--- a/EDA Viewer/Program.cs
+++ b/EDA Viewer/Program.cs
@@ -1,33 +1,88 @@
-using Microsoft.AspNetCore.Hosting;
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.Hosting;
-using Shared;
-using System.Diagnostics;
+using EDAViewer.HostedService;
+using EDAViewer.Models;
+using EDAViewer.Models.Stateless.Methods;
+using IFX.Shared;
+using Microsoft.Extensions.Hosting.WindowsServices;
+using Serilog;
+using System.Reflection;
-namespace EDAViewer
+namespace EDAViewer;
+
+public class Program
{
- public class Program
+ public static int Main(string[] args)
{
-
- public static void Main(string[] args)
+ LoggerConfiguration loggerConfiguration = new();
+ Assembly assembly = Assembly.GetExecutingAssembly();
+ string? assemblyName = assembly.GetName()?.Name;
+ if (string.IsNullOrEmpty(assemblyName))
+ throw new Exception();
+ WebApplicationBuilder webApplicationBuilder = WebApplication.CreateBuilder(new WebApplicationOptions()
{
- CreateHostBuilder(args).Build().Run();
- }
-
- public static IHostBuilder CreateHostBuilder(string[] args)
+ Args = args,
+ ContentRootPath = Path.GetDirectoryName(assembly.Location)
+ });
+ _ = webApplicationBuilder.Host.UseWindowsService();
+ _ = webApplicationBuilder.Configuration.AddUserSecrets();
+ AppSettings appSettings = Models.Stateless.AppSettings.Get(webApplicationBuilder.Configuration);
+ if (string.IsNullOrEmpty(appSettings.WorkingDirectoryName))
+ throw new Exception("Working directory name must have a value!");
+ string workingDirectory = IWorkingDirectory.GetWorkingDirectory(assemblyName, appSettings.WorkingDirectoryName);
+ Environment.SetEnvironmentVariable(nameof(workingDirectory), workingDirectory);
+ _ = ConsoleLoggerConfigurationExtensions.Console(loggerConfiguration.WriteTo);
+ _ = ConfigurationLoggerConfigurationExtensions.Configuration(loggerConfiguration.ReadFrom, webApplicationBuilder.Configuration);
+ _ = SerilogHostBuilderExtensions.UseSerilog(webApplicationBuilder.Host);
+ Log.Logger = loggerConfiguration.CreateLogger();
+ Serilog.ILogger log = Log.ForContext();
+ try
{
- IHostBuilder result;
- IsEnvironment isEnvironment = new IsEnvironment(processesCount: null, nullASPNetCoreEnvironmentIsDevelopment: Debugger.IsAttached, nullASPNetCoreEnvironmentIsProduction: !Debugger.IsAttached);
- result = Host.CreateDefaultBuilder(args)
- .UseWindowsService()
- .ConfigureWebHostDefaults(webBuilder =>
+ IsEnvironment isEnvironment = new(webApplicationBuilder.Environment.IsDevelopment(), webApplicationBuilder.Environment.IsStaging(), webApplicationBuilder.Environment.IsProduction());
+ Singleton.Background background = new(isEnvironment, appSettings, workingDirectory);
+ if (isEnvironment.Development && string.IsNullOrEmpty(appSettings.URLs))
+ throw new Exception();
+ _ = webApplicationBuilder.Services.AddRazorPages();
+ _ = webApplicationBuilder.Services.AddSingleton(_ => appSettings);
+ _ = webApplicationBuilder.Services.AddSingleton(_ => isEnvironment);
+ _ = webApplicationBuilder.Services.AddSingleton(_ => background);
+ _ = webApplicationBuilder.Services.AddHostedService(t => new TimedHostedService(isEnvironment, background));
+ if (WindowsServiceHelpers.IsWindowsService())
+ {
+ _ = webApplicationBuilder.Services.AddSingleton();
+ _ = webApplicationBuilder.Logging.AddEventLog(settings =>
{
- webBuilder.UseStartup();
+ if (string.IsNullOrEmpty(settings.SourceName))
+ settings.SourceName = webApplicationBuilder.Environment.ApplicationName;
});
- return result;
- }
+ }
+ WebApplication webApplication = webApplicationBuilder.Build();
+ if (appSettings.Company == nameof(webApplication.Lifetime.StopApplication))
+ {
+ Environment.ExitCode = -1;
+ webApplication.Lifetime.StopApplication();
+ }
+ _ = webApplication.UseExceptionHandler("/Error");
+ _ = webApplication.Lifetime.ApplicationStopped.Register(Log.CloseAndFlush);
+ _ = ApplicationBuilderSerilogClientExtensions.UseSerilogIngestion(webApplication);
+ _ = SerilogApplicationBuilderExtensions.UseSerilogRequestLogging(webApplication);
+ _ = webApplication.UseDeveloperExceptionPage();
+ _ = webApplication.UseStaticFiles();
+ _ = webApplication.UseRouting();
+ _ = webApplication.MapRazorPages();
+ log.Information("Starting Web Application");
+ webApplication.Run();
+ return 0;
+ }
+ catch (Exception ex)
+ {
+ log.Fatal(ex, "Host terminated unexpectedly");
+ return 1;
+ }
+ finally
+ {
+ Log.CloseAndFlush();
+ }
}
}
\ No newline at end of file
diff --git a/EDA Viewer/Properties/AssemblyInfo.cs b/EDA Viewer/Properties/AssemblyInfo.cs
index 49c75d0..5025f98 100644
--- a/EDA Viewer/Properties/AssemblyInfo.cs
+++ b/EDA Viewer/Properties/AssemblyInfo.cs
@@ -1,3 +1,3 @@
using System.Runtime.CompilerServices;
-[assembly: InternalsVisibleTo("EDA Viewer.Tests")]
\ No newline at end of file
+[assembly: InternalsVisibleTo("EDA Viewer.Tests")]
\ No newline at end of file
diff --git a/EDA Viewer/Shared/EquipmentType.cs b/EDA Viewer/Shared/EquipmentType.cs
deleted file mode 100644
index dd1413a..0000000
--- a/EDA Viewer/Shared/EquipmentType.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-namespace Shared
-{
-
- public enum EquipmentType
- {
- FileEquipment,
- SemiEquipment,
- //
- DEP08EGANAIXG5,
- //
- MET08ANLYSDIFAAST230_Semi,
- MET08DDUPSFS6420,
- MET08DDUPSP1TBI,
- MET08RESIHGCV,
- MET08RESIMAPCDE,
- MET08THFTIRQS408M,
- MET08THFTIRSTRATUS,
- //
- MET08AFMD3100,
- MET08BVHGPROBE,
- MET08CVHGPROBE802B150,
- MET08CVHGPROBE802B150_Monthly,
- MET08CVHGPROBE802B150_Weekly,
- MET08DDINCAN8620,
- MET08DDINCAN8620_Daily,
- MET08EBEAMINTEGRITY26,
- MET08HALLHL5580,
- MET08HALLHL5580_Monthly,
- MET08HALLHL5580_Weekly,
- MET08MESMICROSCOPE,
- MET08NDFRESIMAP151C,
- MET08NDFRESIMAP151C_Verification,
- MET08PLMAPRPM,
- MET08PLMAPRPM_Daily,
- MET08PLMAPRPM_Verification,
- MET08PLMPPLATO,
- MET08PRFUSB4000,
- MET08PRFUSB4000_Daily,
- MET08PRFUSB4000_Monthly,
- MET08PRFUSB4000_Weekly,
- MET08PRFUSB4000_Verification,
- MET08PRFUSB4000_Villach,
- MET08UVH44GS100M,
- MET08VPDSUBCON,
- MET08WGEOMX203641Q,
- MET08WGEOMX203641Q_Verification,
- MET08XRDXPERTPROMRDXL,
- MET08XRDXPERTPROMRDXL_Monthly,
- MET08XRDXPERTPROMRDXL_Weekly,
- METBRXRAYJV7300L
- }
-
-}
\ No newline at end of file
diff --git a/EDA Viewer/Shared/IsEnvironment.cs b/EDA Viewer/Shared/IsEnvironment.cs
deleted file mode 100644
index c24b236..0000000
--- a/EDA Viewer/Shared/IsEnvironment.cs
+++ /dev/null
@@ -1,171 +0,0 @@
-using System;
-using System.Diagnostics;
-using System.Runtime.InteropServices;
-
-namespace Shared
-{
-
- public class IsEnvironment
- {
-
- public enum Name
- {
- LinuxDevelopment,
- LinuxProduction,
- LinuxStaging,
- OSXDevelopment,
- OSXProduction,
- OSXStaging,
- WindowsDevelopment,
- WindowsProduction,
- WindowsStaging
- }
-
- public bool DebuggerWasAttachedDuringConstructor { get; private set; }
- public bool Development { get; private set; }
- public bool Linux { get; private set; }
- public bool OSX { get; private set; }
- public bool Production { get; private set; }
- public bool Staging { get; private set; }
- public bool Windows { get; private set; }
- public string Profile { get; private set; }
- public string AppSettingsFileName { get; private set; }
- public string ASPNetCoreEnvironment { get; private set; }
-
- public IsEnvironment(string testCategory)
- {
- if (testCategory.EndsWith(".json"))
- {
- Production = testCategory == "appsettings.json";
- Staging = testCategory.EndsWith(nameof(Staging));
- OSX = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
- Development = testCategory.EndsWith(nameof(Development));
- Linux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
- DebuggerWasAttachedDuringConstructor = Debugger.IsAttached;
- Windows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
- ASPNetCoreEnvironment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
- }
- else
- {
- DebuggerWasAttachedDuringConstructor = Debugger.IsAttached;
- OSX = !string.IsNullOrEmpty(testCategory) && testCategory.StartsWith(nameof(OSX));
- ASPNetCoreEnvironment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
- Linux = !string.IsNullOrEmpty(testCategory) && testCategory.StartsWith(nameof(Linux));
- Staging = !string.IsNullOrEmpty(testCategory) && testCategory.EndsWith(nameof(Staging));
- Windows = !string.IsNullOrEmpty(testCategory) && testCategory.StartsWith(nameof(Windows));
- Production = !string.IsNullOrEmpty(testCategory) && testCategory.EndsWith(nameof(Production));
- Development = !string.IsNullOrEmpty(testCategory) && testCategory.EndsWith(nameof(Development));
- }
- Profile = GetProfile();
- AppSettingsFileName = GetAppSettingsFileName(processesCount: null);
- }
-
- public IsEnvironment(bool isDevelopment, bool isStaging, bool isProduction)
- {
- Staging = isStaging;
- Production = isProduction;
- Development = isDevelopment;
- OSX = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
- Linux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
- DebuggerWasAttachedDuringConstructor = Debugger.IsAttached;
- Windows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
- ASPNetCoreEnvironment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
- Profile = GetProfile();
- AppSettingsFileName = GetAppSettingsFileName(processesCount: null);
- }
-
- public IsEnvironment(int? processesCount, bool nullASPNetCoreEnvironmentIsDevelopment, bool nullASPNetCoreEnvironmentIsProduction)
- {
- OSX = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
- Linux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
- DebuggerWasAttachedDuringConstructor = Debugger.IsAttached;
- Windows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
- ASPNetCoreEnvironment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
- if (nullASPNetCoreEnvironmentIsDevelopment && nullASPNetCoreEnvironmentIsProduction)
- throw new Exception();
- else if (string.IsNullOrEmpty(ASPNetCoreEnvironment) && nullASPNetCoreEnvironmentIsProduction)
- Production = true;
- else if (string.IsNullOrEmpty(ASPNetCoreEnvironment) && nullASPNetCoreEnvironmentIsDevelopment)
- Development = true;
- else if (string.IsNullOrEmpty(ASPNetCoreEnvironment) && !nullASPNetCoreEnvironmentIsDevelopment && !nullASPNetCoreEnvironmentIsProduction)
- throw new Exception();
- else
- {
- Staging = ASPNetCoreEnvironment is not null && ASPNetCoreEnvironment.EndsWith(nameof(Staging));
- Production = ASPNetCoreEnvironment is not null && ASPNetCoreEnvironment.EndsWith(nameof(Production));
- Development = ASPNetCoreEnvironment is not null && ASPNetCoreEnvironment.EndsWith(nameof(Development));
- }
- Profile = GetProfile();
- AppSettingsFileName = GetAppSettingsFileName(processesCount);
- }
-
- private string GetProfile()
- {
- string result;
- if (Windows && Production)
- result = nameof(Production);
- else if (Windows && Staging)
- result = nameof(Staging);
- else if (Windows && Development)
- result = nameof(Development);
- else if (Linux && Production)
- result = nameof(Name.LinuxProduction);
- else if (Linux && Staging)
- result = nameof(Name.LinuxStaging);
- else if (Linux && Development)
- result = nameof(Name.LinuxDevelopment);
- else if (OSX && Production)
- result = nameof(Name.OSXProduction);
- else if (OSX && Staging)
- result = nameof(Name.OSXStaging);
- else if (OSX && Development)
- result = nameof(Name.OSXDevelopment);
- else
- throw new Exception();
- return result;
- }
-
- private string GetAppSettingsFileName(int? processesCount)
- {
- string result;
- if (Production)
- {
- if (processesCount is null)
- result = "appsettings.json";
- else
- result = $"appsettings.{processesCount}.json";
- }
- else
- {
- string environment;
- if (Staging)
- environment = nameof(Staging);
- else if (Development)
- environment = nameof(Development);
- else
- throw new Exception();
- if (processesCount is null)
- result = $"appsettings.{environment}.json";
- else
- result = $"appsettings.{environment}.{processesCount}.json";
- }
- return result;
- }
-
- public static string GetEnvironmentName(IsEnvironment isEnvironment)
- {
- string result;
- if (isEnvironment.Windows)
- result = nameof(IsEnvironment.Windows);
- else if (isEnvironment.Linux)
- result = nameof(IsEnvironment.Linux);
- else if (isEnvironment.OSX)
- result = nameof(IsEnvironment.OSX);
- else
- throw new Exception();
- return result;
- }
-
- }
-
-}
\ No newline at end of file
diff --git a/EDA Viewer/Shared/RijndaelEncryption.cs b/EDA Viewer/Shared/RijndaelEncryption.cs
deleted file mode 100644
index a1e1c6c..0000000
--- a/EDA Viewer/Shared/RijndaelEncryption.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-using System;
-using System.IO;
-using System.Security.Cryptography;
-using System.Text;
-using System.Text.RegularExpressions;
-
-namespace Shared
-{
-
- public static class RijndaelEncryption
- {
- ///
- /// Change the Inputkey GUID when you use this code in your own program.
- /// Keep this inputkey very safe and prevent someone from decoding it some way!!
- /// Generated 2021-08-10
- ///
- internal const string Inputkey = "970CCEF6-4307-4F6A-9AC8-377DADB889BD";
-
- ///
- /// Encrypt the given text and give the byte array back as a BASE64 string
- ///
- /// The text to encrypt
- /// The pasword salt
- /// The encrypted text
- public static string Encrypt(string text, string salt)
- {
- string result;
- if (string.IsNullOrEmpty(text))
- throw new ArgumentNullException("text");
- RijndaelManaged aesAlg = NewRijndaelManaged(salt);
- ICryptoTransform encryptor = aesAlg.CreateEncryptor(aesAlg.Key, aesAlg.IV);
- MemoryStream msEncrypt = new MemoryStream();
- using (CryptoStream csEncrypt = new CryptoStream(msEncrypt, encryptor, CryptoStreamMode.Write))
- using (StreamWriter swEncrypt = new StreamWriter(csEncrypt))
- swEncrypt.Write(text);
- result = Convert.ToBase64String(msEncrypt.ToArray());
- return result;
- }
-
- ///
- /// Checks if a string is base64 encoded
- ///
- /// The base64 encoded string
- ///
- public static bool IsBase64String(string base64String)
- {
- bool result;
- base64String = base64String.Trim();
- result = (base64String.Length % 4 == 0) && Regex.IsMatch(base64String, @"^[a-zA-Z0-9\+/]*={0,3}$", RegexOptions.None);
- return result;
- }
-
- ///
- /// Decrypts the given text
- ///
- /// The encrypted BASE64 text
- /// The pasword salt
- /// De gedecrypte text
- public static string Decrypt(string cipherText, string salt)
- {
- if (string.IsNullOrEmpty(cipherText))
- throw new ArgumentNullException("cipherText");
- if (!IsBase64String(cipherText))
- throw new Exception("The cipherText input parameter is not base64 encoded");
- string text;
- RijndaelManaged aesAlg = NewRijndaelManaged(salt);
- ICryptoTransform decryptor = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV);
- byte[] cipher = Convert.FromBase64String(cipherText);
- using (MemoryStream msDecrypt = new MemoryStream(cipher))
- {
- using CryptoStream csDecrypt = new CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read);
- using StreamReader srDecrypt = new StreamReader(csDecrypt);
- text = srDecrypt.ReadToEnd();
- }
- return text;
- }
-
- ///
- /// Create a new RijndaelManaged class and initialize it
- ///
- /// The pasword salt
- ///
- private static RijndaelManaged NewRijndaelManaged(string salt)
- {
- if (salt == null)
- throw new ArgumentNullException("salt");
- byte[] saltBytes = Encoding.ASCII.GetBytes(salt);
- Rfc2898DeriveBytes key = new Rfc2898DeriveBytes(Inputkey, saltBytes);
- RijndaelManaged aesAlg = new RijndaelManaged();
- aesAlg.Key = key.GetBytes(aesAlg.KeySize / 8);
- aesAlg.IV = key.GetBytes(aesAlg.BlockSize / 8);
- return aesAlg;
- }
- }
-
-}
\ No newline at end of file
diff --git a/EDA Viewer/Singleton/Background.cs b/EDA Viewer/Singleton/Background.cs
index 74a428a..f65c9aa 100644
--- a/EDA Viewer/Singleton/Background.cs
+++ b/EDA Viewer/Singleton/Background.cs
@@ -1,367 +1,362 @@
using EDAViewer.Models;
+using EDAViewer.Models.Methods;
using EDAViewer.Singleton.Helper;
-using Infineon.Monitoring.MonA;
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.Logging;
-using Shared;
-using System;
-using System.Collections.Generic;
+using IFX.Shared;
using System.Globalization;
-using System.IO;
using System.IO.Compression;
-using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.Json;
using System.Text.RegularExpressions;
-using System.Threading;
using System.Xml;
using System.Xml.Serialization;
-namespace EDAViewer.Singleton
+namespace EDAViewer.Singleton;
+
+public class Background : Models.Properties.IBackground, IBackground, IDisposable
{
- public partial class Background : IBackground
+ protected readonly List _Exceptions;
+ protected readonly List _Timers;
+ protected readonly string _WorkingDirectory;
+ protected string _Message;
+ public List Exceptions => _Exceptions;
+ public List Timers => _Timers;
+ public string Message => _Message;
+ public string WorkingDirectory => _WorkingDirectory;
+
+ private bool _Stop;
+ private readonly object _Lock;
+ private readonly Calendar _Calendar;
+ private readonly Serilog.ILogger _Log;
+ private DateTime _PrimaryInstanceSetAt;
+ private readonly AppSettings _AppSettings;
+ private readonly IsEnvironment _IsEnvironment;
+ private string _EdaDataCollectionPlansLastRun;
+
+ public Background(IsEnvironment isEnvironment, AppSettings appSettings, string workingDirectory)
{
+ _Stop = false;
+ _Timers = new();
+ _Lock = new object();
+ _Message = string.Empty;
+ _AppSettings = appSettings;
+ _IsEnvironment = isEnvironment;
+ _Exceptions = new List();
+ _WorkingDirectory = workingDirectory;
+ _PrimaryInstanceSetAt = DateTime.MinValue;
+ _Log = Serilog.Log.ForContext();
+ _Calendar = new CultureInfo("en-US").Calendar;
+ _EdaDataCollectionPlansLastRun = string.Empty;
+ }
- public List Timers => _Timers;
- public string Message { get; private set; }
- public string WorkingDirectory { get; private set; }
- public List Exceptions { get; private set; }
+ void IBackground.Catch(Exception exception)
+ {
+ _Exceptions.Add(exception);
+ _Log.Error(exception, "Error:");
+ }
- private bool _ShuttingDown;
- private readonly object _Lock;
- private readonly Calendar _Calendar;
- private readonly List _Timers;
- private readonly AppSettings _AppSettings;
- private readonly string[] _SiEquipmentTypes;
- private readonly string[] _GaNEquipmentTypes;
- private readonly IsEnvironment _IsEnvironment;
+ void IBackground.Stop(bool immediate)
+ {
+ if (!_Stop)
+ _Stop = true;
+ foreach (Timer timer in _Timers)
+ _ = timer.Change(Timeout.Infinite, 0);
+ }
- private const string _Site = "sjc";
-
- private Log _Log;
- private DateTime _PrimaryInstanceSetAt;
- private string _EdaDataCollectionPlansLastRun;
-
- public Background(IsEnvironment isEnvironment, AppSettings appSettings, string workingDirectory)
- {
- _Log = null;
- Exceptions = new();
- _IsEnvironment = isEnvironment;
- _Lock = new object();
- _ShuttingDown = false;
- if (_Lock is null)
- { }
- Message = string.Empty;
- _AppSettings = appSettings;
- _Timers = new List();
- _IsEnvironment = isEnvironment;
- WorkingDirectory = workingDirectory;
- _PrimaryInstanceSetAt = DateTime.MinValue;
- _EdaDataCollectionPlansLastRun = string.Empty;
- _SiEquipmentTypes = GetEquipmentTypes(isGaN: false, isSi: true);
- _GaNEquipmentTypes = GetEquipmentTypes(isGaN: true, isSi: false);
- CultureInfo cultureInfo = new CultureInfo("en-US");
- _Calendar = cultureInfo.Calendar;
- }
-
- public void Dispose()
- {
- foreach (Timer timer in _Timers)
- timer.Dispose();
- }
-
- void IBackground.Update(ILogger