Reformat code
This commit is contained in:
579
.editorconfig
Normal file
579
.editorconfig
Normal file
@@ -0,0 +1,579 @@
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
insert_final_newline = false
|
||||
max_line_length = 120
|
||||
tab_width = 4
|
||||
trim_trailing_whitespace = false
|
||||
ij_continuation_indent_size = 8
|
||||
ij_formatter_off_tag = @formatter:off
|
||||
ij_formatter_on_tag = @formatter:on
|
||||
ij_formatter_tags_enabled = true
|
||||
ij_smart_tabs = false
|
||||
ij_visual_guides = none
|
||||
ij_wrap_on_typing = false
|
||||
|
||||
[*.css]
|
||||
ij_css_align_closing_brace_with_properties = false
|
||||
ij_css_blank_lines_around_nested_selector = 1
|
||||
ij_css_blank_lines_between_blocks = 1
|
||||
ij_css_block_comment_add_space = false
|
||||
ij_css_brace_placement = end_of_line
|
||||
ij_css_enforce_quotes_on_format = false
|
||||
ij_css_hex_color_long_format = false
|
||||
ij_css_hex_color_lower_case = false
|
||||
ij_css_hex_color_short_format = false
|
||||
ij_css_hex_color_upper_case = false
|
||||
ij_css_keep_blank_lines_in_code = 2
|
||||
ij_css_keep_indents_on_empty_lines = false
|
||||
ij_css_keep_single_line_blocks = false
|
||||
ij_css_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow
|
||||
ij_css_space_after_colon = true
|
||||
ij_css_space_before_opening_brace = true
|
||||
ij_css_use_double_quotes = true
|
||||
ij_css_value_alignment = do_not_align
|
||||
|
||||
[*.less]
|
||||
indent_size = 2
|
||||
ij_less_align_closing_brace_with_properties = false
|
||||
ij_less_blank_lines_around_nested_selector = 1
|
||||
ij_less_blank_lines_between_blocks = 1
|
||||
ij_less_block_comment_add_space = false
|
||||
ij_less_brace_placement = 0
|
||||
ij_less_enforce_quotes_on_format = false
|
||||
ij_less_hex_color_long_format = false
|
||||
ij_less_hex_color_lower_case = false
|
||||
ij_less_hex_color_short_format = false
|
||||
ij_less_hex_color_upper_case = false
|
||||
ij_less_keep_blank_lines_in_code = 2
|
||||
ij_less_keep_indents_on_empty_lines = false
|
||||
ij_less_keep_single_line_blocks = false
|
||||
ij_less_line_comment_add_space = false
|
||||
ij_less_line_comment_at_first_column = false
|
||||
ij_less_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow
|
||||
ij_less_space_after_colon = true
|
||||
ij_less_space_before_opening_brace = true
|
||||
ij_less_use_double_quotes = true
|
||||
ij_less_value_alignment = 0
|
||||
|
||||
[*.properties]
|
||||
ij_properties_align_group_field_declarations = false
|
||||
ij_properties_keep_blank_lines = false
|
||||
ij_properties_key_value_delimiter = equals
|
||||
ij_properties_spaces_around_key_value_delimiter = false
|
||||
|
||||
[*.sass]
|
||||
indent_size = 2
|
||||
ij_sass_align_closing_brace_with_properties = false
|
||||
ij_sass_blank_lines_around_nested_selector = 1
|
||||
ij_sass_blank_lines_between_blocks = 1
|
||||
ij_sass_brace_placement = 0
|
||||
ij_sass_enforce_quotes_on_format = false
|
||||
ij_sass_hex_color_long_format = false
|
||||
ij_sass_hex_color_lower_case = false
|
||||
ij_sass_hex_color_short_format = false
|
||||
ij_sass_hex_color_upper_case = false
|
||||
ij_sass_keep_blank_lines_in_code = 2
|
||||
ij_sass_keep_indents_on_empty_lines = false
|
||||
ij_sass_keep_single_line_blocks = false
|
||||
ij_sass_line_comment_add_space = false
|
||||
ij_sass_line_comment_at_first_column = false
|
||||
ij_sass_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow
|
||||
ij_sass_space_after_colon = true
|
||||
ij_sass_space_before_opening_brace = true
|
||||
ij_sass_use_double_quotes = true
|
||||
ij_sass_value_alignment = 0
|
||||
|
||||
[*.scss]
|
||||
indent_size = 2
|
||||
ij_scss_align_closing_brace_with_properties = false
|
||||
ij_scss_blank_lines_around_nested_selector = 1
|
||||
ij_scss_blank_lines_between_blocks = 1
|
||||
ij_scss_block_comment_add_space = false
|
||||
ij_scss_brace_placement = 0
|
||||
ij_scss_enforce_quotes_on_format = false
|
||||
ij_scss_hex_color_long_format = false
|
||||
ij_scss_hex_color_lower_case = false
|
||||
ij_scss_hex_color_short_format = false
|
||||
ij_scss_hex_color_upper_case = false
|
||||
ij_scss_keep_blank_lines_in_code = 2
|
||||
ij_scss_keep_indents_on_empty_lines = false
|
||||
ij_scss_keep_single_line_blocks = false
|
||||
ij_scss_line_comment_add_space = false
|
||||
ij_scss_line_comment_at_first_column = false
|
||||
ij_scss_properties_order = font,font-family,font-size,font-weight,font-style,font-variant,font-size-adjust,font-stretch,line-height,position,z-index,top,right,bottom,left,display,visibility,float,clear,overflow,overflow-x,overflow-y,clip,zoom,align-content,align-items,align-self,flex,flex-flow,flex-basis,flex-direction,flex-grow,flex-shrink,flex-wrap,justify-content,order,box-sizing,width,min-width,max-width,height,min-height,max-height,margin,margin-top,margin-right,margin-bottom,margin-left,padding,padding-top,padding-right,padding-bottom,padding-left,table-layout,empty-cells,caption-side,border-spacing,border-collapse,list-style,list-style-position,list-style-type,list-style-image,content,quotes,counter-reset,counter-increment,resize,cursor,user-select,nav-index,nav-up,nav-right,nav-down,nav-left,transition,transition-delay,transition-timing-function,transition-duration,transition-property,transform,transform-origin,animation,animation-name,animation-duration,animation-play-state,animation-timing-function,animation-delay,animation-iteration-count,animation-direction,text-align,text-align-last,vertical-align,white-space,text-decoration,text-emphasis,text-emphasis-color,text-emphasis-style,text-emphasis-position,text-indent,text-justify,letter-spacing,word-spacing,text-outline,text-transform,text-wrap,text-overflow,text-overflow-ellipsis,text-overflow-mode,word-wrap,word-break,tab-size,hyphens,pointer-events,opacity,color,border,border-width,border-style,border-color,border-top,border-top-width,border-top-style,border-top-color,border-right,border-right-width,border-right-style,border-right-color,border-bottom,border-bottom-width,border-bottom-style,border-bottom-color,border-left,border-left-width,border-left-style,border-left-color,border-radius,border-top-left-radius,border-top-right-radius,border-bottom-right-radius,border-bottom-left-radius,border-image,border-image-source,border-image-slice,border-image-width,border-image-outset,border-image-repeat,outline,outline-width,outline-style,outline-color,outline-offset,background,background-color,background-image,background-repeat,background-attachment,background-position,background-position-x,background-position-y,background-clip,background-origin,background-size,box-decoration-break,box-shadow,text-shadow
|
||||
ij_scss_space_after_colon = true
|
||||
ij_scss_space_before_opening_brace = true
|
||||
ij_scss_use_double_quotes = true
|
||||
ij_scss_value_alignment = 0
|
||||
|
||||
[*.vue]
|
||||
indent_size = 2
|
||||
tab_width = 2
|
||||
ij_continuation_indent_size = 4
|
||||
ij_vue_indent_children_of_top_level = template
|
||||
ij_vue_interpolation_new_line_after_start_delimiter = true
|
||||
ij_vue_interpolation_new_line_before_end_delimiter = true
|
||||
ij_vue_interpolation_wrap = off
|
||||
ij_vue_keep_indents_on_empty_lines = false
|
||||
ij_vue_spaces_within_interpolation_expressions = true
|
||||
|
||||
[.editorconfig]
|
||||
ij_editorconfig_align_group_field_declarations = false
|
||||
ij_editorconfig_space_after_colon = false
|
||||
ij_editorconfig_space_after_comma = true
|
||||
ij_editorconfig_space_before_colon = false
|
||||
ij_editorconfig_space_before_comma = false
|
||||
ij_editorconfig_spaces_around_assignment_operators = true
|
||||
|
||||
[{*.ant,*.appxmanifest,*.axml,*.cscfg,*.csdef,*.disco,*.dotsettings,*.filelayout,*.fxml,*.jhm,*.jnlp,*.jrxml,*.manifest,*.myapp,*.nuspec,*.rng,*.stylecop,*.svcmap,*.tld,*.wadcfgx,*.webref,*.wsdl,*.xml,*.xsd,*.xsl,*.xslt,*.xul,StyleCop.Cache}]
|
||||
ij_xml_align_attributes = true
|
||||
ij_xml_align_text = false
|
||||
ij_xml_attribute_wrap = normal
|
||||
ij_xml_block_comment_add_space = false
|
||||
ij_xml_block_comment_at_first_column = true
|
||||
ij_xml_keep_blank_lines = 2
|
||||
ij_xml_keep_indents_on_empty_lines = false
|
||||
ij_xml_keep_line_breaks = true
|
||||
ij_xml_keep_line_breaks_in_text = true
|
||||
ij_xml_keep_whitespaces = false
|
||||
ij_xml_keep_whitespaces_around_cdata = preserve
|
||||
ij_xml_keep_whitespaces_inside_cdata = false
|
||||
ij_xml_line_comment_at_first_column = true
|
||||
ij_xml_space_after_tag_name = false
|
||||
ij_xml_space_around_equals_in_attribute = false
|
||||
ij_xml_space_inside_empty_tag = false
|
||||
ij_xml_text_wrap = normal
|
||||
|
||||
[{*.ats,*.cts,*.mts,*.ts}]
|
||||
ij_continuation_indent_size = 4
|
||||
ij_typescript_align_imports = false
|
||||
ij_typescript_align_multiline_array_initializer_expression = false
|
||||
ij_typescript_align_multiline_binary_operation = false
|
||||
ij_typescript_align_multiline_chained_methods = false
|
||||
ij_typescript_align_multiline_extends_list = false
|
||||
ij_typescript_align_multiline_for = true
|
||||
ij_typescript_align_multiline_parameters = true
|
||||
ij_typescript_align_multiline_parameters_in_calls = false
|
||||
ij_typescript_align_multiline_ternary_operation = false
|
||||
ij_typescript_align_object_properties = 0
|
||||
ij_typescript_align_union_types = false
|
||||
ij_typescript_align_var_statements = 0
|
||||
ij_typescript_array_initializer_new_line_after_left_brace = false
|
||||
ij_typescript_array_initializer_right_brace_on_new_line = false
|
||||
ij_typescript_array_initializer_wrap = off
|
||||
ij_typescript_assignment_wrap = off
|
||||
ij_typescript_binary_operation_sign_on_next_line = false
|
||||
ij_typescript_binary_operation_wrap = off
|
||||
ij_typescript_blacklist_imports = rxjs/Rx,node_modules/**,**/node_modules/**,@angular/material,@angular/material/typings/**
|
||||
ij_typescript_blank_lines_after_imports = 1
|
||||
ij_typescript_blank_lines_around_class = 1
|
||||
ij_typescript_blank_lines_around_field = 0
|
||||
ij_typescript_blank_lines_around_field_in_interface = 0
|
||||
ij_typescript_blank_lines_around_function = 1
|
||||
ij_typescript_blank_lines_around_method = 1
|
||||
ij_typescript_blank_lines_around_method_in_interface = 1
|
||||
ij_typescript_block_brace_style = end_of_line
|
||||
ij_typescript_block_comment_add_space = false
|
||||
ij_typescript_block_comment_at_first_column = true
|
||||
ij_typescript_call_parameters_new_line_after_left_paren = false
|
||||
ij_typescript_call_parameters_right_paren_on_new_line = false
|
||||
ij_typescript_call_parameters_wrap = off
|
||||
ij_typescript_catch_on_new_line = false
|
||||
ij_typescript_chained_call_dot_on_new_line = true
|
||||
ij_typescript_class_brace_style = end_of_line
|
||||
ij_typescript_comma_on_new_line = false
|
||||
ij_typescript_do_while_brace_force = never
|
||||
ij_typescript_else_on_new_line = false
|
||||
ij_typescript_enforce_trailing_comma = keep
|
||||
ij_typescript_enum_constants_wrap = on_every_item
|
||||
ij_typescript_extends_keyword_wrap = off
|
||||
ij_typescript_extends_list_wrap = off
|
||||
ij_typescript_field_prefix = _
|
||||
ij_typescript_file_name_style = relaxed
|
||||
ij_typescript_finally_on_new_line = false
|
||||
ij_typescript_for_brace_force = never
|
||||
ij_typescript_for_statement_new_line_after_left_paren = false
|
||||
ij_typescript_for_statement_right_paren_on_new_line = false
|
||||
ij_typescript_for_statement_wrap = off
|
||||
ij_typescript_force_quote_style = false
|
||||
ij_typescript_force_semicolon_style = false
|
||||
ij_typescript_function_expression_brace_style = end_of_line
|
||||
ij_typescript_if_brace_force = never
|
||||
ij_typescript_import_merge_members = global
|
||||
ij_typescript_import_prefer_absolute_path = global
|
||||
ij_typescript_import_sort_members = true
|
||||
ij_typescript_import_sort_module_name = false
|
||||
ij_typescript_import_use_node_resolution = true
|
||||
ij_typescript_imports_wrap = on_every_item
|
||||
ij_typescript_indent_case_from_switch = true
|
||||
ij_typescript_indent_chained_calls = true
|
||||
ij_typescript_indent_package_children = 0
|
||||
ij_typescript_jsdoc_include_types = false
|
||||
ij_typescript_jsx_attribute_value = braces
|
||||
ij_typescript_keep_blank_lines_in_code = 2
|
||||
ij_typescript_keep_first_column_comment = true
|
||||
ij_typescript_keep_indents_on_empty_lines = false
|
||||
ij_typescript_keep_line_breaks = true
|
||||
ij_typescript_keep_simple_blocks_in_one_line = false
|
||||
ij_typescript_keep_simple_methods_in_one_line = false
|
||||
ij_typescript_line_comment_add_space = true
|
||||
ij_typescript_line_comment_at_first_column = false
|
||||
ij_typescript_method_brace_style = end_of_line
|
||||
ij_typescript_method_call_chain_wrap = off
|
||||
ij_typescript_method_parameters_new_line_after_left_paren = false
|
||||
ij_typescript_method_parameters_right_paren_on_new_line = false
|
||||
ij_typescript_method_parameters_wrap = off
|
||||
ij_typescript_object_literal_wrap = on_every_item
|
||||
ij_typescript_object_types_wrap = on_every_item
|
||||
ij_typescript_parentheses_expression_new_line_after_left_paren = false
|
||||
ij_typescript_parentheses_expression_right_paren_on_new_line = false
|
||||
ij_typescript_place_assignment_sign_on_next_line = false
|
||||
ij_typescript_prefer_as_type_cast = false
|
||||
ij_typescript_prefer_explicit_types_function_expression_returns = false
|
||||
ij_typescript_prefer_explicit_types_function_returns = false
|
||||
ij_typescript_prefer_explicit_types_vars_fields = false
|
||||
ij_typescript_prefer_parameters_wrap = false
|
||||
ij_typescript_reformat_c_style_comments = false
|
||||
ij_typescript_space_after_colon = true
|
||||
ij_typescript_space_after_comma = true
|
||||
ij_typescript_space_after_dots_in_rest_parameter = false
|
||||
ij_typescript_space_after_generator_mult = true
|
||||
ij_typescript_space_after_property_colon = true
|
||||
ij_typescript_space_after_quest = true
|
||||
ij_typescript_space_after_type_colon = true
|
||||
ij_typescript_space_after_unary_not = false
|
||||
ij_typescript_space_before_async_arrow_lparen = true
|
||||
ij_typescript_space_before_catch_keyword = true
|
||||
ij_typescript_space_before_catch_left_brace = true
|
||||
ij_typescript_space_before_catch_parentheses = true
|
||||
ij_typescript_space_before_class_lbrace = true
|
||||
ij_typescript_space_before_class_left_brace = true
|
||||
ij_typescript_space_before_colon = true
|
||||
ij_typescript_space_before_comma = false
|
||||
ij_typescript_space_before_do_left_brace = true
|
||||
ij_typescript_space_before_else_keyword = true
|
||||
ij_typescript_space_before_else_left_brace = true
|
||||
ij_typescript_space_before_finally_keyword = true
|
||||
ij_typescript_space_before_finally_left_brace = true
|
||||
ij_typescript_space_before_for_left_brace = true
|
||||
ij_typescript_space_before_for_parentheses = true
|
||||
ij_typescript_space_before_for_semicolon = false
|
||||
ij_typescript_space_before_function_left_parenth = true
|
||||
ij_typescript_space_before_generator_mult = false
|
||||
ij_typescript_space_before_if_left_brace = true
|
||||
ij_typescript_space_before_if_parentheses = true
|
||||
ij_typescript_space_before_method_call_parentheses = false
|
||||
ij_typescript_space_before_method_left_brace = true
|
||||
ij_typescript_space_before_method_parentheses = false
|
||||
ij_typescript_space_before_property_colon = false
|
||||
ij_typescript_space_before_quest = true
|
||||
ij_typescript_space_before_switch_left_brace = true
|
||||
ij_typescript_space_before_switch_parentheses = true
|
||||
ij_typescript_space_before_try_left_brace = true
|
||||
ij_typescript_space_before_type_colon = false
|
||||
ij_typescript_space_before_unary_not = false
|
||||
ij_typescript_space_before_while_keyword = true
|
||||
ij_typescript_space_before_while_left_brace = true
|
||||
ij_typescript_space_before_while_parentheses = true
|
||||
ij_typescript_spaces_around_additive_operators = true
|
||||
ij_typescript_spaces_around_arrow_function_operator = true
|
||||
ij_typescript_spaces_around_assignment_operators = true
|
||||
ij_typescript_spaces_around_bitwise_operators = true
|
||||
ij_typescript_spaces_around_equality_operators = true
|
||||
ij_typescript_spaces_around_logical_operators = true
|
||||
ij_typescript_spaces_around_multiplicative_operators = true
|
||||
ij_typescript_spaces_around_relational_operators = true
|
||||
ij_typescript_spaces_around_shift_operators = true
|
||||
ij_typescript_spaces_around_unary_operator = false
|
||||
ij_typescript_spaces_within_array_initializer_brackets = false
|
||||
ij_typescript_spaces_within_brackets = false
|
||||
ij_typescript_spaces_within_catch_parentheses = false
|
||||
ij_typescript_spaces_within_for_parentheses = false
|
||||
ij_typescript_spaces_within_if_parentheses = false
|
||||
ij_typescript_spaces_within_imports = false
|
||||
ij_typescript_spaces_within_interpolation_expressions = false
|
||||
ij_typescript_spaces_within_method_call_parentheses = false
|
||||
ij_typescript_spaces_within_method_parentheses = false
|
||||
ij_typescript_spaces_within_object_literal_braces = false
|
||||
ij_typescript_spaces_within_object_type_braces = true
|
||||
ij_typescript_spaces_within_parentheses = false
|
||||
ij_typescript_spaces_within_switch_parentheses = false
|
||||
ij_typescript_spaces_within_type_assertion = false
|
||||
ij_typescript_spaces_within_union_types = true
|
||||
ij_typescript_spaces_within_while_parentheses = false
|
||||
ij_typescript_special_else_if_treatment = true
|
||||
ij_typescript_ternary_operation_signs_on_next_line = false
|
||||
ij_typescript_ternary_operation_wrap = off
|
||||
ij_typescript_union_types_wrap = on_every_item
|
||||
ij_typescript_use_chained_calls_group_indents = false
|
||||
ij_typescript_use_double_quotes = true
|
||||
ij_typescript_use_explicit_js_extension = auto
|
||||
ij_typescript_use_path_mapping = always
|
||||
ij_typescript_use_public_modifier = false
|
||||
ij_typescript_use_semicolon_after_statement = true
|
||||
ij_typescript_var_declaration_wrap = normal
|
||||
ij_typescript_while_brace_force = never
|
||||
ij_typescript_while_on_new_line = false
|
||||
ij_typescript_wrap_comments = false
|
||||
|
||||
[{*.bash,*.sh,*.zsh}]
|
||||
indent_size = 2
|
||||
tab_width = 2
|
||||
ij_shell_binary_ops_start_line = false
|
||||
ij_shell_keep_column_alignment_padding = false
|
||||
ij_shell_minify_program = false
|
||||
ij_shell_redirect_followed_by_space = false
|
||||
ij_shell_switch_cases_indented = false
|
||||
ij_shell_use_unix_line_separator = true
|
||||
|
||||
[{*.cjs,*.js}]
|
||||
ij_continuation_indent_size = 4
|
||||
ij_javascript_align_imports = false
|
||||
ij_javascript_align_multiline_array_initializer_expression = false
|
||||
ij_javascript_align_multiline_binary_operation = false
|
||||
ij_javascript_align_multiline_chained_methods = false
|
||||
ij_javascript_align_multiline_extends_list = false
|
||||
ij_javascript_align_multiline_for = true
|
||||
ij_javascript_align_multiline_parameters = true
|
||||
ij_javascript_align_multiline_parameters_in_calls = false
|
||||
ij_javascript_align_multiline_ternary_operation = false
|
||||
ij_javascript_align_object_properties = 0
|
||||
ij_javascript_align_union_types = false
|
||||
ij_javascript_align_var_statements = 0
|
||||
ij_javascript_array_initializer_new_line_after_left_brace = false
|
||||
ij_javascript_array_initializer_right_brace_on_new_line = false
|
||||
ij_javascript_array_initializer_wrap = off
|
||||
ij_javascript_assignment_wrap = off
|
||||
ij_javascript_binary_operation_sign_on_next_line = false
|
||||
ij_javascript_binary_operation_wrap = off
|
||||
ij_javascript_blacklist_imports = rxjs/Rx,node_modules/**,**/node_modules/**,@angular/material,@angular/material/typings/**
|
||||
ij_javascript_blank_lines_after_imports = 1
|
||||
ij_javascript_blank_lines_around_class = 1
|
||||
ij_javascript_blank_lines_around_field = 0
|
||||
ij_javascript_blank_lines_around_function = 1
|
||||
ij_javascript_blank_lines_around_method = 1
|
||||
ij_javascript_block_brace_style = end_of_line
|
||||
ij_javascript_block_comment_add_space = false
|
||||
ij_javascript_block_comment_at_first_column = true
|
||||
ij_javascript_call_parameters_new_line_after_left_paren = false
|
||||
ij_javascript_call_parameters_right_paren_on_new_line = false
|
||||
ij_javascript_call_parameters_wrap = off
|
||||
ij_javascript_catch_on_new_line = false
|
||||
ij_javascript_chained_call_dot_on_new_line = true
|
||||
ij_javascript_class_brace_style = end_of_line
|
||||
ij_javascript_comma_on_new_line = false
|
||||
ij_javascript_do_while_brace_force = never
|
||||
ij_javascript_else_on_new_line = false
|
||||
ij_javascript_enforce_trailing_comma = keep
|
||||
ij_javascript_extends_keyword_wrap = off
|
||||
ij_javascript_extends_list_wrap = off
|
||||
ij_javascript_field_prefix = _
|
||||
ij_javascript_file_name_style = relaxed
|
||||
ij_javascript_finally_on_new_line = false
|
||||
ij_javascript_for_brace_force = never
|
||||
ij_javascript_for_statement_new_line_after_left_paren = false
|
||||
ij_javascript_for_statement_right_paren_on_new_line = false
|
||||
ij_javascript_for_statement_wrap = off
|
||||
ij_javascript_force_quote_style = false
|
||||
ij_javascript_force_semicolon_style = false
|
||||
ij_javascript_function_expression_brace_style = end_of_line
|
||||
ij_javascript_if_brace_force = never
|
||||
ij_javascript_import_merge_members = global
|
||||
ij_javascript_import_prefer_absolute_path = global
|
||||
ij_javascript_import_sort_members = true
|
||||
ij_javascript_import_sort_module_name = false
|
||||
ij_javascript_import_use_node_resolution = true
|
||||
ij_javascript_imports_wrap = on_every_item
|
||||
ij_javascript_indent_case_from_switch = true
|
||||
ij_javascript_indent_chained_calls = true
|
||||
ij_javascript_indent_package_children = 0
|
||||
ij_javascript_jsx_attribute_value = braces
|
||||
ij_javascript_keep_blank_lines_in_code = 2
|
||||
ij_javascript_keep_first_column_comment = true
|
||||
ij_javascript_keep_indents_on_empty_lines = false
|
||||
ij_javascript_keep_line_breaks = true
|
||||
ij_javascript_keep_simple_blocks_in_one_line = false
|
||||
ij_javascript_keep_simple_methods_in_one_line = false
|
||||
ij_javascript_line_comment_add_space = true
|
||||
ij_javascript_line_comment_at_first_column = false
|
||||
ij_javascript_method_brace_style = end_of_line
|
||||
ij_javascript_method_call_chain_wrap = off
|
||||
ij_javascript_method_parameters_new_line_after_left_paren = false
|
||||
ij_javascript_method_parameters_right_paren_on_new_line = false
|
||||
ij_javascript_method_parameters_wrap = off
|
||||
ij_javascript_object_literal_wrap = on_every_item
|
||||
ij_javascript_object_types_wrap = on_every_item
|
||||
ij_javascript_parentheses_expression_new_line_after_left_paren = false
|
||||
ij_javascript_parentheses_expression_right_paren_on_new_line = false
|
||||
ij_javascript_place_assignment_sign_on_next_line = false
|
||||
ij_javascript_prefer_as_type_cast = false
|
||||
ij_javascript_prefer_explicit_types_function_expression_returns = false
|
||||
ij_javascript_prefer_explicit_types_function_returns = false
|
||||
ij_javascript_prefer_explicit_types_vars_fields = false
|
||||
ij_javascript_prefer_parameters_wrap = false
|
||||
ij_javascript_reformat_c_style_comments = false
|
||||
ij_javascript_space_after_colon = true
|
||||
ij_javascript_space_after_comma = true
|
||||
ij_javascript_space_after_dots_in_rest_parameter = false
|
||||
ij_javascript_space_after_generator_mult = true
|
||||
ij_javascript_space_after_property_colon = true
|
||||
ij_javascript_space_after_quest = true
|
||||
ij_javascript_space_after_type_colon = true
|
||||
ij_javascript_space_after_unary_not = false
|
||||
ij_javascript_space_before_async_arrow_lparen = true
|
||||
ij_javascript_space_before_catch_keyword = true
|
||||
ij_javascript_space_before_catch_left_brace = true
|
||||
ij_javascript_space_before_catch_parentheses = true
|
||||
ij_javascript_space_before_class_lbrace = true
|
||||
ij_javascript_space_before_class_left_brace = true
|
||||
ij_javascript_space_before_colon = true
|
||||
ij_javascript_space_before_comma = false
|
||||
ij_javascript_space_before_do_left_brace = true
|
||||
ij_javascript_space_before_else_keyword = true
|
||||
ij_javascript_space_before_else_left_brace = true
|
||||
ij_javascript_space_before_finally_keyword = true
|
||||
ij_javascript_space_before_finally_left_brace = true
|
||||
ij_javascript_space_before_for_left_brace = true
|
||||
ij_javascript_space_before_for_parentheses = true
|
||||
ij_javascript_space_before_for_semicolon = false
|
||||
ij_javascript_space_before_function_left_parenth = true
|
||||
ij_javascript_space_before_generator_mult = false
|
||||
ij_javascript_space_before_if_left_brace = true
|
||||
ij_javascript_space_before_if_parentheses = true
|
||||
ij_javascript_space_before_method_call_parentheses = false
|
||||
ij_javascript_space_before_method_left_brace = true
|
||||
ij_javascript_space_before_method_parentheses = false
|
||||
ij_javascript_space_before_property_colon = false
|
||||
ij_javascript_space_before_quest = true
|
||||
ij_javascript_space_before_switch_left_brace = true
|
||||
ij_javascript_space_before_switch_parentheses = true
|
||||
ij_javascript_space_before_try_left_brace = true
|
||||
ij_javascript_space_before_type_colon = false
|
||||
ij_javascript_space_before_unary_not = false
|
||||
ij_javascript_space_before_while_keyword = true
|
||||
ij_javascript_space_before_while_left_brace = true
|
||||
ij_javascript_space_before_while_parentheses = true
|
||||
ij_javascript_spaces_around_additive_operators = true
|
||||
ij_javascript_spaces_around_arrow_function_operator = true
|
||||
ij_javascript_spaces_around_assignment_operators = true
|
||||
ij_javascript_spaces_around_bitwise_operators = true
|
||||
ij_javascript_spaces_around_equality_operators = true
|
||||
ij_javascript_spaces_around_logical_operators = true
|
||||
ij_javascript_spaces_around_multiplicative_operators = true
|
||||
ij_javascript_spaces_around_relational_operators = true
|
||||
ij_javascript_spaces_around_shift_operators = true
|
||||
ij_javascript_spaces_around_unary_operator = false
|
||||
ij_javascript_spaces_within_array_initializer_brackets = false
|
||||
ij_javascript_spaces_within_brackets = false
|
||||
ij_javascript_spaces_within_catch_parentheses = false
|
||||
ij_javascript_spaces_within_for_parentheses = false
|
||||
ij_javascript_spaces_within_if_parentheses = false
|
||||
ij_javascript_spaces_within_imports = false
|
||||
ij_javascript_spaces_within_interpolation_expressions = false
|
||||
ij_javascript_spaces_within_method_call_parentheses = false
|
||||
ij_javascript_spaces_within_method_parentheses = false
|
||||
ij_javascript_spaces_within_object_literal_braces = false
|
||||
ij_javascript_spaces_within_object_type_braces = true
|
||||
ij_javascript_spaces_within_parentheses = false
|
||||
ij_javascript_spaces_within_switch_parentheses = false
|
||||
ij_javascript_spaces_within_type_assertion = false
|
||||
ij_javascript_spaces_within_union_types = true
|
||||
ij_javascript_spaces_within_while_parentheses = false
|
||||
ij_javascript_special_else_if_treatment = true
|
||||
ij_javascript_ternary_operation_signs_on_next_line = false
|
||||
ij_javascript_ternary_operation_wrap = off
|
||||
ij_javascript_union_types_wrap = on_every_item
|
||||
ij_javascript_use_chained_calls_group_indents = false
|
||||
ij_javascript_use_double_quotes = true
|
||||
ij_javascript_use_explicit_js_extension = auto
|
||||
ij_javascript_use_path_mapping = always
|
||||
ij_javascript_use_public_modifier = false
|
||||
ij_javascript_use_semicolon_after_statement = true
|
||||
ij_javascript_var_declaration_wrap = normal
|
||||
ij_javascript_while_brace_force = never
|
||||
ij_javascript_while_on_new_line = false
|
||||
ij_javascript_wrap_comments = false
|
||||
|
||||
[{*.har,*.jsb2,*.jsb3,*.json,.babelrc,.eslintrc,.stylelintrc,bowerrc,jest.config}]
|
||||
indent_size = 2
|
||||
ij_json_array_wrapping = split_into_lines
|
||||
ij_json_keep_blank_lines_in_code = 0
|
||||
ij_json_keep_indents_on_empty_lines = false
|
||||
ij_json_keep_line_breaks = true
|
||||
ij_json_keep_trailing_comma = false
|
||||
ij_json_object_wrapping = split_into_lines
|
||||
ij_json_property_alignment = do_not_align
|
||||
ij_json_space_after_colon = true
|
||||
ij_json_space_after_comma = true
|
||||
ij_json_space_before_colon = false
|
||||
ij_json_space_before_comma = false
|
||||
ij_json_spaces_within_braces = false
|
||||
ij_json_spaces_within_brackets = false
|
||||
ij_json_wrap_long_lines = false
|
||||
|
||||
[{*.htm,*.html,*.ng,*.sht,*.shtm,*.shtml}]
|
||||
ij_html_add_new_line_before_tags = body,div,p,form,h1,h2,h3
|
||||
ij_html_align_attributes = true
|
||||
ij_html_align_text = false
|
||||
ij_html_attribute_wrap = normal
|
||||
ij_html_block_comment_add_space = false
|
||||
ij_html_block_comment_at_first_column = true
|
||||
ij_html_do_not_align_children_of_min_lines = 0
|
||||
ij_html_do_not_break_if_inline_tags = title,h1,h2,h3,h4,h5,h6,p
|
||||
ij_html_do_not_indent_children_of_tags = html,body,thead,tbody,tfoot
|
||||
ij_html_enforce_quotes = false
|
||||
ij_html_inline_tags = a,abbr,acronym,b,basefont,bdo,big,br,cite,cite,code,dfn,em,font,i,img,input,kbd,label,q,s,samp,select,small,span,strike,strong,sub,sup,textarea,tt,u,var
|
||||
ij_html_keep_blank_lines = 2
|
||||
ij_html_keep_indents_on_empty_lines = false
|
||||
ij_html_keep_line_breaks = true
|
||||
ij_html_keep_line_breaks_in_text = true
|
||||
ij_html_keep_whitespaces = false
|
||||
ij_html_keep_whitespaces_inside = span,pre,textarea
|
||||
ij_html_line_comment_at_first_column = true
|
||||
ij_html_new_line_after_last_attribute = never
|
||||
ij_html_new_line_before_first_attribute = never
|
||||
ij_html_quote_style = double
|
||||
ij_html_remove_new_line_before_tags = br
|
||||
ij_html_space_after_tag_name = false
|
||||
ij_html_space_around_equality_in_attribute = false
|
||||
ij_html_space_inside_empty_tag = false
|
||||
ij_html_text_wrap = normal
|
||||
|
||||
[{*.http,*.rest}]
|
||||
indent_size = 0
|
||||
ij_continuation_indent_size = 4
|
||||
ij_http request_call_parameters_wrap = normal
|
||||
|
||||
[{*.markdown,*.md}]
|
||||
ij_markdown_force_one_space_after_blockquote_symbol = true
|
||||
ij_markdown_force_one_space_after_header_symbol = true
|
||||
ij_markdown_force_one_space_after_list_bullet = true
|
||||
ij_markdown_force_one_space_between_words = true
|
||||
ij_markdown_format_tables = true
|
||||
ij_markdown_insert_quote_arrows_on_wrap = true
|
||||
ij_markdown_keep_indents_on_empty_lines = false
|
||||
ij_markdown_keep_line_breaks_inside_text_blocks = true
|
||||
ij_markdown_max_lines_around_block_elements = 1
|
||||
ij_markdown_max_lines_around_header = 1
|
||||
ij_markdown_max_lines_between_paragraphs = 1
|
||||
ij_markdown_min_lines_around_block_elements = 1
|
||||
ij_markdown_min_lines_around_header = 1
|
||||
ij_markdown_min_lines_between_paragraphs = 1
|
||||
ij_markdown_wrap_text_if_long = true
|
||||
ij_markdown_wrap_text_inside_blockquotes = true
|
||||
|
||||
[{*.yaml,*.yml}]
|
||||
indent_size = 2
|
||||
ij_yaml_align_values_properties = do_not_align
|
||||
ij_yaml_autoinsert_sequence_marker = true
|
||||
ij_yaml_block_mapping_on_new_line = false
|
||||
ij_yaml_indent_sequence_value = true
|
||||
ij_yaml_keep_indents_on_empty_lines = false
|
||||
ij_yaml_keep_line_breaks = true
|
||||
ij_yaml_sequence_on_new_line = false
|
||||
ij_yaml_space_before_colon = false
|
||||
ij_yaml_spaces_within_braces = true
|
||||
ij_yaml_spaces_within_brackets = true
|
||||
@@ -9,19 +9,16 @@ namespace VAR.WebFormsCore.AspNetCore.Code;
|
||||
public class AspnetCoreWebContext : IWebContext
|
||||
{
|
||||
private readonly HttpContext _context;
|
||||
|
||||
public AspnetCoreWebContext(HttpContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
|
||||
public AspnetCoreWebContext(HttpContext context) { _context = context; }
|
||||
|
||||
public string RequestPath => _context.Request.Path;
|
||||
|
||||
public string RequestMethod => _context.Request.Method;
|
||||
|
||||
|
||||
private Dictionary<string, string?>? _requestHeader;
|
||||
|
||||
|
||||
public Dictionary<string, string?> RequestHeader
|
||||
{
|
||||
get
|
||||
@@ -54,7 +51,7 @@ public class AspnetCoreWebContext : IWebContext
|
||||
}
|
||||
|
||||
private Dictionary<string, string?>? _requestQuery;
|
||||
|
||||
|
||||
public Dictionary<string, string?> RequestQuery
|
||||
{
|
||||
get
|
||||
@@ -68,9 +65,9 @@ public class AspnetCoreWebContext : IWebContext
|
||||
return _requestQuery;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Dictionary<string, string?>? _requestForm;
|
||||
|
||||
|
||||
public Dictionary<string, string?> RequestForm
|
||||
{
|
||||
get
|
||||
@@ -82,69 +79,51 @@ public class AspnetCoreWebContext : IWebContext
|
||||
_requestForm = _context.Request.Form
|
||||
.ToDictionary(p => p.Key, p => p.Value[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
_requestForm = new Dictionary<string, string?>();
|
||||
}
|
||||
else { _requestForm = new Dictionary<string, string?>(); }
|
||||
}
|
||||
|
||||
return _requestForm;
|
||||
}
|
||||
}
|
||||
|
||||
public void ResponseWrite(string text)
|
||||
{
|
||||
_context.Response.WriteAsync(text).GetAwaiter().GetResult();
|
||||
}
|
||||
|
||||
public void ResponseWrite(string text) { _context.Response.WriteAsync(text).GetAwaiter().GetResult(); }
|
||||
|
||||
public void ResponseWriteBin(byte[] content)
|
||||
{
|
||||
_context.Response.Body.WriteAsync(content).GetAwaiter().GetResult();
|
||||
}
|
||||
|
||||
public void ResponseFlush()
|
||||
{
|
||||
_context.Response.Body.FlushAsync().GetAwaiter().GetResult();
|
||||
}
|
||||
public void ResponseFlush() { _context.Response.Body.FlushAsync().GetAwaiter().GetResult(); }
|
||||
|
||||
public void ResponseRedirect(string url)
|
||||
{
|
||||
_context.Response.Redirect(url);
|
||||
}
|
||||
public void ResponseRedirect(string url) { _context.Response.Redirect(url); }
|
||||
|
||||
public void AddResponseCookie(string cookieName, string value, DateTime? expiration = null)
|
||||
{
|
||||
_context.Response.Cookies.Append(
|
||||
key: cookieName,
|
||||
value: value,
|
||||
options: new CookieOptions {Expires = expiration,}
|
||||
options: new CookieOptions { Expires = expiration, }
|
||||
);
|
||||
}
|
||||
|
||||
public void DelResponseCookie(string cookieName)
|
||||
{
|
||||
_context.Response.Cookies.Delete(cookieName);
|
||||
}
|
||||
public void DelResponseCookie(string cookieName) { _context.Response.Cookies.Delete(cookieName); }
|
||||
|
||||
public bool ResponseHasStarted => _context.Response.HasStarted;
|
||||
|
||||
|
||||
public int ResponseStatusCode
|
||||
{
|
||||
get => _context.Response.StatusCode;
|
||||
set => _context.Response.StatusCode = value;
|
||||
}
|
||||
|
||||
|
||||
public string? ResponseContentType
|
||||
{
|
||||
get => _context.Response.ContentType;
|
||||
set => _context.Response.ContentType = value;
|
||||
}
|
||||
|
||||
public void SetResponseHeader(string key, string value)
|
||||
{
|
||||
_context.Response.Headers.SafeSet(key, value);
|
||||
}
|
||||
|
||||
public void SetResponseHeader(string key, string value) { _context.Response.Headers.SafeSet(key, value); }
|
||||
|
||||
public void PrepareCacheableResponse()
|
||||
{
|
||||
const int secondsInDay = 86400;
|
||||
@@ -161,5 +140,4 @@ public class AspnetCoreWebContext : IWebContext
|
||||
.ToString("ddd, dd MMM yyyy HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture);
|
||||
_context.Response.Headers.SafeSet("Expires", $"{expireDate} GMT");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,7 +11,7 @@ namespace VAR.WebFormsCore.AspNetCore.Code;
|
||||
public class GlobalRouterMiddleware
|
||||
{
|
||||
private readonly GlobalRouter _globalRouter = new();
|
||||
|
||||
|
||||
public GlobalRouterMiddleware(RequestDelegate next, IWebHostEnvironment env)
|
||||
{
|
||||
ServerHelpers.SetContentRoot(env.ContentRootPath);
|
||||
@@ -26,7 +26,7 @@ public class GlobalRouterMiddleware
|
||||
httpContext.Response.Headers.SafeSet("X-XSS-Protection", "1; mode=block");
|
||||
|
||||
IWebContext webContext = new AspnetCoreWebContext(httpContext);
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
_globalRouter.RouteRequest(webContext);
|
||||
@@ -46,7 +46,6 @@ public class GlobalRouterMiddleware
|
||||
}
|
||||
|
||||
private static bool IsIgnoreException(Exception ex) { return ex is ThreadAbortException; }
|
||||
|
||||
}
|
||||
|
||||
public static class GlobalRouterMiddlewareExtensions
|
||||
|
||||
@@ -5,15 +5,9 @@ namespace VAR.WebFormsCore.AspNetCore;
|
||||
|
||||
public static class DefaultMain
|
||||
{
|
||||
public static void WebFormCoreMain(string[] args)
|
||||
{
|
||||
CreateHostBuilder(args).Build().Run();
|
||||
}
|
||||
public static void WebFormCoreMain(string[] args) { CreateHostBuilder(args).Build().Run(); }
|
||||
|
||||
private static IHostBuilder CreateHostBuilder(string[] args) =>
|
||||
Host.CreateDefaultBuilder(args)
|
||||
.ConfigureWebHostDefaults(webBuilder =>
|
||||
{
|
||||
webBuilder.UseStartup<Startup>();
|
||||
});
|
||||
.ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); });
|
||||
}
|
||||
@@ -11,14 +11,8 @@ public class Startup
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
// If using Kestrel:
|
||||
services.Configure<KestrelServerOptions>(options =>
|
||||
{
|
||||
options.AddServerHeader = false;
|
||||
});
|
||||
services.Configure<KestrelServerOptions>(options => { options.AddServerHeader = false; });
|
||||
}
|
||||
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
app.UseGlobalRouterMiddleware(env);
|
||||
}
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { app.UseGlobalRouterMiddleware(env); }
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\VAR.WebFormsCore\VAR.WebFormsCore.csproj" />
|
||||
<ProjectReference Include="..\VAR.WebFormsCore\VAR.WebFormsCore.csproj"/>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -5,22 +5,19 @@ using VAR.WebFormsCore.Pages;
|
||||
|
||||
namespace VAR.WebFormsCore.TestWebApp;
|
||||
|
||||
public class FrmDefault: PageCommon
|
||||
public class FrmDefault : PageCommon
|
||||
{
|
||||
private readonly CTextBox _txtText = new() { ID = "txtText", CssClassExtra = "width150px", AllowEmpty = false };
|
||||
private readonly Button _btnTest = new() { ID = "btnTest", };
|
||||
private readonly Label _lblMessage = new() { ID = "lblMessage", };
|
||||
|
||||
|
||||
public FrmDefault()
|
||||
{
|
||||
MustBeAuthenticated = false;
|
||||
Init += FrmLogin_Init;
|
||||
}
|
||||
|
||||
private void FrmLogin_Init(object? sender, EventArgs e)
|
||||
{
|
||||
InitializeControls();
|
||||
}
|
||||
|
||||
private void FrmLogin_Init(object? sender, EventArgs e) { InitializeControls(); }
|
||||
|
||||
private void InitializeControls()
|
||||
{
|
||||
@@ -34,12 +31,9 @@ public class FrmDefault: PageCommon
|
||||
Controls.Add(FormUtils.CreateField(string.Empty, _btnTest));
|
||||
_btnTest.Text = MultiLang.GetLiteral("Test");
|
||||
_btnTest.Click += BtnTest_Click;
|
||||
|
||||
|
||||
Controls.Add(FormUtils.CreateField(string.Empty, _lblMessage));
|
||||
}
|
||||
|
||||
private void BtnTest_Click(object? sender, EventArgs e)
|
||||
{
|
||||
_lblMessage.Text = $"Hello World: {_txtText.Text}";
|
||||
}
|
||||
private void BtnTest_Click(object? sender, EventArgs e) { _lblMessage.Text = $"Hello World: {_txtText.Text}"; }
|
||||
}
|
||||
@@ -4,9 +4,5 @@ namespace VAR.WebFormsCore.TestWebApp;
|
||||
|
||||
public static class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
DefaultMain.WebFormCoreMain(args);
|
||||
}
|
||||
|
||||
public static void Main(string[] args) { DefaultMain.WebFormCoreMain(args); }
|
||||
}
|
||||
@@ -15,12 +15,7 @@ public class TestWebAppGlobalConfig : IGlobalConfig
|
||||
public List<string> AllowedExtensions { get; } = new()
|
||||
{ ".png", ".jpg", ".jpeg", ".gif", ".ico", ".wav", ".mp3", ".ogg", ".mp4", ".webm", ".webp", ".mkv", ".avi" };
|
||||
|
||||
public bool IsUserAuthenticated(IWebContext context)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public bool IsUserAuthenticated(IWebContext context) { return false; }
|
||||
|
||||
public void UserDeauthenticate(IWebContext context)
|
||||
{
|
||||
}
|
||||
public void UserDeauthenticate(IWebContext context) { }
|
||||
}
|
||||
@@ -6,8 +6,8 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\VAR.WebFormsCore.AspNetCore\VAR.WebFormsCore.AspNetCore.csproj" />
|
||||
<ProjectReference Include="..\VAR.WebFormsCore\VAR.WebFormsCore.csproj" />
|
||||
<ProjectReference Include="..\VAR.WebFormsCore.AspNetCore\VAR.WebFormsCore.AspNetCore.csproj"/>
|
||||
<ProjectReference Include="..\VAR.WebFormsCore\VAR.WebFormsCore.csproj"/>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace VAR.WebFormsCore.Tests.Code;
|
||||
public class ExtensionMethodsTests
|
||||
{
|
||||
#region GetRequestParameter
|
||||
|
||||
|
||||
[Fact]
|
||||
public void GetRequestParameter__EmptyGet__Empty()
|
||||
{
|
||||
@@ -15,11 +15,11 @@ public class ExtensionMethodsTests
|
||||
string key = "Key";
|
||||
|
||||
string result = fakeWebContext.GetRequestParameter(key);
|
||||
|
||||
|
||||
Assert.Equal(200, fakeWebContext.ResponseStatusCode);
|
||||
Assert.Equal(string.Empty, result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void GetRequestParameter__EmptyPost__Empty()
|
||||
{
|
||||
@@ -27,11 +27,11 @@ public class ExtensionMethodsTests
|
||||
string key = "Key";
|
||||
|
||||
string result = fakeWebContext.GetRequestParameter(key);
|
||||
|
||||
|
||||
Assert.Equal(200, fakeWebContext.ResponseStatusCode);
|
||||
Assert.Equal(string.Empty, result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void GetRequestParameter__QueryKeyGet__CorrectValue()
|
||||
{
|
||||
@@ -41,11 +41,11 @@ public class ExtensionMethodsTests
|
||||
fakeWebContext.RequestQuery.Add(key, value);
|
||||
|
||||
string result = fakeWebContext.GetRequestParameter(key);
|
||||
|
||||
|
||||
Assert.Equal(200, fakeWebContext.ResponseStatusCode);
|
||||
Assert.Equal(value, result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void GetRequestParameter__FormKeyPost__CorrectValue()
|
||||
{
|
||||
@@ -53,9 +53,9 @@ public class ExtensionMethodsTests
|
||||
string key = "Key";
|
||||
string value = "Value";
|
||||
fakeWebContext.RequestForm.Add(key, value);
|
||||
|
||||
|
||||
string result = fakeWebContext.GetRequestParameter(key);
|
||||
|
||||
|
||||
Assert.Equal(200, fakeWebContext.ResponseStatusCode);
|
||||
Assert.Equal(value, result);
|
||||
}
|
||||
@@ -70,11 +70,11 @@ public class ExtensionMethodsTests
|
||||
fakeWebContext.RequestQuery.Add(keyInvalid, value);
|
||||
|
||||
string result = fakeWebContext.GetRequestParameter(key);
|
||||
|
||||
|
||||
Assert.Equal(200, fakeWebContext.ResponseStatusCode);
|
||||
Assert.Equal(string.Empty, result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void GetRequestParameter__OtherFormKeyPost__Empty()
|
||||
{
|
||||
@@ -83,15 +83,15 @@ public class ExtensionMethodsTests
|
||||
string key = "Key";
|
||||
string value = "Value";
|
||||
fakeWebContext.RequestForm.Add(keyInvalid, value);
|
||||
|
||||
|
||||
string result = fakeWebContext.GetRequestParameter(key);
|
||||
|
||||
|
||||
Assert.Equal(200, fakeWebContext.ResponseStatusCode);
|
||||
Assert.Equal(string.Empty, result);
|
||||
}
|
||||
|
||||
#endregion GetRequestParameter
|
||||
|
||||
|
||||
#region ResponseObject
|
||||
|
||||
[Fact]
|
||||
@@ -105,6 +105,6 @@ public class ExtensionMethodsTests
|
||||
Assert.Single(fakeWebContext.FakeWritePackages);
|
||||
Assert.Equal("{ }", fakeWebContext.FakeWritePackages[0].ToString());
|
||||
}
|
||||
|
||||
|
||||
#endregion ResponseObject
|
||||
}
|
||||
@@ -13,15 +13,17 @@ public class ObjectActivatorTests
|
||||
Assert.IsType<object>(result);
|
||||
}
|
||||
|
||||
private class TestType { }
|
||||
|
||||
private class TestType
|
||||
{
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CreateInstance__TestType__TestType()
|
||||
{
|
||||
object result = ObjectActivator.CreateInstance(typeof(TestType));
|
||||
|
||||
Assert.IsType<TestType>(result);
|
||||
|
||||
|
||||
object result2 = ObjectActivator.CreateInstance(typeof(TestType));
|
||||
|
||||
Assert.IsType<TestType>(result2);
|
||||
|
||||
@@ -11,12 +11,12 @@ public class ScriptsBundlerTests
|
||||
{
|
||||
FakeWebContext fakeWebContext = new();
|
||||
ScriptsBundler scriptsBundler = new();
|
||||
|
||||
|
||||
scriptsBundler.ProcessRequest(fakeWebContext);
|
||||
|
||||
|
||||
Assert.Equal(200, fakeWebContext.ResponseStatusCode);
|
||||
Assert.Single(fakeWebContext.FakeWritePackages);
|
||||
|
||||
|
||||
// TODO: Verify contents of intrinsic scripts
|
||||
}
|
||||
}
|
||||
@@ -6,97 +6,97 @@ namespace VAR.WebFormsCore.Tests.Code;
|
||||
public class ServerHelperTests
|
||||
{
|
||||
#region MapContentPath
|
||||
|
||||
|
||||
[Fact]
|
||||
public void MapContentPath__Empty__Slash()
|
||||
{
|
||||
ServerHelpers.SetContentRoot(string.Empty);
|
||||
string result = ServerHelpers.MapContentPath(string.Empty);
|
||||
|
||||
|
||||
Assert.Equal("/", result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void MapContentPath__File__SlashFile()
|
||||
{
|
||||
ServerHelpers.SetContentRoot(string.Empty);
|
||||
string result = ServerHelpers.MapContentPath("file.ext");
|
||||
|
||||
|
||||
Assert.Equal("/file.ext", result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void MapContentPath__FileWithRoot__AbsolutePathToFile()
|
||||
{
|
||||
ServerHelpers.SetContentRoot("/opt/App");
|
||||
string result = ServerHelpers.MapContentPath("file.ext");
|
||||
|
||||
|
||||
Assert.Equal("/opt/App/file.ext", result);
|
||||
}
|
||||
|
||||
|
||||
#endregion MapContentPath
|
||||
|
||||
|
||||
#region HtmlEncode
|
||||
|
||||
|
||||
[Fact]
|
||||
public void HtmlEncode__Empty__Empty()
|
||||
{
|
||||
string result = ServerHelpers.HtmlEncode(string.Empty);
|
||||
|
||||
|
||||
Assert.Equal(string.Empty, result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void HtmlEncode__SafeString__SameString()
|
||||
{
|
||||
string text = "aA0, ()!?=\\-_*+";
|
||||
|
||||
|
||||
string result = ServerHelpers.HtmlEncode(text);
|
||||
|
||||
|
||||
Assert.Equal(text, result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void HtmlEncode__UnsafeString__SafeString()
|
||||
{
|
||||
string text = "<<>>\"'&\u00FF";
|
||||
string safeText = "<<>>"'&ÿ";
|
||||
|
||||
|
||||
string result = ServerHelpers.HtmlEncode(text);
|
||||
|
||||
|
||||
Assert.Equal(safeText, result);
|
||||
}
|
||||
|
||||
#endregion HtmlEncode
|
||||
|
||||
|
||||
#region UrlEncode
|
||||
|
||||
|
||||
[Fact]
|
||||
public void UrlEncode__Empty__Empty()
|
||||
{
|
||||
string result = ServerHelpers.UrlEncode(string.Empty);
|
||||
|
||||
|
||||
Assert.Equal(string.Empty, result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void UrlEncode__SafeString__SameString()
|
||||
{
|
||||
string text = "aA0()!-_*";
|
||||
|
||||
|
||||
string result = ServerHelpers.UrlEncode(text);
|
||||
|
||||
|
||||
Assert.Equal(text, result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void UrlEncode__UnsafeString__SafeString()
|
||||
{
|
||||
string text = "<< >>\"' + &\u00FF";
|
||||
string safeText = "%3C%3C+%3E%3E%22%27+%2B+%26%FF";
|
||||
|
||||
|
||||
string result = ServerHelpers.UrlEncode(text);
|
||||
|
||||
|
||||
Assert.Equal(safeText, result);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,12 +11,12 @@ public class StylesBundlerTests
|
||||
{
|
||||
FakeWebContext fakeWebContext = new();
|
||||
StylesBundler stylesBundler = new();
|
||||
|
||||
|
||||
stylesBundler.ProcessRequest(fakeWebContext);
|
||||
|
||||
|
||||
Assert.Equal(200, fakeWebContext.ResponseStatusCode);
|
||||
Assert.Single(fakeWebContext.FakeWritePackages);
|
||||
|
||||
|
||||
// TODO: Verify contents of intrinsic styles
|
||||
}
|
||||
}
|
||||
@@ -11,47 +11,47 @@ public class UnitTests
|
||||
Unit unit = new(100, UnitType.Pixel);
|
||||
|
||||
string result = unit.ToString();
|
||||
|
||||
|
||||
Assert.Equal("100px", result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void ToString__50px__50px()
|
||||
{
|
||||
Unit unit = new(100, UnitType.Pixel);
|
||||
|
||||
string result = unit.ToString();
|
||||
|
||||
|
||||
Assert.Equal("100px", result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void ToString__100pc__100pc()
|
||||
{
|
||||
Unit unit = new(100, UnitType.Percentage);
|
||||
|
||||
string result = unit.ToString();
|
||||
|
||||
|
||||
Assert.Equal("100%", result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void ToString__50pc__50pc()
|
||||
{
|
||||
Unit unit = new(100, UnitType.Percentage);
|
||||
|
||||
string result = unit.ToString();
|
||||
|
||||
|
||||
Assert.Equal("100%", result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void ToString__100UnknownUnits__Empty()
|
||||
{
|
||||
Unit unit = new(100, (UnitType)1000);
|
||||
|
||||
string result = unit.ToString();
|
||||
|
||||
|
||||
Assert.Equal(string.Empty, result);
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ public class ButtonTests
|
||||
string result = fakeWebContext.FakeWritePackages.ToString("");
|
||||
Assert.Equal(@"<input type=""submit"" class=""button"" value=""""></input>", result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void MustRenderCorrectly__WithOnClientClick()
|
||||
{
|
||||
@@ -41,7 +41,7 @@ public class ButtonTests
|
||||
string result = fakeWebContext.FakeWritePackages.ToString("");
|
||||
Assert.Equal(@"<input type=""submit"" class=""button"" value="""" onclick=""alert(1)""></input>", result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void MustRenderCorrectly__ClickWithCommandArgument()
|
||||
{
|
||||
@@ -53,10 +53,7 @@ public class ButtonTests
|
||||
CommandArgument = commandArgument,
|
||||
};
|
||||
string? result = null;
|
||||
button.Click += (o, _) =>
|
||||
{
|
||||
result = (o as Button)?.CommandArgument;
|
||||
};
|
||||
button.Click += (o, _) => { result = (o as Button)?.CommandArgument; };
|
||||
page.Controls.Add(button);
|
||||
|
||||
fakeWebContext.RequestForm.Add(button.ClientID, "Clicked");
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace VAR.WebFormsCore.Tests.Controls;
|
||||
public class CTextBoxTests
|
||||
{
|
||||
#region MustRenderCorrectly
|
||||
|
||||
|
||||
[Fact]
|
||||
public void MustRenderCorrectly()
|
||||
{
|
||||
@@ -36,11 +36,11 @@ public class CTextBoxTests
|
||||
Page page = new();
|
||||
CTextBox cTextBox = new()
|
||||
{
|
||||
CssClassExtra = "extraClass",
|
||||
PlaceHolder = "Placeholder",
|
||||
CssClassExtra = "extraClass",
|
||||
PlaceHolder = "Placeholder",
|
||||
MarkedInvalid = true,
|
||||
TextMode = TextBoxMode.Normal,
|
||||
AllowEmpty = true,
|
||||
TextMode = TextBoxMode.Normal,
|
||||
AllowEmpty = true,
|
||||
KeepSize = true,
|
||||
Text = "Test",
|
||||
};
|
||||
@@ -57,7 +57,7 @@ public class CTextBoxTests
|
||||
""",
|
||||
actual: result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void MustRenderCorrectly__WithNextFocusOnEnter()
|
||||
{
|
||||
@@ -80,19 +80,19 @@ public class CTextBoxTests
|
||||
""",
|
||||
actual: result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void MustRenderCorrectly__WithChangedText()
|
||||
{
|
||||
string text = "Test";
|
||||
string changedValue = "Changed";
|
||||
|
||||
|
||||
FakeWebContext fakeWebContext0 = new();
|
||||
Page page0 = new();
|
||||
CTextBox cTextBox0 = new() { Text = text };
|
||||
page0.Controls.Add(cTextBox0);
|
||||
page0.ProcessRequest(fakeWebContext0);
|
||||
|
||||
|
||||
FakeWebContext fakeWebContext1 = new(requestMethod: "POST");
|
||||
fakeWebContext1.RequestForm.Add(cTextBox0.TxtContent.ClientID, changedValue);
|
||||
Page page1 = new();
|
||||
@@ -110,7 +110,7 @@ public class CTextBoxTests
|
||||
""",
|
||||
actual: result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void MustRenderCorrectly_Multiline()
|
||||
{
|
||||
@@ -118,7 +118,7 @@ public class CTextBoxTests
|
||||
Page page = new();
|
||||
CTextBox cTextBox = new()
|
||||
{
|
||||
TextMode = TextBoxMode.MultiLine,
|
||||
TextMode = TextBoxMode.MultiLine,
|
||||
KeepSize = true,
|
||||
};
|
||||
page.Controls.Add(cTextBox);
|
||||
@@ -146,7 +146,7 @@ public class CTextBoxTests
|
||||
Page page = new();
|
||||
CTextBox cTextBox = new()
|
||||
{
|
||||
TextMode = TextBoxMode.MultiLine,
|
||||
TextMode = TextBoxMode.MultiLine,
|
||||
KeepSize = true,
|
||||
};
|
||||
page.Controls.Add(cTextBox);
|
||||
@@ -168,7 +168,7 @@ public class CTextBoxTests
|
||||
""",
|
||||
actual: result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void MustRenderCorrectly_Multiline__GetAndSetClientsideHeight__100()
|
||||
{
|
||||
@@ -176,7 +176,7 @@ public class CTextBoxTests
|
||||
Page page = new();
|
||||
CTextBox cTextBox = new()
|
||||
{
|
||||
TextMode = TextBoxMode.MultiLine,
|
||||
TextMode = TextBoxMode.MultiLine,
|
||||
KeepSize = true,
|
||||
};
|
||||
page.Controls.Add(cTextBox);
|
||||
@@ -214,15 +214,12 @@ public class CTextBoxTests
|
||||
Page page = new();
|
||||
CTextBox cTextBox = new()
|
||||
{
|
||||
TextMode = TextBoxMode.MultiLine,
|
||||
TextMode = TextBoxMode.MultiLine,
|
||||
KeepSize = true,
|
||||
};
|
||||
page.Controls.Add(cTextBox);
|
||||
Button button = new();
|
||||
button.Click += (_, _) =>
|
||||
{
|
||||
cTextBox.SetClientsideHeight(null);
|
||||
};
|
||||
button.Click += (_, _) => { cTextBox.SetClientsideHeight(null); };
|
||||
page.Controls.Add(button);
|
||||
|
||||
fakeWebContext.RequestForm.Add(button.ClientID, "Clicked");
|
||||
@@ -243,7 +240,7 @@ public class CTextBoxTests
|
||||
""",
|
||||
actual: result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void MustRenderCorrectly_Multiline__GetClientsideHeightInjectArray__Null()
|
||||
{
|
||||
@@ -251,17 +248,14 @@ public class CTextBoxTests
|
||||
Page page = new();
|
||||
CTextBox cTextBox = new()
|
||||
{
|
||||
TextMode = TextBoxMode.MultiLine,
|
||||
TextMode = TextBoxMode.MultiLine,
|
||||
KeepSize = true,
|
||||
};
|
||||
page.Controls.Add(cTextBox);
|
||||
Button button = new();
|
||||
button.Click += (_, _) =>
|
||||
{
|
||||
if (cTextBox.HidSize != null)
|
||||
{
|
||||
cTextBox.HidSize.Value = "[]";
|
||||
}
|
||||
if (cTextBox.HidSize != null) { cTextBox.HidSize.Value = "[]"; }
|
||||
};
|
||||
page.Controls.Add(button);
|
||||
|
||||
@@ -273,7 +267,7 @@ public class CTextBoxTests
|
||||
Assert.Equal(200, fakeWebContext.ResponseStatusCode);
|
||||
Assert.Equal("text/html", fakeWebContext.ResponseContentType);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void MustRenderCorrectly_Multiline__GetClientsideHeightInjectObject__Null()
|
||||
{
|
||||
@@ -281,17 +275,14 @@ public class CTextBoxTests
|
||||
Page page = new();
|
||||
CTextBox cTextBox = new()
|
||||
{
|
||||
TextMode = TextBoxMode.MultiLine,
|
||||
TextMode = TextBoxMode.MultiLine,
|
||||
KeepSize = true,
|
||||
};
|
||||
page.Controls.Add(cTextBox);
|
||||
Button button = new();
|
||||
button.Click += (_, _) =>
|
||||
{
|
||||
if (cTextBox.HidSize != null)
|
||||
{
|
||||
cTextBox.HidSize.Value = "{}";
|
||||
}
|
||||
if (cTextBox.HidSize != null) { cTextBox.HidSize.Value = "{}"; }
|
||||
};
|
||||
page.Controls.Add(button);
|
||||
|
||||
@@ -314,17 +305,17 @@ public class CTextBoxTests
|
||||
CTextBox cTextBox = new() { Text = string.Empty, };
|
||||
|
||||
bool result = cTextBox.IsEmpty();
|
||||
|
||||
|
||||
Assert.True(result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void IsEmpty__Text__False()
|
||||
{
|
||||
CTextBox cTextBox = new() { Text = "Text", };
|
||||
|
||||
bool result = cTextBox.IsEmpty();
|
||||
|
||||
|
||||
Assert.False(result);
|
||||
}
|
||||
|
||||
@@ -338,17 +329,17 @@ public class CTextBoxTests
|
||||
CTextBox cTextBox = new() { Text = string.Empty, AllowEmpty = false, };
|
||||
|
||||
bool result = cTextBox.IsValid();
|
||||
|
||||
|
||||
Assert.False(result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void IsEmpty__TextAllowEmptyFalse__True()
|
||||
{
|
||||
CTextBox cTextBox = new() { Text = "Text", AllowEmpty = false, };
|
||||
|
||||
bool result = cTextBox.IsValid();
|
||||
|
||||
|
||||
Assert.True(result);
|
||||
}
|
||||
|
||||
@@ -358,20 +349,19 @@ public class CTextBoxTests
|
||||
CTextBox cTextBox = new() { Text = string.Empty, AllowEmpty = true, };
|
||||
|
||||
bool result = cTextBox.IsValid();
|
||||
|
||||
|
||||
Assert.True(result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void IsEmpty__TextAllowEmptyTrue__True()
|
||||
{
|
||||
CTextBox cTextBox = new() { Text = "Text", AllowEmpty = true, };
|
||||
|
||||
bool result = cTextBox.IsValid();
|
||||
|
||||
|
||||
Assert.True(result);
|
||||
}
|
||||
|
||||
#endregion IsEmpty
|
||||
|
||||
}
|
||||
@@ -22,7 +22,7 @@ public class HiddenFieldTests
|
||||
string result = fakeWebContext.FakeWritePackages.ToString("");
|
||||
Assert.Equal(@"<input type=""hidden"" id=""ctl00"" name=""ctl00""></input>", result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void MustRenderCorrectly__WithValue()
|
||||
{
|
||||
@@ -40,7 +40,7 @@ public class HiddenFieldTests
|
||||
string result = fakeWebContext.FakeWritePackages.ToString("");
|
||||
Assert.Equal(@"<input type=""hidden"" id=""ctl00"" name=""ctl00"" value=""Test""></input>", result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void MustRenderCorrectly__WithChangedValue()
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@ public class HtmlFormTests
|
||||
string result = fakeWebContext.FakeWritePackages.ToString("");
|
||||
Assert.Equal(@"<form method=""post"" action=""Page""></form>", result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void MustRenderCorrectly__WithQueryParameters()
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@ public class HtmlHeadTests
|
||||
string result = fakeWebContext.FakeWritePackages.ToString("");
|
||||
Assert.Equal("<head ></head>", result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void MustRenderCorrectly__WithTitle()
|
||||
{
|
||||
@@ -39,7 +39,7 @@ public class HtmlHeadTests
|
||||
string result = fakeWebContext.FakeWritePackages.ToString("");
|
||||
Assert.Equal("<head ><title>Test</title></head>", result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void MustRenderCorrectly__WithMeta()
|
||||
{
|
||||
@@ -54,7 +54,7 @@ public class HtmlHeadTests
|
||||
HttpEquiv = "TestMetaHttpEquiv"
|
||||
};
|
||||
htmlHead.Controls.Add(htmlMeta);
|
||||
|
||||
|
||||
page.ProcessRequest(fakeWebContext);
|
||||
|
||||
Assert.Equal(200, fakeWebContext.ResponseStatusCode);
|
||||
|
||||
@@ -22,7 +22,7 @@ public class HyperLinkTests
|
||||
string result = fakeWebContext.FakeWritePackages.ToString("");
|
||||
Assert.Equal("<a ></a>", result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void MustRenderCorrectly__WithTextAndUrl()
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@ public class LiteralControlTests
|
||||
string result = fakeWebContext.FakeWritePackages.ToString("");
|
||||
Assert.Equal(@"", result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void MustRenderCorrectly__AnyContent()
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@ public class TextBoxTests
|
||||
""",
|
||||
actual: result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void MustRenderCorrectly__NormalWithText()
|
||||
{
|
||||
@@ -46,13 +46,13 @@ public class TextBoxTests
|
||||
""",
|
||||
actual: result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void MustRenderCorrectly__Password()
|
||||
{
|
||||
FakeWebContext fakeWebContext = new();
|
||||
Page page = new();
|
||||
TextBox textBox = new() {TextMode = TextBoxMode.Password, };
|
||||
TextBox textBox = new() { TextMode = TextBoxMode.Password, };
|
||||
page.Controls.Add(textBox);
|
||||
|
||||
page.ProcessRequest(fakeWebContext);
|
||||
@@ -66,7 +66,7 @@ public class TextBoxTests
|
||||
""",
|
||||
actual: result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void MustRenderCorrectly__PasswordWithText()
|
||||
{
|
||||
@@ -86,13 +86,13 @@ public class TextBoxTests
|
||||
""",
|
||||
actual: result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void MustRenderCorrectly__MultiLine()
|
||||
{
|
||||
FakeWebContext fakeWebContext = new();
|
||||
Page page = new();
|
||||
TextBox textBox = new() {TextMode = TextBoxMode.MultiLine, };
|
||||
TextBox textBox = new() { TextMode = TextBoxMode.MultiLine, };
|
||||
page.Controls.Add(textBox);
|
||||
|
||||
page.ProcessRequest(fakeWebContext);
|
||||
@@ -106,7 +106,7 @@ public class TextBoxTests
|
||||
""",
|
||||
actual: result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void MustRenderCorrectly__MultiLineWithText()
|
||||
{
|
||||
@@ -127,7 +127,7 @@ public class TextBoxTests
|
||||
""",
|
||||
actual: result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void MustRenderCorrectly__WithChangedText()
|
||||
{
|
||||
|
||||
@@ -16,10 +16,7 @@ public class FakeGlobalConfig : IGlobalConfig
|
||||
|
||||
private string _loginHandler = string.Empty;
|
||||
|
||||
public void FakeSetLoginHandler(string loginHandler)
|
||||
{
|
||||
_loginHandler = loginHandler;
|
||||
}
|
||||
public void FakeSetLoginHandler(string loginHandler) { _loginHandler = loginHandler; }
|
||||
|
||||
public string LoginHandler => _loginHandler;
|
||||
|
||||
@@ -27,18 +24,9 @@ public class FakeGlobalConfig : IGlobalConfig
|
||||
|
||||
private bool _authenticated;
|
||||
|
||||
public void FakeSetAuthenticated(bool authenticated)
|
||||
{
|
||||
_authenticated = authenticated;
|
||||
}
|
||||
|
||||
public bool IsUserAuthenticated(IWebContext context)
|
||||
{
|
||||
return _authenticated;
|
||||
}
|
||||
public void FakeSetAuthenticated(bool authenticated) { _authenticated = authenticated; }
|
||||
|
||||
public void UserDeauthenticate(IWebContext context)
|
||||
{
|
||||
_authenticated = false;
|
||||
}
|
||||
public bool IsUserAuthenticated(IWebContext context) { return _authenticated; }
|
||||
|
||||
public void UserDeauthenticate(IWebContext context) { _authenticated = false; }
|
||||
}
|
||||
@@ -5,34 +5,25 @@ namespace VAR.WebFormsCore.Tests.Fakes;
|
||||
|
||||
public class FakeWebContext : IWebContext
|
||||
{
|
||||
public FakeWebContext(string requestMethod = "GET")
|
||||
{
|
||||
RequestMethod = requestMethod;
|
||||
}
|
||||
|
||||
public FakeWebContext(string requestMethod = "GET") { RequestMethod = requestMethod; }
|
||||
|
||||
public string RequestPath => string.Empty;
|
||||
|
||||
public string RequestMethod { get; }
|
||||
|
||||
public Dictionary<string, string?> RequestHeader { get; } = new();
|
||||
|
||||
|
||||
public Dictionary<string, string> RequestCookies { get; } = new();
|
||||
|
||||
|
||||
public Dictionary<string, string?> RequestQuery { get; } = new();
|
||||
|
||||
|
||||
public Dictionary<string, string?> RequestForm { get; } = new();
|
||||
|
||||
|
||||
public List<WritePackage> FakeWritePackages { get; } = new();
|
||||
|
||||
public void ResponseWrite(string text)
|
||||
{
|
||||
FakeWritePackages.Add(new WritePackage { Text = text, });
|
||||
}
|
||||
public void ResponseWrite(string text) { FakeWritePackages.Add(new WritePackage { Text = text, }); }
|
||||
|
||||
public void ResponseWriteBin(byte[] content)
|
||||
{
|
||||
FakeWritePackages.Add(new WritePackage { Bin = content, });
|
||||
}
|
||||
public void ResponseWriteBin(byte[] content) { FakeWritePackages.Add(new WritePackage { Bin = content, }); }
|
||||
|
||||
public void ResponseFlush()
|
||||
{
|
||||
@@ -50,30 +41,21 @@ public class FakeWebContext : IWebContext
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void DelResponseCookie(string cookieName)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public void DelResponseCookie(string cookieName) { throw new NotImplementedException(); }
|
||||
|
||||
private bool _responseHasStarted;
|
||||
|
||||
public void FakeSetResponseHasStarted(bool responseHasStarted)
|
||||
{
|
||||
_responseHasStarted = responseHasStarted;
|
||||
}
|
||||
|
||||
public void FakeSetResponseHasStarted(bool responseHasStarted) { _responseHasStarted = responseHasStarted; }
|
||||
|
||||
public bool ResponseHasStarted => _responseHasStarted;
|
||||
|
||||
public int ResponseStatusCode { get; set; } = 200;
|
||||
|
||||
|
||||
public string? ResponseContentType { get; set; }
|
||||
|
||||
public Dictionary<string, string> FakeResponseHeaders { get; } = new();
|
||||
|
||||
public void SetResponseHeader(string key, string value)
|
||||
{
|
||||
FakeResponseHeaders.Add(key, value);
|
||||
}
|
||||
public void SetResponseHeader(string key, string value) { FakeResponseHeaders.Add(key, value); }
|
||||
|
||||
public void PrepareCacheableResponse()
|
||||
{
|
||||
@@ -93,15 +75,9 @@ public struct WritePackage
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
if (Text != null)
|
||||
{
|
||||
return Text;
|
||||
}
|
||||
if (Text != null) { return Text; }
|
||||
|
||||
if (Bin == null)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
if (Bin == null) { return string.Empty; }
|
||||
|
||||
string text = Encoding.UTF8.GetString(Bin ?? Array.Empty<byte>());
|
||||
return text;
|
||||
@@ -116,4 +92,4 @@ public static class WritePackageExtensions
|
||||
string result = string.Join(separator, listStrings);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,13 +11,13 @@ public class FrmEchoTests
|
||||
{
|
||||
FakeWebContext fakeWebContext = new();
|
||||
FrmEcho frmEcho = new();
|
||||
|
||||
|
||||
frmEcho.ProcessRequest(fakeWebContext);
|
||||
|
||||
Assert.Equal(200, fakeWebContext.ResponseStatusCode);
|
||||
string result = fakeWebContext.FakeWritePackages.ToString("");
|
||||
Assert.Equal(
|
||||
expected: """
|
||||
expected: """
|
||||
<pre><code>
|
||||
Header:{ }
|
||||
Query:{ }
|
||||
@@ -26,20 +26,20 @@ public class FrmEchoTests
|
||||
""",
|
||||
actual: result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void ProcessRequest__OneQueryParameterGet__FormData()
|
||||
{
|
||||
FakeWebContext fakeWebContext = new();
|
||||
fakeWebContext.RequestQuery.Add("Test", "Value");
|
||||
FrmEcho frmEcho = new();
|
||||
|
||||
|
||||
frmEcho.ProcessRequest(fakeWebContext);
|
||||
|
||||
Assert.Equal(200, fakeWebContext.ResponseStatusCode);
|
||||
string result = fakeWebContext.FakeWritePackages.ToString("");
|
||||
Assert.Equal(
|
||||
expected: """
|
||||
expected: """
|
||||
<pre><code>
|
||||
Header:{ }
|
||||
Query:{ "Test": "Value" }
|
||||
@@ -48,20 +48,20 @@ public class FrmEchoTests
|
||||
""",
|
||||
actual: result);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void ProcessRequest__OneFormParameterPost__FormData()
|
||||
{
|
||||
FakeWebContext fakeWebContext = new(requestMethod: "POST");
|
||||
fakeWebContext.RequestForm.Add("Test", "Value");
|
||||
FrmEcho frmEcho = new();
|
||||
|
||||
|
||||
frmEcho.ProcessRequest(fakeWebContext);
|
||||
|
||||
Assert.Equal(200, fakeWebContext.ResponseStatusCode);
|
||||
string result = fakeWebContext.FakeWritePackages.ToString("");
|
||||
Assert.Equal(
|
||||
expected: """
|
||||
expected: """
|
||||
<pre><code>
|
||||
Header:{ }
|
||||
Query:{ }
|
||||
|
||||
@@ -11,13 +11,13 @@ public class FrmErrorTests
|
||||
{
|
||||
FakeWebContext fakeWebContext = new();
|
||||
FrmError frmError = new(new Exception("Test"));
|
||||
|
||||
|
||||
frmError.ProcessRequest(fakeWebContext);
|
||||
|
||||
Assert.Equal(200, fakeWebContext.ResponseStatusCode);
|
||||
string result = fakeWebContext.FakeWritePackages.ToString("");
|
||||
Assert.Equal(
|
||||
expected: """
|
||||
expected: """
|
||||
<!DOCTYPE html>
|
||||
<html ><head ><title>Application Error</title><meta content="IE=Edge" http-equiv="X-UA-Compatible" /><meta content="text/html; charset=utf-8" http-equiv="content-type" /><meta name="author" /><meta name="Copyright" /><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=4, user-scalable=1" /><script type="text/javascript" src="ScriptsBundler?v=1.0.0.0"></script>
|
||||
<link href="StylesBundler?v=1.0.0.0" type="text/css" rel="stylesheet"/>
|
||||
@@ -25,5 +25,4 @@ public class FrmErrorTests
|
||||
""",
|
||||
actual: result);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,10 +11,7 @@ public class PageCommonTests
|
||||
|
||||
private class TestEmptyForm : PageCommon
|
||||
{
|
||||
public TestEmptyForm(bool mustBeAuthenticated)
|
||||
{
|
||||
MustBeAuthenticated = mustBeAuthenticated;
|
||||
}
|
||||
public TestEmptyForm(bool mustBeAuthenticated) { MustBeAuthenticated = mustBeAuthenticated; }
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -75,10 +75,7 @@ public class PageTests
|
||||
Page page = new();
|
||||
page.Load += (_, _) =>
|
||||
{
|
||||
if (page.IsPostBack)
|
||||
{
|
||||
fakeWebContext.FakeSetResponseHasStarted(true);
|
||||
}
|
||||
if (page.IsPostBack) { fakeWebContext.FakeSetResponseHasStarted(true); }
|
||||
};
|
||||
|
||||
page.ProcessRequest(fakeWebContext);
|
||||
@@ -96,10 +93,7 @@ public class PageTests
|
||||
Page page = new();
|
||||
page.Load += (_, _) =>
|
||||
{
|
||||
if (page.IsPostBack)
|
||||
{
|
||||
fakeWebContext.FakeSetResponseHasStarted(true);
|
||||
}
|
||||
if (page.IsPostBack) { fakeWebContext.FakeSetResponseHasStarted(true); }
|
||||
};
|
||||
|
||||
page.ProcessRequest(fakeWebContext);
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
|
||||
<PackageReference Include="xunit" Version="2.4.2" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2"/>
|
||||
<PackageReference Include="xunit" Version="2.4.2"/>
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
@@ -22,7 +22,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\VAR.WebFormsCore\VAR.WebFormsCore.csproj" />
|
||||
<ProjectReference Include="..\VAR.WebFormsCore\VAR.WebFormsCore.csproj"/>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -3,6 +3,18 @@
|
||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=SuggestVarOrType_005FDeconstructionDeclarations/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=SuggestVarOrType_005FElsewhere/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=SuggestVarOrType_005FSimpleTypes/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_EXISTING_ENUM_ARRANGEMENT/@EntryValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_EXISTING_EXPR_MEMBER_ARRANGEMENT/@EntryValue">False</s:Boolean>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_ACCESSOR_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_ACCESSORHOLDER_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_FIELD_ATTRIBUTE_ON_SAME_LINE_EX/@EntryValue">NEVER</s:String>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_SIMPLE_EMBEDDED_BLOCK_ON_SAME_LINE/@EntryValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_SIMPLE_ENUM_ON_SINGLE_LINE/@EntryValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_SIMPLE_METHOD_ON_SINGLE_LINE/@EntryValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_AFTER_DECLARATION_LPAR/@EntryValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_BEFORE_DECLARATION_RPAR/@EntryValue">True</s:Boolean>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_ENUM_DECLARATION/@EntryValue">CHOP_IF_LONG</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_PARAMETERS_STYLE/@EntryValue">CHOP_IF_LONG</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ID/@EntryIndexedValue">ID</s:String>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=abiword/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Childs/@EntryIndexedValue">True</s:Boolean>
|
||||
|
||||
@@ -55,7 +55,7 @@ public class Bundler
|
||||
_absoluteFiles = new List<string>();
|
||||
return _absoluteFiles;
|
||||
}
|
||||
|
||||
|
||||
DirectoryInfo dir = new DirectoryInfo(_absolutePath);
|
||||
FileInfo[] files = dir.GetFiles();
|
||||
_absoluteFiles = files.OrderBy(file => file.FullName).Select(file2 => file2.FullName).ToList();
|
||||
|
||||
@@ -21,7 +21,7 @@ public static class GlobalConfig
|
||||
x is { IsAbstract: false, IsInterface: false, IsPublic: true } &&
|
||||
iGlobalConfig.IsAssignableFrom(x)
|
||||
);
|
||||
if(foundGlobalConfig != null)
|
||||
if (foundGlobalConfig != null)
|
||||
{
|
||||
_globalConfig = ObjectActivator.CreateInstance(foundGlobalConfig) as IGlobalConfig;
|
||||
}
|
||||
@@ -39,14 +39,9 @@ public static class GlobalConfig
|
||||
public string DefaultHandler => string.Empty;
|
||||
public string LoginHandler => string.Empty;
|
||||
public List<string> AllowedExtensions { get; } = new();
|
||||
|
||||
public bool IsUserAuthenticated(IWebContext context)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public void UserDeauthenticate(IWebContext context)
|
||||
{
|
||||
}
|
||||
public bool IsUserAuthenticated(IWebContext context) { return false; }
|
||||
|
||||
public void UserDeauthenticate(IWebContext context) { }
|
||||
}
|
||||
}
|
||||
@@ -96,10 +96,7 @@ public class GlobalRouter
|
||||
{
|
||||
lock (Handlers)
|
||||
{
|
||||
if (Handlers.ContainsKey(typeName) == false)
|
||||
{
|
||||
Handlers.Add(typeName, type);
|
||||
}
|
||||
if (Handlers.ContainsKey(typeName) == false) { Handlers.Add(typeName, type); }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ public interface IWebContext
|
||||
int ResponseStatusCode { get; set; }
|
||||
string? ResponseContentType { get; set; }
|
||||
void SetResponseHeader(string key, string value);
|
||||
|
||||
|
||||
void PrepareCacheableResponse();
|
||||
void PrepareUncacheableResponse();
|
||||
}
|
||||
@@ -29,7 +29,7 @@ public static class MultiLang
|
||||
_literals = new Dictionary<string, Dictionary<string, object>?>();
|
||||
|
||||
JsonParser jsonParser = new JsonParser();
|
||||
foreach (string lang in new[] {"en", "es"})
|
||||
foreach (string lang in new[] { "en", "es" })
|
||||
{
|
||||
string filePath = GetPrivatePath("Resources", $"Literals.{lang}.json");
|
||||
if (File.Exists(filePath) == false) { continue; }
|
||||
@@ -85,10 +85,7 @@ public static class MultiLang
|
||||
|
||||
Dictionary<string, object>? literalCurrentCulture = _literals[culture];
|
||||
|
||||
if (literalCurrentCulture == null || literalCurrentCulture.ContainsKey(resource) == false)
|
||||
{
|
||||
return resource;
|
||||
}
|
||||
if (literalCurrentCulture == null || literalCurrentCulture.ContainsKey(resource) == false) { return resource; }
|
||||
|
||||
return (literalCurrentCulture[resource] as string) ?? resource;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ public static class ObjectActivator
|
||||
|
||||
NewExpression newExp = Expression.New(type);
|
||||
LambdaExpression lambda = Expression.Lambda(typeof(Func<object>), newExp);
|
||||
Func<object> compiledLambdaNew = (Func<object>) lambda.Compile();
|
||||
Func<object> compiledLambdaNew = (Func<object>)lambda.Compile();
|
||||
|
||||
Creators.Add(type, compiledLambdaNew);
|
||||
|
||||
|
||||
@@ -7,10 +7,7 @@ public static class ServerHelpers
|
||||
{
|
||||
private static string? _contentRoot;
|
||||
|
||||
public static void SetContentRoot(string contentRoot)
|
||||
{
|
||||
_contentRoot = contentRoot;
|
||||
}
|
||||
public static void SetContentRoot(string contentRoot) { _contentRoot = contentRoot; }
|
||||
|
||||
public static string MapContentPath(string path)
|
||||
{
|
||||
@@ -20,10 +17,7 @@ public static class ServerHelpers
|
||||
|
||||
public static string HtmlEncode(string text)
|
||||
{
|
||||
if (string.IsNullOrEmpty(text))
|
||||
{
|
||||
return text;
|
||||
}
|
||||
if (string.IsNullOrEmpty(text)) { return text; }
|
||||
|
||||
StringBuilder sbResult = new();
|
||||
|
||||
@@ -54,10 +48,7 @@ public static class ServerHelpers
|
||||
sbResult.Append(((int)ch).ToString(NumberFormatInfo.InvariantInfo));
|
||||
sbResult.Append(';');
|
||||
}
|
||||
else
|
||||
{
|
||||
sbResult.Append(ch);
|
||||
}
|
||||
else { sbResult.Append(ch); }
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -69,28 +60,19 @@ public static class ServerHelpers
|
||||
|
||||
public static string UrlEncode(string text)
|
||||
{
|
||||
if (string.IsNullOrEmpty(text))
|
||||
{
|
||||
return text;
|
||||
}
|
||||
if (string.IsNullOrEmpty(text)) { return text; }
|
||||
|
||||
StringBuilder sbResult = new();
|
||||
|
||||
foreach (var ch in text)
|
||||
{
|
||||
if (ch == ' ')
|
||||
{
|
||||
sbResult.Append('+');
|
||||
}
|
||||
if (ch == ' ') { sbResult.Append('+'); }
|
||||
else if (IsUrlSafe(ch) == false)
|
||||
{
|
||||
int intCh = ch;
|
||||
sbResult.Append($"%{intCh:X02}");
|
||||
}
|
||||
else
|
||||
{
|
||||
sbResult.Append(ch);
|
||||
}
|
||||
else { sbResult.Append(ch); }
|
||||
}
|
||||
|
||||
return sbResult.ToString();
|
||||
@@ -108,10 +90,7 @@ public static class ServerHelpers
|
||||
ch == '!' ||
|
||||
ch == '*' ||
|
||||
ch == '(' ||
|
||||
ch == ')')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
ch == ')') { return true; }
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -7,64 +7,64 @@ public static class StaticFileHelper
|
||||
{
|
||||
private static readonly Dictionary<string, string> MimeTypeByExtension = new()
|
||||
{
|
||||
{".aac", "audio/aac"},
|
||||
{".abw", "application/x-abiword"},
|
||||
{".arc", "application/octet-stream"},
|
||||
{".avi", "video/x-msvideo"},
|
||||
{".azw", "application/vnd.amazon.ebook"},
|
||||
{".bin", "application/octet-stream"},
|
||||
{".bz", "application/x-bzip"},
|
||||
{".bz2", "application/x-bzip2"},
|
||||
{".csh", "application/x-csh"},
|
||||
{".css", "text/css"},
|
||||
{".csv", "text/csv"},
|
||||
{".doc", "application/msword"},
|
||||
{".epub", "application/epub+zip"},
|
||||
{".gif", "image/gif"},
|
||||
{".htm", "text/html"},
|
||||
{".html", "text/html"},
|
||||
{".ico", "image/x-icon"},
|
||||
{".ics", "text/calendar"},
|
||||
{".jar", "application/java-archive"},
|
||||
{".jpg", "image/jpeg"},
|
||||
{".jpeg", "image/jpeg"},
|
||||
{".js", "application/javascript"},
|
||||
{".json", "application/json"},
|
||||
{".mid", "audio/midi"},
|
||||
{".midi", "audio/midi"},
|
||||
{".mpeg", "video/mpeg"},
|
||||
{".mpkg", "application/vnd.apple.installer+xml"},
|
||||
{".odp", "application/vnd.oasis.opendocument.presentation"},
|
||||
{".ods", "application/vnd.oasis.opendocument.spreadsheet"},
|
||||
{".odt", "application/vnd.oasis.opendocument.text"},
|
||||
{".oga", "audio/ogg"},
|
||||
{".ogv", "video/ogg"},
|
||||
{".ogx", "application/ogg"},
|
||||
{".png", "image/png"},
|
||||
{".pdf", "application/pdf"},
|
||||
{".ppt", "application/vnd.ms-powerpoint"},
|
||||
{".rar", "application/x-rar-compressed"},
|
||||
{".rtf", "application/rtf"},
|
||||
{".sh", "application/x-sh"},
|
||||
{".svg", "image/svg+xml"},
|
||||
{".swf", "application/x-shockwave-flash"},
|
||||
{".tar", "application/x-tar"},
|
||||
{".tiff", "image/tiff"},
|
||||
{".tif", "image/tiff"},
|
||||
{".ttf", "font/ttf"},
|
||||
{".vsd", "application/vnd.visio"},
|
||||
{".wav", "audio/x-wav"},
|
||||
{".weba", "audio/webm"},
|
||||
{".webm", "video/webm"},
|
||||
{".webp", "image/webp"},
|
||||
{".woff", "font/woff"},
|
||||
{".woff2", "font/woff2"},
|
||||
{".xhtml", "application/xhtml+xml"},
|
||||
{".xls", "application/vnd.ms-excel"},
|
||||
{".xml", "application/xml"},
|
||||
{".xul", "application/vnd.mozilla.xul+xml"},
|
||||
{".zip", "application/zip"},
|
||||
{".7z", "application/x-7z-compressed"},
|
||||
{ ".aac", "audio/aac" },
|
||||
{ ".abw", "application/x-abiword" },
|
||||
{ ".arc", "application/octet-stream" },
|
||||
{ ".avi", "video/x-msvideo" },
|
||||
{ ".azw", "application/vnd.amazon.ebook" },
|
||||
{ ".bin", "application/octet-stream" },
|
||||
{ ".bz", "application/x-bzip" },
|
||||
{ ".bz2", "application/x-bzip2" },
|
||||
{ ".csh", "application/x-csh" },
|
||||
{ ".css", "text/css" },
|
||||
{ ".csv", "text/csv" },
|
||||
{ ".doc", "application/msword" },
|
||||
{ ".epub", "application/epub+zip" },
|
||||
{ ".gif", "image/gif" },
|
||||
{ ".htm", "text/html" },
|
||||
{ ".html", "text/html" },
|
||||
{ ".ico", "image/x-icon" },
|
||||
{ ".ics", "text/calendar" },
|
||||
{ ".jar", "application/java-archive" },
|
||||
{ ".jpg", "image/jpeg" },
|
||||
{ ".jpeg", "image/jpeg" },
|
||||
{ ".js", "application/javascript" },
|
||||
{ ".json", "application/json" },
|
||||
{ ".mid", "audio/midi" },
|
||||
{ ".midi", "audio/midi" },
|
||||
{ ".mpeg", "video/mpeg" },
|
||||
{ ".mpkg", "application/vnd.apple.installer+xml" },
|
||||
{ ".odp", "application/vnd.oasis.opendocument.presentation" },
|
||||
{ ".ods", "application/vnd.oasis.opendocument.spreadsheet" },
|
||||
{ ".odt", "application/vnd.oasis.opendocument.text" },
|
||||
{ ".oga", "audio/ogg" },
|
||||
{ ".ogv", "video/ogg" },
|
||||
{ ".ogx", "application/ogg" },
|
||||
{ ".png", "image/png" },
|
||||
{ ".pdf", "application/pdf" },
|
||||
{ ".ppt", "application/vnd.ms-powerpoint" },
|
||||
{ ".rar", "application/x-rar-compressed" },
|
||||
{ ".rtf", "application/rtf" },
|
||||
{ ".sh", "application/x-sh" },
|
||||
{ ".svg", "image/svg+xml" },
|
||||
{ ".swf", "application/x-shockwave-flash" },
|
||||
{ ".tar", "application/x-tar" },
|
||||
{ ".tiff", "image/tiff" },
|
||||
{ ".tif", "image/tiff" },
|
||||
{ ".ttf", "font/ttf" },
|
||||
{ ".vsd", "application/vnd.visio" },
|
||||
{ ".wav", "audio/x-wav" },
|
||||
{ ".weba", "audio/webm" },
|
||||
{ ".webm", "video/webm" },
|
||||
{ ".webp", "image/webp" },
|
||||
{ ".woff", "font/woff" },
|
||||
{ ".woff2", "font/woff2" },
|
||||
{ ".xhtml", "application/xhtml+xml" },
|
||||
{ ".xls", "application/vnd.ms-excel" },
|
||||
{ ".xml", "application/xml" },
|
||||
{ ".xul", "application/vnd.mozilla.xul+xml" },
|
||||
{ ".zip", "application/zip" },
|
||||
{ ".7z", "application/x-7z-compressed" },
|
||||
};
|
||||
|
||||
public static void ResponseStaticFile(IWebContext context, string filePath)
|
||||
|
||||
@@ -23,5 +23,6 @@ public class Unit
|
||||
|
||||
public enum UnitType
|
||||
{
|
||||
Pixel, Percentage,
|
||||
Pixel,
|
||||
Percentage,
|
||||
}
|
||||
@@ -10,7 +10,7 @@ public class Button : Control, IReceivePostbackEvent
|
||||
public string Text { get; set; } = string.Empty;
|
||||
|
||||
public string OnClientClick { get; set; } = string.Empty;
|
||||
|
||||
|
||||
public string CommandArgument { get; set; } = string.Empty;
|
||||
|
||||
public event EventHandler? Click;
|
||||
@@ -20,10 +20,8 @@ public class Button : Control, IReceivePostbackEvent
|
||||
textWriter.Write("<input type=\"submit\" ");
|
||||
RenderAttributes(textWriter);
|
||||
RenderAttribute(textWriter, "value", Text);
|
||||
if (string.IsNullOrEmpty(OnClientClick) == false)
|
||||
{
|
||||
RenderAttribute(textWriter, "onclick", OnClientClick);
|
||||
}
|
||||
if (string.IsNullOrEmpty(OnClientClick) == false) { RenderAttribute(textWriter, "onclick", OnClientClick); }
|
||||
|
||||
textWriter.Write(">");
|
||||
|
||||
base.Render(textWriter);
|
||||
|
||||
@@ -46,7 +46,7 @@ public class CTextBox : Control, INamingContainer, IValidableControl
|
||||
public TextBox TxtContent => _txtContent;
|
||||
|
||||
public HiddenField? HidSize => _hidSize;
|
||||
|
||||
|
||||
#endregion Properties
|
||||
|
||||
#region Control life cycle
|
||||
@@ -72,7 +72,8 @@ public class CTextBox : Control, INamingContainer, IValidableControl
|
||||
string strCfgName = $"{ClientID}_cfg";
|
||||
Dictionary<string, object> cfg = new()
|
||||
{
|
||||
{"txtContent", _txtContent.ClientID}, {"hidSize", _hidSize?.ClientID ?? string.Empty}, {"keepSize", KeepSize},
|
||||
{ "txtContent", _txtContent.ClientID }, { "hidSize", _hidSize?.ClientID ?? string.Empty },
|
||||
{ "keepSize", KeepSize },
|
||||
};
|
||||
StringBuilder sbCfg = new StringBuilder();
|
||||
sbCfg.AppendFormat("<script>\n");
|
||||
@@ -87,10 +88,7 @@ public class CTextBox : Control, INamingContainer, IValidableControl
|
||||
private void CTextBox_PreRender(object? sender, EventArgs e)
|
||||
{
|
||||
_txtContent.CssClass = CssClassBase;
|
||||
if (string.IsNullOrEmpty(CssClassExtra) == false)
|
||||
{
|
||||
_txtContent.CssClass = $"{CssClassBase} {CssClassExtra}";
|
||||
}
|
||||
if (string.IsNullOrEmpty(CssClassExtra) == false) { _txtContent.CssClass = $"{CssClassBase} {CssClassExtra}"; }
|
||||
|
||||
if (Page?.IsPostBack == true && (AllowEmpty == false && IsEmpty()) || MarkedInvalid)
|
||||
{
|
||||
@@ -99,10 +97,7 @@ public class CTextBox : Control, INamingContainer, IValidableControl
|
||||
|
||||
_txtContent.Attributes.Add("onchange", "ElementRemoveClass(this, 'textBoxInvalid');");
|
||||
|
||||
if (string.IsNullOrEmpty(PlaceHolder) == false)
|
||||
{
|
||||
_txtContent.Attributes.Add("placeholder", PlaceHolder);
|
||||
}
|
||||
if (string.IsNullOrEmpty(PlaceHolder) == false) { _txtContent.Attributes.Add("placeholder", PlaceHolder); }
|
||||
|
||||
if (NextFocusOnEnter != null)
|
||||
{
|
||||
@@ -131,17 +126,15 @@ public class CTextBox : Control, INamingContainer, IValidableControl
|
||||
|
||||
if (sizeObj.ContainsKey("height") == false) { return null; }
|
||||
|
||||
return (int) sizeObj["height"];
|
||||
return (int)sizeObj["height"];
|
||||
}
|
||||
|
||||
public void SetClientsideHeight(int? height)
|
||||
{
|
||||
if (height == null)
|
||||
{
|
||||
if (_hidSize != null)
|
||||
{
|
||||
_hidSize.Value = string.Empty;
|
||||
}
|
||||
if (_hidSize != null) { _hidSize.Value = string.Empty; }
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -151,13 +144,11 @@ public class CTextBox : Control, INamingContainer, IValidableControl
|
||||
JsonParser jsonParser = new JsonParser();
|
||||
sizeObj = jsonParser.Parse(_hidSize?.Value) as Dictionary<string, object?>;
|
||||
}
|
||||
|
||||
sizeObj ??= new Dictionary<string, object?> { { "height", null }, { "width", null }, { "scrollTop", null }, };
|
||||
sizeObj["height"] = height;
|
||||
|
||||
if (_hidSize != null)
|
||||
{
|
||||
_hidSize.Value = JsonWriter.WriteObject(sizeObj);
|
||||
}
|
||||
|
||||
if (_hidSize != null) { _hidSize.Value = JsonWriter.WriteObject(sizeObj); }
|
||||
}
|
||||
|
||||
#endregion Public methods
|
||||
|
||||
@@ -185,10 +185,7 @@ public class Control
|
||||
|
||||
if (_controls != null)
|
||||
{
|
||||
foreach (Control child in _controls)
|
||||
{
|
||||
child.ChildsOfType<T>(controls);
|
||||
}
|
||||
foreach (Control child in _controls) { child.ChildsOfType<T>(controls); }
|
||||
}
|
||||
|
||||
return controls;
|
||||
|
||||
@@ -7,6 +7,7 @@ public class LiteralControl : Control
|
||||
public string Content { get; set; } = string.Empty;
|
||||
|
||||
public LiteralControl() { }
|
||||
|
||||
public LiteralControl(string content) { Content = content; }
|
||||
|
||||
protected override void Render(TextWriter textWriter) { textWriter.Write(Content); }
|
||||
|
||||
@@ -50,5 +50,7 @@ public class TextBox : Control
|
||||
|
||||
public enum TextBoxMode
|
||||
{
|
||||
Normal, Password, MultiLine,
|
||||
Normal,
|
||||
Password,
|
||||
MultiLine,
|
||||
}
|
||||
@@ -16,18 +16,18 @@ public static class FormUtils
|
||||
|
||||
public static Control CreateField(string label, Control fieldControl)
|
||||
{
|
||||
Panel pnlRow = new Panel {CssClass = "formRow"};
|
||||
Panel pnlRow = new Panel { CssClass = "formRow" };
|
||||
|
||||
Panel pnlLabelContainer = new Panel {CssClass = "formLabel width25pc"};
|
||||
Panel pnlLabelContainer = new Panel { CssClass = "formLabel width25pc" };
|
||||
pnlRow.Controls.Add(pnlLabelContainer);
|
||||
|
||||
if (string.IsNullOrEmpty(label) == false)
|
||||
{
|
||||
Label lblField = new Label {Text = label};
|
||||
Label lblField = new Label { Text = label };
|
||||
pnlLabelContainer.Controls.Add(lblField);
|
||||
}
|
||||
|
||||
Panel pnlFieldContainer = new Panel {CssClass = "formField width75pc"};
|
||||
Panel pnlFieldContainer = new Panel { CssClass = "formField width75pc" };
|
||||
pnlRow.Controls.Add(pnlFieldContainer);
|
||||
|
||||
pnlFieldContainer.Controls.Add(fieldControl);
|
||||
@@ -35,10 +35,7 @@ public static class FormUtils
|
||||
return pnlRow;
|
||||
}
|
||||
|
||||
public static bool Control_IsValid(Control control)
|
||||
{
|
||||
return (control as IValidableControl)?.IsValid() != false;
|
||||
}
|
||||
public static bool Control_IsValid(Control control) { return (control as IValidableControl)?.IsValid() != false; }
|
||||
|
||||
public static bool Controls_AreValid(ControlCollection controls)
|
||||
{
|
||||
|
||||
@@ -31,14 +31,15 @@ public class FrmError : PageCommon
|
||||
{
|
||||
Title = "Application Error";
|
||||
|
||||
Label lblErrorTitle = new Label {Text = Title, Tag = "h2"};
|
||||
Label lblErrorTitle = new Label { Text = Title, Tag = "h2" };
|
||||
Controls.Add(lblErrorTitle);
|
||||
|
||||
Exception? exAux = (Exception?)_ex;
|
||||
//if (exAux is HttpUnhandledException && exAux.InnerException != null) { exAux = exAux.InnerException; }
|
||||
while (exAux != null)
|
||||
{
|
||||
LiteralControl lblMessage = new LiteralControl($"<p><b>Message:</b> {HttpUtility.HtmlEncode(exAux.Message)}</p>");
|
||||
LiteralControl lblMessage =
|
||||
new LiteralControl($"<p><b>Message:</b> {HttpUtility.HtmlEncode(exAux.Message)}</p>");
|
||||
Controls.Add(lblMessage);
|
||||
|
||||
LiteralControl lblStacktraceTitle = new LiteralControl("<p><b>Stacktrace:</b></p>");
|
||||
|
||||
@@ -11,7 +11,7 @@ public class PageCommon : Page
|
||||
|
||||
private readonly HtmlHead _head = new();
|
||||
private readonly HtmlBody _body = new();
|
||||
private readonly HtmlForm _form = new() {ID = "formMain"};
|
||||
private readonly HtmlForm _form = new() { ID = "formMain" };
|
||||
private readonly Panel _pnlContainer = new();
|
||||
private readonly Button _btnPostback = new();
|
||||
private readonly Button _btnLogout = new();
|
||||
@@ -41,10 +41,7 @@ public class PageCommon : Page
|
||||
{
|
||||
Context?.PrepareUncacheableResponse();
|
||||
|
||||
if (Context != null)
|
||||
{
|
||||
_isAuthenticated = GlobalConfig.Get().IsUserAuthenticated(Context);
|
||||
}
|
||||
if (Context != null) { _isAuthenticated = GlobalConfig.Get().IsUserAuthenticated(Context); }
|
||||
|
||||
if (MustBeAuthenticated && _isAuthenticated == false)
|
||||
{
|
||||
@@ -68,10 +65,8 @@ public class PageCommon : Page
|
||||
|
||||
private void btnLogout_Click(object? sender, EventArgs e)
|
||||
{
|
||||
if(Context != null)
|
||||
{
|
||||
GlobalConfig.Get().UserDeauthenticate(Context);
|
||||
}
|
||||
if (Context != null) { GlobalConfig.Get().UserDeauthenticate(Context); }
|
||||
|
||||
if (MustBeAuthenticated) { Context?.ResponseRedirect(GlobalConfig.Get().LoginHandler); }
|
||||
}
|
||||
|
||||
@@ -91,10 +86,10 @@ public class PageCommon : Page
|
||||
|
||||
html.Controls.Add(_head);
|
||||
|
||||
_head.Controls.Add(new HtmlMeta {HttpEquiv = "X-UA-Compatible", Content = "IE=Edge"});
|
||||
_head.Controls.Add(new HtmlMeta {HttpEquiv = "content-type", Content = "text/html; charset=utf-8"});
|
||||
_head.Controls.Add(new HtmlMeta {Name = "author", Content = GlobalConfig.Get().Author});
|
||||
_head.Controls.Add(new HtmlMeta {Name = "Copyright", Content = GlobalConfig.Get().Copyright});
|
||||
_head.Controls.Add(new HtmlMeta { HttpEquiv = "X-UA-Compatible", Content = "IE=Edge" });
|
||||
_head.Controls.Add(new HtmlMeta { HttpEquiv = "content-type", Content = "text/html; charset=utf-8" });
|
||||
_head.Controls.Add(new HtmlMeta { Name = "author", Content = GlobalConfig.Get().Author });
|
||||
_head.Controls.Add(new HtmlMeta { Name = "Copyright", Content = GlobalConfig.Get().Copyright });
|
||||
_head.Controls.Add(
|
||||
new HtmlMeta
|
||||
{
|
||||
@@ -114,13 +109,13 @@ public class PageCommon : Page
|
||||
html.Controls.Add(_body);
|
||||
_body.Controls.Add(_form);
|
||||
|
||||
var pnlHeader = new Panel {CssClass = "divHeader"};
|
||||
var pnlHeader = new Panel { CssClass = "divHeader" };
|
||||
_form.Controls.Add(pnlHeader);
|
||||
|
||||
HyperLink lnkTitle = new HyperLink {NavigateUrl = "."};
|
||||
HyperLink lnkTitle = new HyperLink { NavigateUrl = "." };
|
||||
pnlHeader.Controls.Add(lnkTitle);
|
||||
|
||||
var lblTitle = new Label {Text = GlobalConfig.Get().Title, Tag = "h1"};
|
||||
var lblTitle = new Label { Text = GlobalConfig.Get().Title, Tag = "h1" };
|
||||
lnkTitle.Controls.Add(lblTitle);
|
||||
|
||||
_btnPostback.ID = "btnPostback";
|
||||
@@ -128,7 +123,7 @@ public class PageCommon : Page
|
||||
pnlHeader.Controls.Add(_btnPostback);
|
||||
_btnPostback.Style.Add("display", "none");
|
||||
|
||||
var pnlUserInfo = new Panel {CssClass = "divUserInfo"};
|
||||
var pnlUserInfo = new Panel { CssClass = "divUserInfo" };
|
||||
pnlHeader.Controls.Add(pnlUserInfo);
|
||||
|
||||
_btnLogout.ID = "btnLogout";
|
||||
|
||||
@@ -13,7 +13,9 @@ function GetElement(element) {
|
||||
//
|
||||
function ElementAddClass(element, classname) {
|
||||
element = GetElement(element);
|
||||
if (!element) { return; }
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
var cn = element.className;
|
||||
if (cn.indexOf(classname) !== -1) {
|
||||
return;
|
||||
@@ -29,7 +31,9 @@ function ElementAddClass(element, classname) {
|
||||
//
|
||||
function ElementRemoveClass(element, className) {
|
||||
element = GetElement(element);
|
||||
if (!element) { return; }
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
var regex = new RegExp('(?:^|\\s)' + className + '(?!\\S)');
|
||||
if (regex.test(element.className)) {
|
||||
element.className = element.className.replace(regex, '');
|
||||
@@ -41,7 +45,9 @@ function ElementRemoveClass(element, className) {
|
||||
//
|
||||
function ElementToggleClass(element, className) {
|
||||
element = GetElement(element);
|
||||
if (!element) { return; }
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
var regex = new RegExp('(?:^|\\s)' + className + '(?!\\S)');
|
||||
if (regex.test(element.className)) {
|
||||
element.className = element.className.replace(regex, '');
|
||||
@@ -71,24 +77,34 @@ function fixedEncodeURIComponent(str) {
|
||||
if (!window.localStorage) {
|
||||
window.localStorage = {
|
||||
getItem: function (sKey) {
|
||||
if (!sKey || !this.hasOwnProperty(sKey)) { return null; }
|
||||
if (!sKey || !this.hasOwnProperty(sKey)) {
|
||||
return null;
|
||||
}
|
||||
return unescape(document.cookie.replace(new RegExp("(?:^|.*;\\s*)" + escape(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*"), "$1"));
|
||||
},
|
||||
key: function (nKeyId) { return unescape(document.cookie.replace(/\s*\=(?:.(?!;))*$/, "").split(/\s*\=(?:[^;](?!;))*[^;]?;\s*/)[nKeyId]); },
|
||||
key: function (nKeyId) {
|
||||
return unescape(document.cookie.replace(/\s*\=(?:.(?!;))*$/, "").split(/\s*\=(?:[^;](?!;))*[^;]?;\s*/)[nKeyId]);
|
||||
},
|
||||
setItem: function (sKey, sValue) {
|
||||
if (!sKey) { return; }
|
||||
if (!sKey) {
|
||||
return;
|
||||
}
|
||||
document.cookie = escape(sKey) + "=" + escape(sValue) + "; path=/";
|
||||
this.length = document.cookie.match(/\=/g).length;
|
||||
},
|
||||
length: 0,
|
||||
removeItem: function (sKey) {
|
||||
if (!sKey || !this.hasOwnProperty(sKey)) { return; }
|
||||
if (!sKey || !this.hasOwnProperty(sKey)) {
|
||||
return;
|
||||
}
|
||||
var sExpDate = new Date();
|
||||
sExpDate.setDate(sExpDate.getDate() - 1);
|
||||
document.cookie = escape(sKey) + "=; expires=" + sExpDate.toGMTString() + "; path=/";
|
||||
this.length--;
|
||||
},
|
||||
hasOwnProperty: function (sKey) { return (new RegExp("(?:^|;\\s*)" + escape(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=")).test(document.cookie); }
|
||||
hasOwnProperty: function (sKey) {
|
||||
return (new RegExp("(?:^|;\\s*)" + escape(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=")).test(document.cookie);
|
||||
}
|
||||
};
|
||||
window.localStorage.length = (document.cookie.match(/\=/g) || window.localStorage).length;
|
||||
}
|
||||
@@ -44,7 +44,7 @@ var CTextBox_Multiline_RestoreSizeData = function (textArea) {
|
||||
textArea.scrollTop = textArea.cfg.size.scrollTop;
|
||||
}
|
||||
}
|
||||
textArea.cfg.size = { height: textArea.offsetHeight, width: textArea.offsetWidth, scrollTop: textArea.scrollTop };
|
||||
textArea.cfg.size = {height: textArea.offsetHeight, width: textArea.offsetWidth, scrollTop: textArea.scrollTop};
|
||||
};
|
||||
|
||||
////////////////////////
|
||||
@@ -52,7 +52,7 @@ var CTextBox_Multiline_RestoreSizeData = function (textArea) {
|
||||
//
|
||||
var CTextBox_Multiline_MouseUp = function (e) {
|
||||
var textArea = e.target;
|
||||
var newSize = { height: textArea.offsetHeight, width: textArea.offsetWidth, scrollTop: textArea.scrollTop };
|
||||
var newSize = {height: textArea.offsetHeight, width: textArea.offsetWidth, scrollTop: textArea.scrollTop};
|
||||
if (textArea.cfg.size.height !== newSize.height) {
|
||||
textArea.cfg.size = newSize;
|
||||
CTextBox_Multiline_SaveSizeData(textArea);
|
||||
@@ -64,7 +64,7 @@ var CTextBox_Multiline_MouseUp = function (e) {
|
||||
//
|
||||
var CTextBox_Multiline_Scrolled = function (e) {
|
||||
var textArea = e.target;
|
||||
textArea.cfg.size = { height: textArea.offsetHeight, width: textArea.offsetWidth, scrollTop: textArea.scrollTop };
|
||||
textArea.cfg.size = {height: textArea.offsetHeight, width: textArea.offsetWidth, scrollTop: textArea.scrollTop};
|
||||
CTextBox_Multiline_SaveSizeData(textArea);
|
||||
};
|
||||
|
||||
|
||||
@@ -49,16 +49,16 @@ h3 {
|
||||
height: 38px;
|
||||
}
|
||||
|
||||
.divHeader a {
|
||||
text-decoration: none;
|
||||
}
|
||||
.divHeader a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.divHeader h1 {
|
||||
font-size: 30px;
|
||||
color: yellow;
|
||||
margin: 0;
|
||||
text-shadow: none;
|
||||
}
|
||||
.divHeader h1 {
|
||||
font-size: 30px;
|
||||
color: yellow;
|
||||
margin: 0;
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
.divUserInfo {
|
||||
position: absolute;
|
||||
@@ -105,9 +105,9 @@ h3 {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.formLabel span:last-child::after {
|
||||
content: ':';
|
||||
}
|
||||
.formLabel span:last-child::after {
|
||||
content: ':';
|
||||
}
|
||||
|
||||
.formField {
|
||||
display: inline-block;
|
||||
@@ -126,10 +126,10 @@ h3 {
|
||||
box-shadow: inset 0 -2px 5px rgba(255, 255, 255, 1), inset 0 2px 5px rgba(128, 128, 128, 1);
|
||||
}
|
||||
|
||||
.textBox:focus {
|
||||
border: solid 1px black;
|
||||
box-shadow: 0 0 10px rgba(255, 255, 255, 0.5), inset 0 -2px 5px rgba(255, 255, 255, 1), inset 0 2px 5px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
.textBox:focus {
|
||||
border: solid 1px black;
|
||||
box-shadow: 0 0 10px rgba(255, 255, 255, 0.5), inset 0 -2px 5px rgba(255, 255, 255, 1), inset 0 2px 5px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
textarea.textBox {
|
||||
height: 64px;
|
||||
@@ -142,10 +142,10 @@ textarea.textBox {
|
||||
border: solid 1px rgb(255, 0, 0);
|
||||
}
|
||||
|
||||
.textBoxInvalid:focus {
|
||||
box-shadow: 0 0 10px rgba(255, 0, 0, 1), inset 0 -2px 5px rgba(255, 255, 255, 1), inset 0 2px 5px rgba(0, 0, 0, 0.5);
|
||||
border: solid 1px black;
|
||||
}
|
||||
.textBoxInvalid:focus {
|
||||
box-shadow: 0 0 10px rgba(255, 0, 0, 1), inset 0 -2px 5px rgba(255, 255, 255, 1), inset 0 2px 5px rgba(0, 0, 0, 0.5);
|
||||
border: solid 1px black;
|
||||
}
|
||||
|
||||
.button {
|
||||
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), inset 0 2px 5px rgba(255, 255, 255, 1), inset 0 -2px 5px rgba(128, 128, 128, 1);
|
||||
@@ -165,21 +165,22 @@ textarea.textBox {
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
.button:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
.button:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.button:hover {
|
||||
background-color: rgb(220, 220, 220);
|
||||
}
|
||||
.button:focus {
|
||||
border: solid 1px black;
|
||||
}
|
||||
|
||||
.button:active {
|
||||
background-color: rgb(220, 220, 220);
|
||||
box-shadow: inset 0 2px 5px rgba(255, 255, 255, 1), inset 0 -2px 5px rgba(128, 128, 128, 1);
|
||||
}
|
||||
.button:hover {
|
||||
background-color: rgb(220, 220, 220);
|
||||
}
|
||||
|
||||
.button:focus {
|
||||
border: solid 1px black;
|
||||
}
|
||||
|
||||
.button:active {
|
||||
background-color: rgb(220, 220, 220);
|
||||
box-shadow: inset 0 2px 5px rgba(255, 255, 255, 1), inset 0 -2px 5px rgba(128, 128, 128, 1);
|
||||
}
|
||||
|
||||
.width25pc {
|
||||
width: 25% !important;
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Library</OutputType>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<LangVersion>10</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OutputType>Library</OutputType>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<LangVersion>10</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="Scripts\01. Base.js" />
|
||||
<None Remove="Scripts\02. Ajax.js" />
|
||||
<None Remove="Scripts\03. Controls.js" />
|
||||
<None Remove="Styles\00. Reset.css" />
|
||||
<None Remove="Styles\01. base.css" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Remove="Scripts\01. Base.js"/>
|
||||
<None Remove="Scripts\02. Ajax.js"/>
|
||||
<None Remove="Scripts\03. Controls.js"/>
|
||||
<None Remove="Styles\00. Reset.css"/>
|
||||
<None Remove="Styles\01. base.css"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Scripts\01. Base.js" />
|
||||
<EmbeddedResource Include="Scripts\02. Ajax.js" />
|
||||
<EmbeddedResource Include="Scripts\03. Controls.js" />
|
||||
<EmbeddedResource Include="Styles\00. Reset.css" />
|
||||
<EmbeddedResource Include="Styles\01. base.css" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Scripts\01. Base.js"/>
|
||||
<EmbeddedResource Include="Scripts\02. Ajax.js"/>
|
||||
<EmbeddedResource Include="Scripts\03. Controls.js"/>
|
||||
<EmbeddedResource Include="Styles\00. Reset.css"/>
|
||||
<EmbeddedResource Include="Styles\01. base.css"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="VAR.Json" Version="1.2.2" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="VAR.Json" Version="1.2.2"/>
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user