Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #3192. Improve correctness / clarity of existing View.AutoSize functionality/unit tests #3202

Merged
merged 209 commits into from
Feb 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
209 commits
Select commit Hold shift + click to select a range
c7e2914
Removed resharper settings from editorconfig
tig Jan 10, 2024
fa4337c
Merge branch 'v2_develop' of tig:gui-cs/Terminal.Gui into v2_develop
tig Jan 10, 2024
7ee17d8
Merge branch 'v2_develop' of github.com:gui-cs/Terminal.Gui into v2_d…
tig Jan 13, 2024
15b36b5
Merge branch 'v2_develop' of github.com:gui-cs/Terminal.Gui into v2_d…
tig Jan 13, 2024
e26a463
Merge branch 'v2_develop' of github.com:gui-cs/Terminal.Gui into v2_d…
tig Jan 13, 2024
9bd93ca
Merge branch 'v2_develop' of github.com:gui-cs/Terminal.Gui into v2_d…
tig Jan 13, 2024
4cdf647
Merge branch 'v2_develop' of github.com:gui-cs/Terminal.Gui into v2_d…
tig Jan 14, 2024
19a95b3
Merge branch 'v2_develop' of github.com:gui-cs/Terminal.Gui into v2_d…
tig Jan 14, 2024
18a99e7
Merge branch 'v2_develop' of github.com:gui-cs/Terminal.Gui into v2_d…
tig Jan 14, 2024
6b06e92
Merge branch 'v2_develop' of github.com:gui-cs/Terminal.Gui into v2_d…
tig Jan 14, 2024
8666c6f
Merge branch 'v2_develop' of github.com:gui-cs/Terminal.Gui into v2_d…
tig Jan 14, 2024
6b190d6
Remove constructors with frame parameters from Button class.
BDisp Jan 15, 2024
6d6553a
Remove constructors with frame parameters from CheckBox class.
BDisp Jan 15, 2024
cdb3d6f
Cleanup code.
BDisp Jan 15, 2024
61c1cab
Remove constructors with frame parameters from ComboBox class.
BDisp Jan 15, 2024
e71f970
@BDisp
BDisp Jan 15, 2024
01f8681
Remove constructors with frame parameters from Label class.
BDisp Jan 15, 2024
e42c80a
Remove constructors with frame parameters from ListView class.
BDisp Jan 15, 2024
ec47ab1
Remove constructors with frame parameters from ScrollBarView class.
BDisp Jan 15, 2024
a2c7e51
Remove constructors with frame parameters from ScrollView class.
BDisp Jan 15, 2024
5e35e89
Remove namespace braces.
BDisp Jan 15, 2024
966fc7d
Cleanup code.
BDisp Jan 15, 2024
319440f
Cleanup code.
BDisp Jan 15, 2024
86c8606
Cleanup code.
BDisp Jan 15, 2024
25b539c
Remove constructors with frame parameters from TextField class.
BDisp Jan 16, 2024
b79171a
Remove constructors with frame parameters from TimeField class.
BDisp Jan 16, 2024
cf9c24b
Fixes #3182. OnResizeNeeded returns int.MaxValue and int.MaxValue whe…
BDisp Jan 16, 2024
8215232
Remove constructors with frame parameters from Toplevel class.
BDisp Jan 16, 2024
2a7ed33
Remove constructors with frame parameters from Window class.
BDisp Jan 16, 2024
04fb257
Resolving merge conflicts.
BDisp Jan 16, 2024
3eaf007
Fix merge errors.
BDisp Jan 16, 2024
08909e1
Merge branch 'v2_develop' of github.com:gui-cs/Terminal.Gui into v2_d…
tig Jan 16, 2024
23b0914
Merge branch 'v2_develop' of github.com:gui-cs/Terminal.Gui into v2_d…
tig Jan 16, 2024
27e2b31
Merge branch 'v2_develop' into v2_remove-constructors-frame-parameter…
BDisp Jan 16, 2024
d3d9ffb
Revert "Fixes #3182. OnResizeNeeded returns int.MaxValue and int.MaxV…
BDisp Jan 16, 2024
c4f397f
Revert unit test.
BDisp Jan 16, 2024
1033c8a
Merge branch 'v2_develop' into v2_remove-constructors-frame-parameter…
tig Jan 16, 2024
81ad703
Merge branch 'v2_develop' of github.com:gui-cs/Terminal.Gui into v2_d…
tig Jan 16, 2024
e9f98cf
Merge branch 'v2_develop' of github.com:gui-cs/Terminal.Gui into v2_d…
tig Jan 16, 2024
5ace62b
Fixes #2882. TabView: 'Frame.DrawFrame(Rect, bool)' is obsolete: 'Thi…
BDisp Jan 16, 2024
1b1b442
Merge branch 'v2_develop' of github.com:gui-cs/Terminal.Gui into v2_d…
tig Jan 16, 2024
a572229
Resolving merge conflicts.
BDisp Jan 16, 2024
5d9e071
Fix merge errors.
BDisp Jan 16, 2024
6c93132
Remove constructors with parameters from Button.
BDisp Jan 16, 2024
a82253a
Remove parenthesis on objects initializers from Button.
BDisp Jan 16, 2024
4e6f0c4
Remove constructors with parameters from CheckBox.
BDisp Jan 17, 2024
9f09085
Remove parenthesis on objects initializers from CheckBox.
BDisp Jan 17, 2024
43b5c80
Remove constructors with parameters from ComboBox.
BDisp Jan 18, 2024
d908b9f
Remove constructors with parameters from FrameView.
BDisp Jan 19, 2024
60eb600
Remove parenthesis on objects initializers from FrameView.
BDisp Jan 19, 2024
218a3c0
Merge branch 'v2_develop' of github.com:gui-cs/Terminal.Gui into v2_d…
tig Jan 19, 2024
9724244
Initial commit
tig Jan 19, 2024
707e093
Renamed Direction enum for clarity in refactoring unit tests
tig Jan 19, 2024
3f36f6a
Moved nav tests to NavigationTests
tig Jan 19, 2024
e4baab4
Moved view tests around
tig Jan 19, 2024
9a683ba
Cleaning up TextFormatter and View.AutoSize code
tig Jan 19, 2024
3340a01
Fixed latent TextFormatter bug with \n
tig Jan 19, 2024
52e1884
Merge branch 'v2_develop' into v2_remove-constructors-frame-parameter…
BDisp Jan 20, 2024
9060dc4
removed Application dependency on some autosize unit tests
tig Jan 20, 2024
14b7865
Fixed Label tests to deal with auotsize overriding height/width
tig Jan 20, 2024
4de9151
Fixed more label tests. WIP
tig Jan 20, 2024
ee5d37f
Merge branch 'v2_develop' into v2_3192_view_autosize_false
tig Jan 21, 2024
fb55a4f
Fixed all places where AutoSize = happend after setting Dims
tig Jan 21, 2024
3949e58
Merge branch 'v2_3192_view_autosize_false' of tig:tig/Terminal.Gui in…
tig Jan 21, 2024
d792a59
Started adding new primitive View.Text tests
tig Jan 21, 2024
8abc3a4
Code comments
tig Jan 21, 2024
12ce9fc
Merge branch 'v2_develop' into v2_remove-constructors-frame-parameter…
BDisp Jan 22, 2024
28b23a1
WIP: Enforce that it makes no sense to set Width/Height if AutoSize =…
tig Jan 22, 2024
3a02f22
WIP: Enforce that it makes no sense to set Width/Height if AutoSize =…
tig Jan 22, 2024
8af8fd0
Remove frame set from the View constructor and prevent SetRelativeLay…
BDisp Jan 23, 2024
d83853f
Changes needed for unit tests pass on remove parameters constructors …
BDisp Jan 23, 2024
7ab5f28
Remove constructors with parameters from Label.
BDisp Jan 23, 2024
b4174e4
Remove parenthesis on objects initializers from Label.
BDisp Jan 23, 2024
4475652
Prefix private fields with underscore.
BDisp Jan 23, 2024
a3e6d32
Renamed to MaxLength.
BDisp Jan 23, 2024
bdab4a4
Remove constructors with parameters from ListView.
BDisp Jan 23, 2024
707af12
MakeWrapper not needed anymore.
BDisp Jan 23, 2024
1d9601e
Remove parenthesis on objects initializers from ListView.
BDisp Jan 23, 2024
3576e93
WIP: Enforce that it makes no sense to set Width/Height if AutoSize =…
tig Jan 23, 2024
039fd82
Massive code cleanup - use parameterless constructors and ensure Auto…
tig Jan 23, 2024
e986b36
Massive code cleanup - use parameterless constructors and ensure Auto…
tig Jan 23, 2024
63209f3
Fixed messagebox
tig Jan 23, 2024
958e777
Merge branch 'v2_develop' of github.com:gui-cs/Terminal.Gui into v2_d…
tig Jan 23, 2024
1f37f15
Remove constructors with parameters from ScrollBarView and ScrollView.
BDisp Jan 24, 2024
befbb77
Remove parenthesis on objects initializers from ScrollBarView and Scr…
BDisp Jan 24, 2024
c953c7a
Cleanup code.
BDisp Jan 24, 2024
e985b5b
Merge branch 'v2_develop' of github.com:gui-cs/Terminal.Gui into v2_d…
tig Jan 24, 2024
9ecf20a
Resolving merge conflicts.
BDisp Jan 24, 2024
bbbbc54
Fix merge errors.
BDisp Jan 24, 2024
a09de8c
Add empty dotsettings for solution and projects.
dodexahedron Jan 25, 2024
a31c6cc
Set ReSharper language analysis level for projects to C#12
dodexahedron Jan 25, 2024
52f5fb0
Make ReSharper consider itself the boss for style
dodexahedron Jan 25, 2024
26ce37e
Add rule to enforce property backing fields above the property
dodexahedron Jan 25, 2024
b1b920e
Disable auto-detection of naming rules so ReSharper doesn't change th…
dodexahedron Jan 25, 2024
786c7fa
Don't let someone's VS settings override the indent settings
dodexahedron Jan 25, 2024
58c4eff
Explicitly set tab width to 4 spaces and force spaces.
dodexahedron Jan 25, 2024
429b01a
Rules to keep various multi-line constructs aligned within themselves
dodexahedron Jan 25, 2024
ea4d230
Curly brace rules (Using K&R style, per current project spec)
dodexahedron Jan 25, 2024
3b8214e
Blank line rules
dodexahedron Jan 25, 2024
7c82de0
Increase auto-wrap to 160 from default of 120
dodexahedron Jan 25, 2024
77e9db4
Line break at end of all files, to make Unixy systems happy
dodexahedron Jan 25, 2024
8d120fa
Keep attributes on their own lines except for methods and records tha…
dodexahedron Jan 25, 2024
540ee4f
Increase attribute auto-wrap to 60 from default of 38
dodexahedron Jan 25, 2024
494069a
Wrap/chop rules for long method signatures and record declarations
dodexahedron Jan 25, 2024
d7c071f
Chop rules for generics
dodexahedron Jan 25, 2024
c9ac855
Always enforce enum members on their own lines
dodexahedron Jan 25, 2024
27d8249
One-line functions completely on one line
dodexahedron Jan 25, 2024
47c76e4
Keep control flow statements on their own lines
dodexahedron Jan 25, 2024
811760c
Follow same chop rules for method invocation as method declaration
dodexahedron Jan 25, 2024
03b55ce
Chop long or multi-line method chains or patterns
dodexahedron Jan 25, 2024
b861943
Wrap rules for binary operators
dodexahedron Jan 25, 2024
b7b2a3b
Spaces between keywords and their opening parentheses
dodexahedron Jan 25, 2024
cac994c
Add file layout rules for organization of reorderable items like fiel…
dodexahedron Jan 25, 2024
92a4d15
Deconstructors use per-member types
dodexahedron Jan 25, 2024
a892865
Use keywords for built-in types and increase severity of inspection f…
dodexahedron Jan 25, 2024
97749cf
Apply syntax style on completion.
dodexahedron Jan 25, 2024
404b3d6
Use var when evident for built-in and simple types, but not elsewhere
dodexahedron Jan 25, 2024
b6b206e
Increase severity for some minor redundancy and clarity inspections
dodexahedron Jan 25, 2024
c2c7612
Enforce braces always required for blocks, and treat as error
dodexahedron Jan 25, 2024
ed190db
Warn if a local function is not statement-bodied
dodexahedron Jan 25, 2024
667181b
Increase various inspection severities
dodexahedron Jan 25, 2024
3779840
Adjust preference order of null check patterns to make object pattern…
dodexahedron Jan 25, 2024
4e61352
XmlDoc rules to keep tags and contents aligned and wrapped
dodexahedron Jan 25, 2024
b6e10ba
Add a few custom profiles for code cleanup and make the full profile …
dodexahedron Jan 25, 2024
098b76c
Remove parts for languages not used in this solution
dodexahedron Jan 25, 2024
c6d9429
copied in v2_develop changes
tig Jan 25, 2024
a7c5ccc
Merge branch 'v2_develop' into v2_3192_view_autosize_false
tig Jan 25, 2024
d71c047
Merged v2_develop
tig Jan 25, 2024
7e57776
Added Begin/Init unit tests. Removed Application dependencey from Aut…
tig Jan 25, 2024
38493e4
TextFormatter.Lines -> GetLines ()
tig Jan 25, 2024
8888f7b
Let ReSharper know we intend to localize things
dodexahedron Jan 25, 2024
d7210b6
TextFormatter code cleanup
tig Jan 25, 2024
4ca1581
Merge branch 'v2_develop' of github.com:gui-cs/Terminal.Gui into v2_d…
tig Jan 25, 2024
ab84eb5
copied in v2_develop changes
tig Jan 25, 2024
fc62351
Merge branch 'v2_develop' into v2_3192_view_autosize_false
tig Jan 25, 2024
1cd6212
Merged v2_develop
tig Jan 25, 2024
7dc2ace
Spaces aren't wanted here either.
dodexahedron Jan 25, 2024
b849170
Resolving merge conflicts.
BDisp Jan 25, 2024
f265bf8
Fix merge errors.
BDisp Jan 25, 2024
e95f50b
Fixes ContentBottomRightCorner related with https://github.com/gui-cs…
BDisp Jan 25, 2024
6a6e163
Remove constructors with parameters from ContextMenu.
BDisp Jan 25, 2024
bd52548
Remove commented code.
BDisp Jan 25, 2024
698bd5b
Remove constructors with parameters from OpenDialog.
BDisp Jan 25, 2024
0d84fe0
Remove constructors with parameters from SaveDialog.
BDisp Jan 25, 2024
45883f0
Remove constructors with parameters from TextField.
BDisp Jan 26, 2024
c1f23c5
Remove constructors with parameters from TimeField.
BDisp Jan 26, 2024
733097d
Fix unit test.
BDisp Jan 26, 2024
8e07b7a
Remove unnecessary SetInitialProperties method.
BDisp Jan 26, 2024
6deedb9
Remove unnecessary SetInitialProperties method.
BDisp Jan 26, 2024
3282d67
Remove parenthesis on objects initializers from Toplevel and Window.
BDisp Jan 26, 2024
9c3c8fa
Remove constructors with parameters from RadioGroup.
BDisp Jan 26, 2024
b9349fa
Remove constructors with parameters from TextView.
BDisp Jan 26, 2024
855a643
Remove constructors with parameters from MenuBar.
BDisp Jan 27, 2024
9993445
TEMPORARY: Turn everything that was set to error down to warning or l…
dodexahedron Jan 27, 2024
51dd93e
Fixes #3219. MenuBar is opened by call OpenMenu even it's disabled.
BDisp Jan 28, 2024
0d71a18
Remove constructors with parameters from Menu.
BDisp Jan 28, 2024
c1e92a5
Remove constructors with parameters from View.
BDisp Jan 28, 2024
48dd66f
Change constructor to internal because is mainly useful for testing.
BDisp Jan 28, 2024
b4650fa
ReSharper Cleanup Code.
BDisp Jan 29, 2024
51d0bc0
Merge branch 'v2_resharper_style_settings_3212' of github.com:dodexah…
tig Jan 31, 2024
b02c648
Added format only r# config
tig Jan 31, 2024
f9f2fc6
Fixes #3224. TextFormatter.Lines should return a single string.Empty …
BDisp Jan 31, 2024
b1c591f
Remove constructors with parameters from Dialog.
BDisp Jan 31, 2024
28a6c75
Remove constructors with parameters from TextValidateField.
BDisp Jan 31, 2024
c0881e8
Fixes https://github.com/gui-cs/Terminal.Gui/issues/3224#issuecomment…
BDisp Feb 2, 2024
188c150
Fixes #3225. Press CursorDown on TabView doesn't move to the next view.
BDisp Feb 2, 2024
199592f
Fixes #3229. TextFormatter should have a FillRemaining property.
BDisp Feb 5, 2024
1c9e767
Merge branch 'v2_remove-constructors-frame-parameters_3171' of github…
tig Feb 6, 2024
2d3d487
Testing formatting merge in bdisp
tig Feb 6, 2024
11e1c54
Testing formatting merge
tig Feb 6, 2024
8f609c5
Testing formatting merge bdisp
tig Feb 6, 2024
2926852
Testing formatting merge 2
tig Feb 6, 2024
7a04682
xmldoc format
tig Feb 6, 2024
3984272
R# Full Code Cleanup
tig Feb 7, 2024
4aa3930
R# Full Code Cleanup2
tig Feb 7, 2024
2e95cec
R# Full Code Cleanup2
tig Feb 7, 2024
fd26e4b
Merge branch 'bDisp-v2_remove-constructors-frame-parameters_3171' int…
tig Feb 7, 2024
cabfc43
Merged! But broke tests
tig Feb 7, 2024
8af7cec
Refixing...
tig Feb 7, 2024
94cb4fa
Refixed DrawTests
tig Feb 7, 2024
2e1bdfa
Refixed ViewTests
tig Feb 7, 2024
eaee96d
Refixed Text Tests
tig Feb 7, 2024
170c4a9
Refixed more unit tests
tig Feb 7, 2024
c36f05f
Refixed scenarios
tig Feb 7, 2024
15a18db
Refixed rest of scenarios
tig Feb 7, 2024
b7aad20
Refixed ViewsTests
tig Feb 7, 2024
14b8a69
Refixed rest of tests. All unit tests pass again!
tig Feb 7, 2024
0db3c6c
Fixed warnings
tig Feb 7, 2024
231bb71
Updated R# version. Added new code cleanup settings
tig Feb 7, 2024
bb43889
Applied latest code cleanup to solution
tig Feb 8, 2024
5e13c19
Merge branch 'v2_develop' into v2_3192_view_autosize_false
tig Feb 8, 2024
a8e4677
Another code cleanup pass
tig Feb 9, 2024
321cf97
Tweaked r# settings. .editorconfig now matches.
tig Feb 11, 2024
24d16ab
r# else on separate line
tig Feb 11, 2024
8cba8a3
r# - update
tig Feb 11, 2024
f022dd5
r# - full solution
tig Feb 11, 2024
436672b
test commit
tig Feb 11, 2024
4da4dfb
test commit
tig Feb 11, 2024
f0ea574
test commit
tig Feb 11, 2024
e3028f9
Removed extra profiles
tig Feb 11, 2024
3fa5366
Full cleanup following cleaning up profiles
tig Feb 11, 2024
229f927
Null checking pattern rules/inspections
dodexahedron Feb 11, 2024
12e586a
Tabs and extra whitespace are evil
dodexahedron Feb 11, 2024
4629abb
Attributes on their own lines
dodexahedron Feb 11, 2024
2d8cad0
Code layout rules to put fields first and to put backing fields with …
dodexahedron Feb 11, 2024
b46582f
Merge pull request #22 from dodexahedron/fix-some-resharper-settings-1
tig Feb 11, 2024
31513e6
Merged v2_develop
tig Feb 11, 2024
ea3ec56
Full cleanup following dodexahedron's PR
tig Feb 11, 2024
68531ce
re-Merged v2_develop
tig Feb 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
172 changes: 155 additions & 17 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,35 +1,53 @@
[*.cs]
indent_style = tab
indent_size = 8
tab_width = 8
csharp_new_line_before_open_brace = methods,local_functions
csharp_new_line_before_else = false
csharp_new_line_before_catch = false
csharp_new_line_before_finally = false
end_of_line = crlf

