Skip to content

Commit b42e66e

Browse files
committed
Initial version
1 parent 3aefd71 commit b42e66e

File tree

777 files changed

+59252
-3
lines changed

Some content is hidden

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

777 files changed

+59252
-3
lines changed

.editorconfig

+134
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# http://EditorConfig.org
2+
3+
# This file is the top-most EditorConfig file
4+
root = true
5+
6+
# All Files
7+
[*]
8+
charset = utf-8
9+
end_of_line = crlf
10+
indent_style = space
11+
indent_size = 4
12+
insert_final_newline = false
13+
trim_trailing_whitespace = true
14+
15+
# Solution Files
16+
[*.sln]
17+
indent_style = tab
18+
19+
# XML Project Files
20+
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
21+
indent_size = 2
22+
23+
# Configuration Files
24+
[*.{json,xml,props,targets,nuspec,resx,ruleset,config,yml}]
25+
indent_size = 2
26+
27+
# Markdown Files
28+
[*.md]
29+
trim_trailing_whitespace = false
30+
31+
# Web Files
32+
[*.{htm,html,js,ts,css,scss}]
33+
indent_size = 2
34+
insert_final_newline = true
35+
36+
# Bash Files
37+
[*.sh]
38+
end_of_line = lf
39+
40+
# Dotnet Code Style Settings (See https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference)
41+
[*.{cs,vb}]
42+
dotnet_sort_system_directives_first = true:warning
43+
dotnet_style_coalesce_expression = true:warning
44+
dotnet_style_collection_initializer = true:warning
45+
dotnet_style_explicit_tuple_names = true:warning
46+
dotnet_style_null_propagation = true:warning
47+
dotnet_style_object_initializer = true:warning
48+
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
49+
dotnet_style_predefined_type_for_member_access = true:warning
50+
dotnet_style_qualification_for_event = true:warning
51+
dotnet_style_qualification_for_field = true:warning
52+
dotnet_style_qualification_for_method = true:warning
53+
dotnet_style_qualification_for_property = true:warning
54+
55+
# C# Code Style Settings (See https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference)
56+
[*.cs]
57+
# Indentation Options (Undocumented)
58+
csharp_indent_block_contents = true:warning
59+
csharp_indent_braces = false:warning
60+
csharp_indent_case_contents = true:warning
61+
csharp_indent_switch_labels = true:warning
62+
csharp_indent_labels = no_change:warning
63+
# Style Options
64+
csharp_style_conditional_delegate_call = true:warning
65+
csharp_style_expression_bodied_accessors = true:warning
66+
csharp_style_expression_bodied_constructors = true:warning
67+
csharp_style_expression_bodied_indexers = true:warning
68+
csharp_style_expression_bodied_methods = true:warning
69+
csharp_style_expression_bodied_operators = true:warning
70+
csharp_style_expression_bodied_properties = true:warning
71+
csharp_style_inlined_variable_declaration = true:warning
72+
csharp_style_pattern_matching_over_as_with_null_check = true:warning
73+
csharp_style_pattern_matching_over_is_with_cast_check = true:warning
74+
csharp_style_throw_expression = true:warning
75+
csharp_style_var_elsewhere = true:warning
76+
csharp_style_var_for_built_in_types = true:warning
77+
csharp_style_var_when_type_is_apparent = true:warning
78+
# New Line Options
79+
csharp_new_line_before_catch = true:warning
80+
csharp_new_line_before_else = true:warning
81+
csharp_new_line_before_finally = true:warning
82+
csharp_new_line_before_members_in_anonymous_types = true:warning
83+
csharp_new_line_before_members_in_object_initializers = true:warning
84+
# BUG: Warning level cannot be set https://github.com/dotnet/roslyn/issues/18010
85+
csharp_new_line_before_open_brace = all
86+
csharp_new_line_between_query_expression_clauses = true:warning
87+
# Spacing Options (Undocumented)
88+
csharp_space_after_cast = false:warning
89+
csharp_space_after_colon_in_inheritance_clause = true:warning
90+
csharp_space_after_comma = true:warning
91+
csharp_space_after_dot = false:warning
92+
csharp_space_after_keywords_in_control_flow_statements = true:warning
93+
csharp_space_after_semicolon_in_for_statement = true:warning
94+
csharp_space_around_binary_operators = before_and_after:warning
95+
csharp_space_around_declaration_statements = do_not_ignore:warning
96+
csharp_space_before_colon_in_inheritance_clause = true:warning
97+
csharp_space_before_comma = false:warning
98+
csharp_space_before_dot = false:warning
99+
csharp_space_before_semicolon_in_for_statement = false:warning
100+
csharp_space_before_open_square_brackets = false:warning
101+
csharp_space_between_empty_square_brackets = false:warning
102+
csharp_space_between_method_declaration_name_and_open_parenthesis = false:warning
103+
csharp_space_between_method_declaration_parameter_list_parentheses = false:warning
104+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false:warning
105+
csharp_space_between_method_call_name_and_opening_parenthesis = false:warning
106+
csharp_space_between_method_call_parameter_list_parentheses = false:warning
107+
csharp_space_between_method_call_empty_parameter_list_parentheses = false:warning
108+
csharp_space_between_square_brackets = false:warning
109+
csharp_space_between_parentheses = expressions:warning
110+
# Wrapping Options (Undocumented)
111+
csharp_preserve_single_line_blocks = true:warning
112+
csharp_preserve_single_line_statements = false:warning
113+
# Naming Rules (Undocumented)
114+
# Constant Fields Should Be PascalCase
115+
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = warning
116+
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
117+
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
118+
dotnet_naming_symbols.constant_fields.applicable_kinds = field
119+
dotnet_naming_symbols.constant_fields.required_modifiers = const
120+
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
121+
# Public Members Must Be Capitalized
122+
# dotnet_naming_rule.public_members_must_be_capitalized.severity = warning
123+
# dotnet_naming_rule.public_members_must_be_capitalized.symbols = public_symbols
124+
# dotnet_naming_rule.public_members_must_be_capitalized.style = first_word_upper_case_style
125+
# dotnet_naming_symbols.public_symbols.applicable_kinds = property,method,field,event,delegate
126+
# dotnet_naming_symbols.public_symbols.required_modifiers = public,internal,protected,protected_internal
127+
# dotnet_naming_style.first_word_upper_case_style.capitalization = first_word_upper
128+
# Private, Protected and Internal Fields Should Be camelCase
129+
# dotnet_naming_rule.camel_case_for_private_internal_fields.severity = warning
130+
# dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields
131+
# dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
132+
# dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
133+
# dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, protected, internal
134+
# dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Ignore Visual Studio temporary files, build results, and
1+
## Ignore Visual Studio temporary files, build results, and
22
## files generated by popular Visual Studio add-ons.
33
##
44
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
@@ -286,3 +286,5 @@ __pycache__/
286286
*.btm.cs
287287
*.odx.cs
288288
*.xsd.cs
289+
290+
tools/

