Skip to content

Commit 14a9830

Browse files
authored
Task 1: Initial port of most of IX.StandardExtensions into IX.Core. (#7)
* Brought in most of the standard code, sans extensions. * Imported collection extensions. * Fixed build bug, removed obsolete stuff, arranged some code.
1 parent b60acfb commit 14a9830

File tree

389 files changed

+97090
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

389 files changed

+97090
-0
lines changed

.editorconfig

Lines changed: 331 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,331 @@
1+
root = true
2+
# Further info at: http://EditorConfig.org
3+
4+
# Top-most EditorConfig file
5+
6+
# ===================
7+
# == GENERAL STYLE ==
8+
# ===================
9+
[*]
10+
indent_style = space
11+
charset = utf-8
12+
insert_final_newline = false
13+
trim_trailing_whitespace = true
14+
15+
# ReSharper properties
16+
resharper_align_linq_query = true
17+
resharper_align_multiline_calls_chain = true
18+
resharper_align_multiline_extends_list = true
19+
resharper_align_multiline_for_stmt = true
20+
resharper_blank_lines_after_control_transfer_statements = 1
21+
resharper_blank_lines_before_block_statements = 1
22+
resharper_braces_for_dowhile = required_for_multiline
23+
resharper_braces_for_fixed = required_for_multiline
24+
resharper_braces_for_for = required_for_multiline
25+
resharper_braces_for_foreach = required_for_multiline
26+
resharper_braces_for_ifelse = required_for_multiline
27+
resharper_braces_for_lock = required_for_multiline
28+
resharper_braces_for_using = required_for_multiline
29+
resharper_braces_for_while = required_for_multiline
30+
resharper_braces_redundant = true
31+
resharper_csharp_align_multiline_parameter = true
32+
resharper_csharp_align_multiple_declaration = true
33+
resharper_csharp_new_line_before_while = true
34+
resharper_csharp_wrap_after_declaration_lpar = true
35+
resharper_csharp_wrap_after_invocation_lpar = true
36+
resharper_csharp_wrap_chained_binary_expressions = wrap_if_long
37+
resharper_csharp_wrap_parameters_style = chop_if_long
38+
resharper_force_attribute_style = separate
39+
resharper_indent_preprocessor_if = no_indent
40+
resharper_indent_preprocessor_region = no_indent
41+
resharper_instance_members_qualify_declared_in =
42+
resharper_keep_existing_declaration_parens_arrangement = false
43+
resharper_keep_existing_linebreaks = false
44+
resharper_local_function_body = expression_body
45+
resharper_max_array_initializer_elements_on_line = 1
46+
resharper_max_enum_members_on_line = 1
47+
resharper_max_formal_parameters_on_line = 1
48+
resharper_max_initializer_elements_on_line = 1
49+
resharper_max_invocation_arguments_on_line = 1
50+
resharper_outdent_statement_labels = true
51+
resharper_place_constructor_initializer_on_same_line = false
52+
resharper_place_field_attribute_on_same_line = False
53+
resharper_place_linq_into_on_new_line = false
54+
resharper_place_simple_case_statement_on_same_line = if_owner_is_single_line
55+
resharper_place_simple_embedded_statement_on_same_line = if_owner_is_single_line
56+
resharper_place_type_constraints_on_same_line = false
57+
resharper_space_within_single_line_array_initializer_braces = true
58+
resharper_static_members_qualify_with = current_type
59+
resharper_wrap_before_first_type_parameter_constraint = true
60+
61+
# ReSharper inspection severities
62+
resharper_arrange_attributes_highlighting = suggestion
63+
resharper_arrange_default_value_when_type_evident_highlighting = warning
64+
resharper_arrange_default_value_when_type_not_evident_highlighting = suggestion
65+
resharper_arrange_local_function_body_highlighting = suggestion
66+
resharper_built_in_type_reference_style_for_member_access_highlighting = hint
67+
resharper_enforce_do_while_statement_braces_highlighting = warning
68+
resharper_enforce_fixed_statement_braces_highlighting = warning
69+
resharper_enforce_foreach_statement_braces_highlighting = warning
70+
resharper_enforce_for_statement_braces_highlighting = warning
71+
resharper_enforce_if_statement_braces_highlighting = warning
72+
resharper_enforce_lock_statement_braces_highlighting = warning
73+
resharper_enforce_using_statement_braces_highlighting = warning
74+
resharper_enforce_while_statement_braces_highlighting = warning
75+
resharper_remove_redundant_braces_highlighting = warning
76+
resharper_suggest_discard_declaration_var_style_highlighting = suggestion
77+
resharper_switch_statement_missing_some_cases_highlighting = none
78+
resharper_tabs_are_disallowed_highlighting = warning
79+
resharper_unnecessary_whitespace_highlighting = warning
80+
81+
# Microsoft .NET properties
82+
csharp_style_var_elsewhere = false:suggestion
83+
csharp_style_var_for_built_in_types = true:suggestion
84+
csharp_style_var_when_type_is_apparent = true:suggestion
85+
dotnet_separate_import_directive_groups = true
86+
dotnet_style_predefined_type_for_member_access = true:suggestion
87+
dotnet_style_qualification_for_event = false:suggestion
88+
dotnet_style_qualification_for_field = false:suggestion
89+
dotnet_style_qualification_for_method = false:suggestion
90+
dotnet_style_qualification_for_property = false:suggestion
91+
92+
# ==================
93+
# == INDENT SIZES ==
94+
# ==================
95+
96+
# Code files
97+
[*.{cs,csx,vb,vbx}]
98+
indent_size = 4
99+
100+
# Xml project files
101+
[*.{csproj,proj,projitems}]
102+
indent_size = 2
103+
104+
# Xml config files
105+
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
106+
indent_size = 2
107+
108+
# JSON files
109+
[*.json]
110+
indent_size = 2
111+
112+
# ===================
113+
# == DOTNET STYLES ==
114+
# ===================
115+
116+
[*.{cs,vb}]
117+
# Sort using directives with System.* first
118+
dotnet_sort_system_directives_first = true:silent
119+
120+
# Parentheses preferences
121+
dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:suggestion
122+
dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:suggestion
123+
dotnet_style_parentheses_in_other_binary_operators = never_if_unnecessary:suggestion
124+
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:suggestion
125+
126+
# Use language keywords instead of framework type names for type references
127+
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
128+
dotnet_style_predefined_type_for_member_access = true:warning
129+
130+
# Modifiers
131+
csharp_preferred_modifier_order = public, protected, internal, private, static, readonly, new, abstract, virtual, sealed, override, extern, unsafe, volatile, async:suggestion
132+
dotnet_style_require_accessibility_modifiers = always:warning
133+
dotnet_style_readonly_field = true:suggestion
134+
135+
# Suggest more modern language features whenever available
136+
dotnet_style_object_initializer = true:suggestion
137+
dotnet_style_collection_initializer = true:suggestion
138+
dotnet_style_coalesce_expression = true:suggestion
139+
dotnet_style_null_propagation = true:suggestion
140+
dotnet_style_explicit_tuple_names = true:suggestion
141+
dotnet_style_prefer_inferred_tuple_names = true:suggestion
142+
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
143+
dotnet_style_prefer_auto_properties = true:suggestion
144+
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
145+
dotnet_style_prefer_conditional_expression_over_return = true:suggestion
146+
147+
# Null checks
148+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
149+
150+
# ===============
151+
# == C# STYLES ==
152+
# ===============
153+
154+
# Prefer "var" everywhere where it's obvious that it should be used
155+
[*.cs]
156+
csharp_style_var_for_built_in_types = true:suggestion
157+
csharp_style_var_when_type_is_apparent = true:suggestion
158+
csharp_style_var_elsewhere = false:silent
159+
160+
# Prefer methods to have expression bodies
161+
csharp_style_expression_bodied_methods = true:suggestion
162+
csharp_style_expression_bodied_operators = true:suggestion
163+
164+
# Prefer constructors to have block bodies
165+
csharp_style_expression_bodied_constructors = true:suggestion
166+
167+
# Prefer properties to have an expression-body
168+
csharp_style_expression_bodied_properties = true:suggestion
169+
csharp_style_expression_bodied_indexers = true:suggestion
170+
csharp_style_expression_bodied_accessors = true:suggestion
171+
172+
# Prefer pattern matching where available
173+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
174+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
175+
176+
# Prefer inlined variable declarations
177+
csharp_style_inlined_variable_declaration = true:suggestion
178+
179+
# Prefer simple "default"
180+
csharp_prefer_simple_default_expression = true:warning
181+
182+
# Prefer heavy tuple deconstruction
183+
csharp_style_deconstructed_variable_declaration = true:suggestion
184+
185+
# Prefer local functions over anonymous ones
186+
csharp_style_pattern_local_over_anonymous_function = true:warning
187+
188+
# Prefer throw expressions
189+
csharp_style_throw_expression = true:suggestion
190+
191+
# Prefer conditional delegate call
192+
csharp_style_conditional_delegate_call = true:suggestion
193+
194+
# Prefer braces when multiline
195+
csharp_prefer_braces = false:silent
196+
197+
# Space preferences
198+
csharp_space_after_cast = false:silent
199+
csharp_space_after_keywords_in_control_flow_statements = true:silent
200+
csharp_space_between_method_call_parameter_list_parentheses = false:silent
201+
csharp_space_between_method_declaration_parameter_list_parentheses = false:silent
202+
csharp_space_between_parentheses = false:silent
203+
csharp_space_before_colon_in_inheritance_clause = true:silent
204+
csharp_space_after_colon_in_inheritance_clause = true:silent
205+
csharp_space_around_binary_operators = before_and_after
206+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false:silent
207+
csharp_space_between_method_call_name_and_opening_parenthesis = false:silent
208+
csharp_space_between_method_call_empty_parameter_list_parentheses = false:silent
209+
210+
# New line preferences
211+
#csharp_new_line_before_open_brace = accessors,anonymous_methods,anonymous_types,control_blocks,events,indexers,lambdas,local_functions,methods,properties,types:silent - this does not play nice with R#
212+
csharp_new_line_before_else = true:silent
213+
csharp_new_line_before_catch = true:silent
214+
csharp_new_line_before_finally = true:silent
215+
csharp_new_line_before_members_in_object_initializers = true:silent
216+
csharp_new_line_before_members_in_anonymous_types = true:silent
217+
csharp_new_line_between_query_expression_clauses = true:silent
218+
219+
# Indentation preferences
220+
csharp_indent_case_contents = true:silent
221+
csharp_indent_switch_labels = true:silent
222+
csharp_indent_labels = no_change
223+
224+
225+
# Wrapping preferences
226+
csharp_preserve_single_line_statements = false:silent
227+
csharp_preserve_single_line_blocks = false:silent
228+
csharp_using_directive_placement = outside_namespace:warning
229+
csharp_prefer_simple_using_statement = true:suggestion
230+
csharp_style_namespace_declarations = file_scoped:suggestion
231+
csharp_style_expression_bodied_lambdas = true:suggestion
232+
csharp_style_expression_bodied_local_functions = false:silent
233+
csharp_style_prefer_null_check_over_type_check = true:suggestion
234+
csharp_style_prefer_local_over_anonymous_function = true:suggestion
235+
csharp_style_prefer_index_operator = true:suggestion
236+
csharp_style_prefer_range_operator = true:suggestion
237+
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
238+
csharp_style_prefer_tuple_swap = true:suggestion
239+
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
240+
csharp_style_unused_value_expression_statement_preference = discard_variable:suggestion
241+
csharp_prefer_static_local_function = true:suggestion
242+
csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent
243+
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true:silent
244+
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:silent
245+
csharp_style_prefer_switch_expression = true:suggestion
246+
csharp_style_prefer_pattern_matching = true:suggestion
247+
csharp_style_prefer_not_pattern = true:suggestion
248+
csharp_style_prefer_extended_property_pattern = true:suggestion
249+
csharp_style_prefer_method_group_conversion = true:silent
250+
csharp_indent_block_contents = true
251+
csharp_style_prefer_parameter_null_checking = true:suggestion
252+
253+
# ===============
254+
# == VB STYLES ==
255+
# ===============
256+
257+
[*.vb]
258+
# Modifier preferences
259+
visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion
260+
261+
[*.proto]
262+
indent_style = tab
263+
indent_size = tab
264+
tab_width = 4
265+
266+
[*.{asax,ascx,aspx,cs,cshtml,css,htm,html,js,jsx,master,razor,skin,ts,tsx,vb,xaml,xamlx,xoml}]
267+
indent_style = space
268+
indent_size = 4
269+
tab_width = 4
270+
dotnet_style_operator_placement_when_wrapping = beginning_of_line
271+
end_of_line = crlf
272+
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
273+
dotnet_style_prefer_compound_assignment = true:suggestion
274+
dotnet_style_prefer_simplified_interpolation = true:suggestion
275+
dotnet_style_namespace_match_folder = true:suggestion
276+
277+
[*.{appxmanifest,build,config,csproj,dbml,discomap,dtd,json,jsproj,lsproj,njsproj,nuspec,proj,props,resjson,resw,resx,StyleCop,targets,tasks,vbproj,xml,xsd}]
278+
indent_style = space
279+
indent_size = 2
280+
tab_width = 2
281+
282+
[*.{cs,vb}]
283+
#### Naming styles ####
284+
285+
# Naming rules
286+
287+
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
288+
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
289+
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
290+
291+
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
292+
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
293+
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
294+
295+
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
296+
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
297+
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
298+
299+
# Symbol specifications
300+
301+
dotnet_naming_symbols.interface.applicable_kinds = interface
302+
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
303+
dotnet_naming_symbols.interface.required_modifiers =
304+
305+
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
306+
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
307+
dotnet_naming_symbols.types.required_modifiers =
308+
309+
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
310+
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
311+
dotnet_naming_symbols.non_field_members.required_modifiers =
312+
313+
# Naming styles
314+
315+
dotnet_naming_style.begins_with_i.required_prefix = I
316+
dotnet_naming_style.begins_with_i.required_suffix =
317+
dotnet_naming_style.begins_with_i.word_separator =
318+
dotnet_naming_style.begins_with_i.capitalization = pascal_case
319+
320+
dotnet_naming_style.pascal_case.required_prefix =
321+
dotnet_naming_style.pascal_case.required_suffix =
322+
dotnet_naming_style.pascal_case.word_separator =
323+
dotnet_naming_style.pascal_case.capitalization = pascal_case
324+
325+
dotnet_naming_style.pascal_case.required_prefix =
326+
dotnet_naming_style.pascal_case.required_suffix =
327+
dotnet_naming_style.pascal_case.word_separator =
328+
dotnet_naming_style.pascal_case.capitalization = pascal_case
329+
dotnet_style_allow_statement_immediately_after_block_experimental = false:suggestion
330+
dotnet_style_allow_multiple_blank_lines_experimental = false:warning
331+
dotnet_code_quality_unused_parameters = all:warning
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using System.Diagnostics.CodeAnalysis;
2+
3+
// Heap allocations analyzer will show just about every allocation possible as a warning
4+
[assembly: SuppressMessage("Performance", "HAA0504:Implicit new array creation allocation", Justification = "Explicit array creation is usually an intended phenomenon, for now let's ignore.", Scope = "module")]
5+
[assembly: SuppressMessage("Performance", "HAA0502:Explicit new reference type allocation", Justification = "Explicit new allocations will only be optimizable in the future.", Scope = "module")]
6+
[assembly: SuppressMessage("Performance", "HAA0101:Array allocation for params parameter", Justification = "So params allocates an empty array anytime. So what? It's not like I have a choice.", Scope = "module")]
7+
[assembly: SuppressMessage("Performance", "HAA0501:Explicit new array type allocation", Justification = "Explicit array creation will be refactored at a later time, wherever necessary.", Scope = "module")]
8+
[assembly: SuppressMessage("Performance", "HAA0505:Initializer reference type allocation", Justification = "Explicit collection creation by initializer is usually an intended phenomenon, for now let's ignore.", Scope = "module")]
9+
[assembly: SuppressMessage("Performance", "HAA0503:Explicit new anonymous object allocation", Justification = "LINQ works that way, it is rare enough to be of little impact anyway.", Scope = "module")]

Common/Resources/icon.png

4.68 KB
Loading

Common/Templates/NumericTypes.tt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<#
2+
Type[] types = new Type[]
3+
{
4+
typeof(byte),
5+
typeof(sbyte),
6+
typeof(short),
7+
typeof(ushort),
8+
typeof(char),
9+
typeof(int),
10+
typeof(uint),
11+
typeof(long),
12+
typeof(ulong),
13+
typeof(float),
14+
typeof(double),
15+
typeof(decimal),
16+
};
17+
#>
18+
<#+
19+
bool IsTypeUnsigned(Type type)
20+
{
21+
return (type == typeof(byte) || type == typeof(ushort) || type == typeof(uint) || type == typeof(ulong) || type == typeof(char));
22+
}
23+
#>

Common/Templates/StandardTypes.tt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<#
2+
Type[] types = new Type[]
3+
{
4+
typeof(byte),
5+
typeof(sbyte),
6+
typeof(short),
7+
typeof(ushort),
8+
typeof(char),
9+
typeof(int),
10+
typeof(uint),
11+
typeof(long),
12+
typeof(ulong),
13+
typeof(float),
14+
typeof(double),
15+
typeof(decimal),
16+
typeof(DateTime),
17+
typeof(bool),
18+
typeof(TimeSpan),
19+
typeof(string),
20+
typeof(byte[]),
21+
};
22+
#>

0 commit comments

Comments
 (0)