csharp_indent_case_contents = true
csharp_indent_switch_labels = false
csharp_indent_labels = flush_left
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_preserve_single_line_blocks = true
dotnet_style_require_accessibility_modifiers = never
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
csharp_style_var_when_type_is_apparent = true:none
csharp_prefer_braces = true:none
csharp_space_before_open_square_brackets = true
csharp_prefer_braces = true:warning
csharp_space_between_method_call_name_and_opening_parenthesis = true
csharp_space_between_method_declaration_name_and_open_parenthesis = true

# Microsoft .NET properties
csharp_new_line_before_members_in_object_initializers = false
csharp_preferred_modifier_order = public, private, protected, internal, file, new, static, abstract, virtual, sealed, readonly, override, extern, unsafe, volatile, async, required:warning
csharp_style_var_elsewhere = true:none
dotnet_naming_rule.private_constants_rule.import_to_resharper = as_predefined
dotnet_naming_rule.private_constants_rule.severity = warning
dotnet_naming_rule.private_constants_rule.style = all_upper_style
dotnet_naming_rule.private_constants_rule.symbols = private_constants_symbols
dotnet_naming_rule.private_static_readonly_rule.import_to_resharper = as_predefined
dotnet_naming_rule.private_static_readonly_rule.severity = warning
dotnet_naming_rule.private_static_readonly_rule.style = lower_camel_case_style
dotnet_naming_rule.private_static_readonly_rule.symbols = private_static_readonly_symbols
dotnet_naming_style.all_upper_style.capitalization = all_upper
dotnet_naming_style.all_upper_style.word_separator = _
dotnet_naming_style.lower_camel_case_style.capitalization = camel_case
dotnet_naming_style.lower_camel_case_style.required_prefix = _
dotnet_naming_symbols.private_constants_symbols.applicable_accessibilities = private
dotnet_naming_symbols.private_constants_symbols.applicable_kinds = field
dotnet_naming_symbols.private_constants_symbols.required_modifiers = const
dotnet_naming_symbols.private_static_readonly_symbols.applicable_accessibilities = private
dotnet_naming_symbols.private_static_readonly_symbols.applicable_kinds = field
dotnet_naming_symbols.private_static_readonly_symbols.required_modifiers = static,readonly
dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:suggestion
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:suggestion
dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:suggestion
dotnet_style_predefined_type_for_locals_parameters_members = true:error
dotnet_style_predefined_type_for_member_access = true:error
dotnet_style_qualification_for_event = false:warning
dotnet_style_qualification_for_field = false:warning
dotnet_style_qualification_for_method = false:warning
dotnet_style_qualification_for_property = false:warning