.travis.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Travis CI documentation https://docs.travis-ci.com/
2+
3+
language: csharp
4+
os:
5+
- linux
6+
- osx
7+
8+
# .NET CLI require Ubuntu 14.04
9+
sudo: required
10+
dist: trusty
11+
addons:
12+
apt:
13+
packages:
14+
- gettext
15+
- libcurl4-openssl-dev
16+
- libicu-dev
17+
- libssl-dev
18+
- libunwind8
19+
- zlib1g
20+
21+
# .NET CLI requires OSX 10.11
22+
osx_image: xcode7.2
23+
24+
# Ensure that .NET Core is installed
25+
dotnet: 1.0.1
26+
# Ensure Mono is installed
27+
mono: latest
28+
29+
env:
30+
# Set the DOTNET_SKIP_FIRST_TIME_EXPERIENCE environment variable to stop wasting time caching packages
31+
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true
32+
# Disable sending usage data to Microsoft
33+
- DOTNET_CLI_TELEMETRY_OPTOUT=true
34+
35+
# You must run the following command for Travis to be able to have permissions to execute the shell script below
36+
# git update-index --chmod=+x build.sh
37+
script:
38+
# Skip running tests due to tooling bug https://github.com/dotnet/cli/issues/3073
39+
- ./build.sh --target Test