# ReSharper properties
csharp_space_around_binary_operators = before_and_after
csharp_using_directive_placement = outside_namespace:silent
csharp_prefer_simple_using_statement = true:suggestion
csharp_style_namespace_declarations = file_scoped:none
csharp_style_namespace_declarations = file_scoped:error
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent
csharp_style_prefer_primary_constructors = true:suggestion
Expand Down Expand Up @@ -70,12 +88,117 @@ csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_prefer_not_pattern = true:suggestion
csharp_style_prefer_extended_property_pattern = true:suggestion
csharp_style_var_for_built_in_types = true:none
csharp_style_var_for_built_in_types = false:suggestion
resharper_align_first_arg_by_paren = true
resharper_align_linq_query = true
resharper_align_multiline_argument = true
resharper_align_multiline_array_and_object_initializer = true
resharper_align_multiline_binary_patterns = true
resharper_align_multiline_calls_chain = true
resharper_align_multiline_expression = true
resharper_align_multiline_extends_list = true
resharper_align_multiline_list_pattern = true
resharper_align_multiline_parameter = true
resharper_align_multiline_property_pattern = true
resharper_align_multiline_switch_expression = true
resharper_align_multiple_declaration = true
resharper_align_multline_type_parameter_constrains = true
resharper_align_multline_type_parameter_list = true
resharper_align_tuple_components = true
resharper_allow_comment_after_lbrace = true
resharper_apply_auto_detected_rules = false
resharper_apply_on_completion = true
resharper_blank_lines_after_control_transfer_statements = 1
resharper_blank_lines_around_single_line_local_method = 1
resharper_blank_lines_before_control_transfer_statements = 1
resharper_blank_lines_before_multiline_statements = 1
resharper_blank_lines_before_single_line_comment = 1
resharper_braces_redundant = true
resharper_brace_style = next_line
resharper_builtin_type_apply_to_native_integer = true
resharper_constructor_or_destructor_body = block_body
resharper_csharp_insert_final_newline = true
resharper_csharp_keep_blank_lines_in_code = 1
resharper_csharp_keep_blank_lines_in_declarations = 0
resharper_csharp_max_line_length = 160
resharper_csharp_use_indent_from_vs = false
resharper_csharp_wrap_arguments_style = chop_if_long
resharper_csharp_wrap_before_binary_opsign = true
resharper_csharp_wrap_parameters_style = chop_if_long
resharper_default_value_when_type_not_evident = default_expression
resharper_empty_block_style = together
resharper_for_built_in_types = use_var_when_evident
resharper_for_other_types = use_explicit_type
resharper_for_simple_types = use_var_when_evident
resharper_indent_anonymous_method_block = true
resharper_keep_existing_declaration_block_arrangement = false
resharper_keep_existing_embedded_block_arrangement = false
resharper_keep_existing_enum_arrangement = false
resharper_max_attribute_length_for_same_line = 60
resharper_max_enum_members_on_line = 1
resharper_max_formal_parameters_on_line = 8
resharper_max_invocation_arguments_on_line = 8
resharper_max_primary_constructor_parameters_on_line = 8
resharper_method_or_operator_body = block_body
resharper_new_line_before_while = true
resharper_null_checking_pattern_style = empty_recursive_pattern
resharper_outdent_commas = true
resharper_place_accessorholder_attribute_on_same_line = false
resharper_place_accessor_attribute_on_same_line = false
resharper_place_field_attribute_on_same_line = false
resharper_place_method_attribute_on_same_line = if_owner_is_single_line
resharper_place_simple_embedded_statement_on_same_line = false
resharper_prefer_separate_deconstructed_variables_declaration = true
resharper_space_before_checked_parentheses = true
resharper_space_before_default_parentheses = true
resharper_space_before_nameof_parentheses = true
resharper_space_before_new_parentheses = true
resharper_space_before_sizeof_parentheses = true
resharper_space_before_typeof_parentheses = true
resharper_use_heuristics_for_body_style = true
resharper_wrap_after_declaration_lpar = true
resharper_wrap_after_invocation_lpar = true
resharper_wrap_before_declaration_rpar = true
resharper_wrap_before_first_type_parameter_constraint = true
resharper_wrap_before_type_parameter_langle = true
resharper_wrap_chained_binary_patterns = chop_if_long
resharper_wrap_chained_method_calls = chop_if_long
resharper_wrap_list_pattern = chop_if_long
resharper_wrap_text = false
resharper_xmldoc_allow_far_alignment = true
resharper_xmldoc_attribute_indent = align_by_first_attribute
resharper_xmldoc_keep_user_linebreaks = false
resharper_xmldoc_linebreaks_inside_tags_for_elements_longer_than = 120
resharper_xmldoc_space_before_self_closing = false
resharper_xmldoc_use_indent_from_vs = false
resharper_xmldoc_wrap_tags_and_pi = false

# ReSharper inspection severities
resharper_arrange_accessor_owner_body_highlighting = suggestion
resharper_arrange_attributes_highlighting = suggestion
resharper_arrange_constructor_or_destructor_body_highlighting = error
resharper_arrange_default_value_when_type_not_evident_highlighting = suggestion
resharper_arrange_local_function_body_highlighting = warning
resharper_arrange_method_or_operator_body_highlighting = hint
resharper_arrange_null_checking_pattern_highlighting = error
resharper_arrange_object_creation_when_type_not_evident_highlighting = warning
resharper_arrange_redundant_parentheses_highlighting = warning
resharper_arrange_static_member_qualifier_highlighting = warning
resharper_enforce_do_while_statement_braces_highlighting = error
resharper_enforce_fixed_statement_braces_highlighting = error
resharper_enforce_foreach_statement_braces_highlighting = error
resharper_enforce_for_statement_braces_highlighting = error
resharper_enforce_if_statement_braces_highlighting = error
resharper_enforce_lock_statement_braces_highlighting = error
resharper_enforce_using_statement_braces_highlighting = error
resharper_enforce_while_statement_braces_highlighting = error
resharper_suggest_var_or_type_built_in_types_highlighting = hint
resharper_suggest_var_or_type_elsewhere_highlighting = suggestion
resharper_suggest_var_or_type_simple_types_highlighting = hint
csharp_space_before_open_square_brackets = true