CONTRIBUTING.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# All contributions, however small are valued!
2+
3+
# Steps to contribute
4+
5+
If you want to make If it's a small change, go ahead and raise a PR, otherwise follow these steps:
6+
7+
1. View the [Projects](https://github.com/RehanSaeed/Schema.NET/projects) page to see a To-Do list of things to be implemented.
8+
2. Raise an issue or comment on an existing issue with what you want to contribute.
9+
3. When you get the go ahead, follow the coding guidelines and raise a PR.
10+
11+
# Coding Guidelines
12+
13+
- Projects use StyleCop to produce style warnings. Please fix all warnings in any code you submit.
14+
- Write unit tests for any code written.
15+
16+
# Special Thanks
17+
18+
As thanks for all contributions, your username will be posted to the front page of the project with a short description of how you helped.

Key.snk

596 Bytes
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<RuleSet Name="Rules for ClassLibrary1" Description="Code analysis rules for ClassLibrary1.csproj." ToolsVersion="14.0">
3+
<Rules AnalyzerId="Microsoft.Analyzers.ManagedCodeAnalysis" RuleNamespace="Microsoft.Rules.Managed">
4+
<Rule Id="CA1001" Action="Warning" />
5+
<Rule Id="CA1009" Action="Warning" />
6+
<Rule Id="CA1016" Action="Warning" />
7+
<Rule Id="CA1033" Action="Warning" />
8+
<Rule Id="CA1049" Action="Warning" />
9+
<Rule Id="CA1060" Action="Warning" />
10+
<Rule Id="CA1061" Action="Warning" />
11+
<Rule Id="CA1063" Action="Warning" />
12+
<Rule Id="CA1065" Action="Warning" />
13+
<Rule Id="CA1301" Action="Warning" />
14+
<Rule Id="CA1400" Action="Warning" />
15+
<Rule Id="CA1401" Action="Warning" />
16+
<Rule Id="CA1403" Action="Warning" />
17+
<Rule Id="CA1404" Action="Warning" />
18+
<Rule Id="CA1405" Action="Warning" />
19+
<Rule Id="CA1410" Action="Warning" />
20+
<Rule Id="CA1415" Action="Warning" />
21+
<Rule Id="CA1821" Action="Warning" />
22+
<Rule Id="CA1900" Action="Warning" />
23+
<Rule Id="CA1901" Action="Warning" />
24+
<Rule Id="CA2002" Action="Warning" />
25+
<Rule Id="CA2100" Action="Warning" />
26+
<Rule Id="CA2101" Action="Warning" />
27+
<Rule Id="CA2108" Action="Warning" />
28+
<Rule Id="CA2111" Action="Warning" />
29+
<Rule Id="CA2112" Action="Warning" />
30+
<Rule Id="CA2114" Action="Warning" />
31+
<Rule Id="CA2116" Action="Warning" />
32+
<Rule Id="CA2117" Action="Warning" />
33+
<Rule Id="CA2122" Action="Warning" />
34+
<Rule Id="CA2123" Action="Warning" />
35+
<Rule Id="CA2124" Action="Warning" />
36+
<Rule Id="CA2126" Action="Warning" />
37+
<Rule Id="CA2131" Action="Warning" />
38+
<Rule Id="CA2132" Action="Warning" />
39+
<Rule Id="CA2133" Action="Warning" />
40+
<Rule Id="CA2134" Action="Warning" />
41+
<Rule Id="CA2137" Action="Warning" />
42+
<Rule Id="CA2138" Action="Warning" />
43+
<Rule Id="CA2140" Action="Warning" />
44+
<Rule Id="CA2141" Action="Warning" />
45+
<Rule Id="CA2146" Action="Warning" />
46+
<Rule Id="CA2147" Action="Warning" />
47+
<Rule Id="CA2149" Action="Warning" />
48+
<Rule Id="CA2200" Action="Warning" />
49+
<Rule Id="CA2202" Action="Warning" />
50+
<Rule Id="CA2207" Action="Warning" />
51+
<Rule Id="CA2212" Action="Warning" />
52+
<Rule Id="CA2213" Action="Warning" />
53+
<Rule Id="CA2214" Action="Warning" />
54+
<Rule Id="CA2216" Action="Warning" />
55+
<Rule Id="CA2220" Action="Warning" />
56+
<Rule Id="CA2229" Action="Warning" />
57+
<Rule Id="CA2231" Action="Warning" />
58+
<Rule Id="CA2232" Action="Warning" />
59+
<Rule Id="CA2235" Action="Warning" />
60+
<Rule Id="CA2236" Action="Warning" />
61+
<Rule Id="CA2237" Action="Warning" />
62+
<Rule Id="CA2238" Action="Warning" />
63+
<Rule Id="CA2240" Action="Warning" />
64+
<Rule Id="CA2241" Action="Warning" />
65+
<Rule Id="CA2242" Action="Warning" />
66+
</Rules>
67+
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
68+
<Rule Id="SA1600" Action="None" />
69+
<Rule Id="SA1601" Action="None" />
70+
<Rule Id="SA1602" Action="None" />
71+
<Rule Id="SA1623" Action="None" />
72+
<Rule Id="SA1633" Action="None" />
73+
<Rule Id="SA1634" Action="None" />
74+
<Rule Id="SA1635" Action="None" />
75+
<Rule Id="SA1636" Action="None" />
76+
<Rule Id="SA1637" Action="None" />
77+
<Rule Id="SA1638" Action="None" />
78+
<Rule Id="SA1640" Action="None" />
79+
<Rule Id="SA1641" Action="None" />
80+
<Rule Id="SA1652" Action="None" />
81+
</Rules>
82+
</RuleSet>

README.md

+16-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,16 @@
1-
# Schema.NET
2-
Schema.org turned into strongly typed C# classes for use in .NET
1+
![Schema.NET Banner](https://raw.githubusercontent.com/RehanSaeed/Schema.NET/master/Images/Banner.png)
2+
3+
Schema.org turned into strongly typed C# classes for use in .NET.
4+
5+
## Continuous Integration
6+
7+
| Name | Operating System | Status |
8+
| :--- | :--- | :--- |
9+
| AppVeyor | Windows | [![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/aknwu9sil3dv3im0?svg=true)](https://ci.appveyor.com/project/RehanSaeed/Schema.NET) |
10+
| Travis CI | Linux & Mac | [![Travis CI Build Status](https://img.shields.io/travis/RehanSaeed/Schema.NET.svg?maxAge=3600&label=travis)](https://travis-ci.org/RehanSaeed/Schema.NET) |
11+
12+
## NuGet Packages
13+
14+
| Name | NuGet | MyGet |
15+
| :--- | :--- | :--- |
16+
| [Schema.NET](https://www.nuget.org/packages/Schema.NET/) | [![Schema.NET NuGet Package](https://img.shields.io/nuget/v/Schema.NET.svg)](https://www.nuget.org/packages/Schema.NET) | [![Schema.NET MyGet Package](https://img.shields.io/myget/rehansaeed/v/Schema.NET.svg)](http://myget.org/gallery/Schema.NET) |

Schema.NET.sln

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.26430.6
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Source", "Source", "{719809C2-A551-4C4A-9EFD-B10FB5E35BC0}"
7+
EndProject
8+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F20E2797-D1E3-4321-91BB-FAE54954D2A0}"
9+
ProjectSection(SolutionItems) = preProject
10+
.editorconfig = .editorconfig
11+
.gitignore = .gitignore
12+
.travis.yml = .travis.yml
13+
appveyor.yml = appveyor.yml
14+
build.cake = build.cake
15+
build.ps1 = build.ps1
16+
build.sh = build.sh
17+
Key.snk = Key.snk
18+
LICENSE = LICENSE
19+
MinimumRecommendedRulesWithStyleCop.ruleset = MinimumRecommendedRulesWithStyleCop.ruleset
20+
EndProjectSection
21+
EndProject
22+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Schema.NET.Tool", "Source\Schema.NET.Tool\Schema.NET.Tool.csproj", "{3CED3D1A-AB36-4B39-86DC-910BF8237DE9}"
23+
EndProject
24+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Schema.NET", "Source\Schema.NET\Schema.NET.csproj", "{266BBA60-25FD-4C1B-BD99-9DCFA1B57130}"
25+
EndProject
26+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Documentation", "Documentation", "{7EDFA103-DB69-4C88-9DE4-97ADBF8253A1}"
27+
ProjectSection(SolutionItems) = preProject
28+
CONTRIBUTING.md = CONTRIBUTING.md
29+
README.md = README.md
30+
EndProjectSection
31+
EndProject
32+
Global
33+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
34+
Debug|Any CPU = Debug|Any CPU
35+
Release|Any CPU = Release|Any CPU
36+
EndGlobalSection
37+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
38+
{3CED3D1A-AB36-4B39-86DC-910BF8237DE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
39+
{3CED3D1A-AB36-4B39-86DC-910BF8237DE9}.Debug|Any CPU.Build.0 = Debug|Any CPU
40+
{3CED3D1A-AB36-4B39-86DC-910BF8237DE9}.Release|Any CPU.ActiveCfg = Release|Any CPU
41+
{3CED3D1A-AB36-4B39-86DC-910BF8237DE9}.Release|Any CPU.Build.0 = Release|Any CPU
42+
{266BBA60-25FD-4C1B-BD99-9DCFA1B57130}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
43+
{266BBA60-25FD-4C1B-BD99-9DCFA1B57130}.Debug|Any CPU.Build.0 = Debug|Any CPU
44+
{266BBA60-25FD-4C1B-BD99-9DCFA1B57130}.Release|Any CPU.ActiveCfg = Release|Any CPU
45+
{266BBA60-25FD-4C1B-BD99-9DCFA1B57130}.Release|Any CPU.Build.0 = Release|Any CPU
46+
EndGlobalSection
47+
GlobalSection(SolutionProperties) = preSolution
48+
HideSolutionNode = FALSE
49+
EndGlobalSection
50+
GlobalSection(NestedProjects) = preSolution
51+
{3CED3D1A-AB36-4B39-86DC-910BF8237DE9} = {719809C2-A551-4C4A-9EFD-B10FB5E35BC0}
52+
{266BBA60-25FD-4C1B-BD99-9DCFA1B57130} = {719809C2-A551-4C4A-9EFD-B10FB5E35BC0}
53+
EndGlobalSection
54+
EndGlobal
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
namespace Schema.NET.Tool
2+
{
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Linq;
6+
7+
public static class EnumerableExtensions
8+
{
9+
public static IEnumerable<T> Traverse<T>(T node, Func<T, IEnumerable<T>> children)
10+
{
11+
yield return node;
12+
13+
var childNodes = children(node);
14+
if (childNodes != null)
15+
{
16+
foreach (var childNode in childNodes.SelectMany(x => Traverse(x, children)))
17+
{
18+
yield return childNode;
19+
}
20+
}
21+
}
22+
}
23+
}

0 commit comments

Comments
 (0)