[*.{cs,vb}]
dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 8
indent_size = 8
end_of_line = crlf
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
Expand Down Expand Up @@ -155,3 +278,18 @@ dotnet_style_qualification_for_field = false:silent
dotnet_style_qualification_for_property = false:silent
dotnet_style_qualification_for_method = false:silent
dotnet_style_qualification_for_event = false:silent

[*.{cshtml,htm,html,razor}]
indent_style = tab
indent_size = tab
tab_width = 4

[*.{asax,ascx,aspx,axaml,cs,master,paml,skin,vb,xaml,xamlx,xoml}]
indent_style = space
indent_size = 4
tab_width = 4

[*.{appxmanifest,axml,build,config,csproj,dbml,discomap,dtd,jsproj,lsproj,njsproj,nuspec,proj,props,resw,resx,StyleCop,targets,tasks,vbproj,xml,xsd}]
indent_style = space
indent_size = 2
tab_width = 2
124 changes: 66 additions & 58 deletions Example/Example.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,70 +3,78 @@

// A simple Terminal.Gui example in C# - using C# 9.0 Top-level statements

using System;
tig marked this conversation as resolved.
Show resolved Hide resolved
using Terminal.Gui;

Application.Run<ExampleWindow> ();

System.Console.WriteLine ($"Username: {((ExampleWindow)Application.Top).usernameText.Text}");
Console.WriteLine ($"Username: {((ExampleWindow)Application.Top).UserNameText.Text}");

// Before the application exits, reset Terminal.Gui for clean shutdown
Application.Shutdown ();

// Defines a top-level window with border and title
public class ExampleWindow : Window {
public TextField usernameText;

public ExampleWindow ()
{
Title = $"Example App ({Application.QuitKey} to quit)";

// Create input components and labels
var usernameLabel = new Label () {
Text = "Username:"
};

usernameText = new TextField ("") {
// Position text field adjacent to the label
X = Pos.Right (usernameLabel) + 1,

// Fill remaining horizontal space
Width = Dim.Fill (),
};

var passwordLabel = new Label () {
Text = "Password:",
X = Pos.Left (usernameLabel),
Y = Pos.Bottom (usernameLabel) + 1
};

var passwordText = new TextField ("") {
Secret = true,
// align with the text box above
X = Pos.Left (usernameText),
Y = Pos.Top (passwordLabel),
Width = Dim.Fill (),
};

// Create login button
var btnLogin = new Button () {
Text = "Login",
Y = Pos.Bottom(passwordLabel) + 1,
// center the login button horizontally
X = Pos.Center (),
IsDefault = true,
};

// When login button is clicked display a message popup
btnLogin.Clicked += (s,e) => {
if (usernameText.Text == "admin" && passwordText.Text == "password") {
MessageBox.Query ("Logging In", "Login Successful", "Ok");
Application.RequestStop ();
} else {
MessageBox.ErrorQuery ("Logging In", "Incorrect username or password", "Ok");
}
};

// Add the views to the Window
Add (usernameLabel, usernameText, passwordLabel, passwordText, btnLogin);
}
}
public class ExampleWindow : Window
{
public TextField UserNameText;

public ExampleWindow ()
{
Title = $"Example App ({Application.QuitKey} to quit)";

// Create input components and labels
var usernameLabel = new Label { Text = "Username:" };

UserNameText = new TextField
{
// Position text field adjacent to the label
X = Pos.Right (usernameLabel) + 1,

// Fill remaining horizontal space
Width = Dim.Fill ()
};

var passwordLabel = new Label
{
Text = "Password:", X = Pos.Left (usernameLabel), Y = Pos.Bottom (usernameLabel) + 1
};

var passwordText = new TextField
{
Secret = true,

// align with the text box above
X = Pos.Left (UserNameText),
Y = Pos.Top (passwordLabel),
Width = Dim.Fill ()
};

// Create login button
var btnLogin = new Button
{
Text = "Login",
Y = Pos.Bottom (passwordLabel) + 1,

// center the login button horizontally
X = Pos.Center (),
IsDefault = true
};

// When login button is clicked display a message popup
btnLogin.Clicked += (s, e) =>
{
if (UserNameText.Text == "admin" && passwordText.Text == "password")
{
MessageBox.Query ("Logging In", "Login Successful", "Ok");
Application.RequestStop ();
}
else
{
MessageBox.ErrorQuery ("Logging In", "Incorrect username or password", "Ok");
}
};

// Add the views to the Window
Add (usernameLabel, UserNameText, passwordLabel, passwordText, btnLogin);
}
}
Loading
Loading