diff --git a/ApiDocs.Console/AppConfigFile.cs b/ApiDocs.Console/AppConfigFile.cs index ae793d7..072c913 100644 --- a/ApiDocs.Console/AppConfigFile.cs +++ b/ApiDocs.Console/AppConfigFile.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.ConsoleApp +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.ConsoleApp { using ApiDocs.ConsoleApp.Auth; using ApiDocs.Validation.Config; diff --git a/ApiDocs.Console/AppVeyor/BuildWorkerApi.cs b/ApiDocs.Console/AppVeyor/BuildWorkerApi.cs index 51e9d0b..047e99d 100644 --- a/ApiDocs.Console/AppVeyor/BuildWorkerApi.cs +++ b/ApiDocs.Console/AppVeyor/BuildWorkerApi.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.ConsoleApp.AppVeyor +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.ConsoleApp.AppVeyor { using System; using System.IO; diff --git a/ApiDocs.Console/Auth/Account.cs b/ApiDocs.Console/Auth/Account.cs index 5df67fb..24ca809 100644 --- a/ApiDocs.Console/Auth/Account.cs +++ b/ApiDocs.Console/Auth/Account.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.ConsoleApp.Auth +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.ConsoleApp.Auth { using System; using ApiDocs.Validation; diff --git a/ApiDocs.Console/Auth/OAuthTokenGenerator.cs b/ApiDocs.Console/Auth/OAuthTokenGenerator.cs index 462ec15..d9c10ef 100644 --- a/ApiDocs.Console/Auth/OAuthTokenGenerator.cs +++ b/ApiDocs.Console/Auth/OAuthTokenGenerator.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.ConsoleApp.Auth +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.ConsoleApp.Auth { using System; using System.IO; diff --git a/ApiDocs.Console/CheckResults.cs b/ApiDocs.Console/CheckResults.cs index 1fe6edb..43d9a30 100644 --- a/ApiDocs.Console/CheckResults.cs +++ b/ApiDocs.Console/CheckResults.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.ConsoleApp +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.ConsoleApp { using System.Collections.Generic; using System.Linq; diff --git a/ApiDocs.Console/CommandLineOptions.cs b/ApiDocs.Console/CommandLineOptions.cs index 5b66eb3..2cc221f 100644 --- a/ApiDocs.Console/CommandLineOptions.cs +++ b/ApiDocs.Console/CommandLineOptions.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.ConsoleApp +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.ConsoleApp { using System; using System.Collections.Generic; diff --git a/ApiDocs.Console/FancyConsole.cs b/ApiDocs.Console/FancyConsole.cs index d27c0a0..50874cf 100644 --- a/ApiDocs.Console/FancyConsole.cs +++ b/ApiDocs.Console/FancyConsole.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.ConsoleApp +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.ConsoleApp { using System; using System.IO; diff --git a/ApiDocs.Console/Program.cs b/ApiDocs.Console/Program.cs index ac683b6..b613bca 100644 --- a/ApiDocs.Console/Program.cs +++ b/ApiDocs.Console/Program.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.ConsoleApp +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.ConsoleApp { using System; using System.Collections.Generic; diff --git a/ApiDocs.Console/SavedSettings.cs b/ApiDocs.Console/SavedSettings.cs index 76aeb54..a4a9f27 100644 --- a/ApiDocs.Console/SavedSettings.cs +++ b/ApiDocs.Console/SavedSettings.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.ConsoleApp +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.ConsoleApp { using System; using System.Diagnostics; diff --git a/ApiDocs.Console/TestReport.cs b/ApiDocs.Console/TestReport.cs index de6c22d..886dd4a 100644 --- a/ApiDocs.Console/TestReport.cs +++ b/ApiDocs.Console/TestReport.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.ConsoleApp +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.ConsoleApp { using System; using System.Collections.Generic; diff --git a/ApiDocs.Publishing/ApiDocs.Publishing.csproj b/ApiDocs.Publishing/ApiDocs.Publishing.csproj index da81659..a5e9448 100644 --- a/ApiDocs.Publishing/ApiDocs.Publishing.csproj +++ b/ApiDocs.Publishing/ApiDocs.Publishing.csproj @@ -32,6 +32,10 @@ 4 + + False + ..\packages\mustache-sharp.0.2.8.1\lib\net40\mustache-sharp.dll + ..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll @@ -44,10 +48,12 @@ + + @@ -59,10 +65,6 @@ {1569ed47-c7c9-4261-b6f4-7445bd0f2c95} MarkdownDeep - - {d71b378f-a4ba-4263-a4f0-07a49a0c528d} - mustache-sharp - {33b10320-3802-49cf-8965-3510ae66d5ec} ApiDocs.Validation diff --git a/OSS/mustache-sharp/mustache-sharp/ConditionTagDefinition.cs b/ApiDocs.Publishing/Html/ApiDocsConditionalTag.cs similarity index 84% rename from OSS/mustache-sharp/mustache-sharp/ConditionTagDefinition.cs rename to ApiDocs.Publishing/Html/ApiDocsConditionalTag.cs index 0c3e797..24771ff 100644 --- a/OSS/mustache-sharp/mustache-sharp/ConditionTagDefinition.cs +++ b/ApiDocs.Publishing/Html/ApiDocsConditionalTag.cs @@ -1,14 +1,18 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; +/* + * Copied from Mustache-Sharp: https://github.com/jehugaleahsa/mustache-sharp + * The version of this class inside the library is marked as internal. The implementation + * is copied here so it can be extended to add new conditional tags. + */ -namespace Mustache +namespace ApiDocs.Publishing.Html { - /// - /// Defines a tag that conditionally prints its content. - /// - public abstract class ConditionTagDefinition : ContentTagDefinition + using Mustache; + using System; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + internal class ApiDocsConditionalTag : ContentTagDefinition { private const string conditionParameter = "condition"; @@ -16,8 +20,8 @@ public abstract class ConditionTagDefinition : ContentTagDefinition /// Initializes a new instance of a ConditionTagDefinition. /// /// The name of the tag. - protected ConditionTagDefinition(string tagName) - : base(tagName, true) + protected ApiDocsConditionalTag(string tagName) + : base(tagName) { } diff --git a/ApiDocs.Publishing/Html/DocumentPublisherHtml.cs b/ApiDocs.Publishing/Html/DocumentPublisherHtml.cs index e3e26f6..963867e 100644 --- a/ApiDocs.Publishing/Html/DocumentPublisherHtml.cs +++ b/ApiDocs.Publishing/Html/DocumentPublisherHtml.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Publishing.Html +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Publishing.Html { using System; using System.Collections.Generic; diff --git a/ApiDocs.Publishing/Html/ExtendedElseTag.cs b/ApiDocs.Publishing/Html/ExtendedElseTag.cs new file mode 100644 index 0000000..a2c0a36 --- /dev/null +++ b/ApiDocs.Publishing/Html/ExtendedElseTag.cs @@ -0,0 +1,73 @@ +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Publishing.Html +{ + using Mustache; + using System; + using System.Collections.Generic; + using System.Linq; + using System.Text; + using System.Threading.Tasks; + + internal class ExtendedElseTagDefinition : ContentTagDefinition + { + /// + /// Initializes a new instance of a ElseTagDefinition. + /// + public ExtendedElseTagDefinition() + : base("elsematch") + { + } + + /// + /// Gets whether the tag only exists within the scope of its parent. + /// + protected override bool GetIsContextSensitive() + { + return true; + } + + /// + /// Gets the tags that indicate the end of the current tag's content. + /// + protected override IEnumerable GetClosingTags() + { + var tags = new List(base.GetClosingTags()) { "ifmatch" }; + return tags; + } + + /// + /// Gets the parameters that are used to create a new child context. + /// + /// The parameters that are used to create a new child context. + public override IEnumerable GetChildContextParameters() + { + return new TagParameter[0]; + } + } + + +} diff --git a/ApiDocs.Publishing/Html/FileTagDefinition.cs b/ApiDocs.Publishing/Html/FileTagDefinition.cs index a68f3cc..c819e10 100644 --- a/ApiDocs.Publishing/Html/FileTagDefinition.cs +++ b/ApiDocs.Publishing/Html/FileTagDefinition.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Publishing.Html +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Publishing.Html { using System.Collections.Generic; using System.IO; diff --git a/ApiDocs.Publishing/Html/HtmlMustacheWriter.cs b/ApiDocs.Publishing/Html/HtmlMustacheWriter.cs index 28f228a..4be124f 100644 --- a/ApiDocs.Publishing/Html/HtmlMustacheWriter.cs +++ b/ApiDocs.Publishing/Html/HtmlMustacheWriter.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Publishing.Html +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Publishing.Html { using System; using System.Collections.Generic; @@ -35,7 +60,7 @@ protected override void LoadTemplate() compiler.RegisterTag(this.fileTag, true); compiler.RegisterTag(new IfMatchTagDefinition(), true); compiler.RegisterTag(new ExtendedElseTagDefinition(), false); - compiler.RegisterTag(new ExtendedElseIfTagDefinition(), false); + //compiler.RegisterTag(new ExtendedElseIfTagDefinition(), false); this.generator = compiler.Compile(this.TemplateHtml); this.generator.KeyNotFound += this.Generator_KeyNotFound; //this.generator.ValueRequested += this.Generator_ValueRequested; diff --git a/ApiDocs.Publishing/Html/IfMatchTagDefinition.cs b/ApiDocs.Publishing/Html/IfMatchTagDefinition.cs index 2d8111f..e219b75 100644 --- a/ApiDocs.Publishing/Html/IfMatchTagDefinition.cs +++ b/ApiDocs.Publishing/Html/IfMatchTagDefinition.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Publishing.Html +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Publishing.Html { using System.Collections.Generic; using System.Linq; @@ -34,7 +59,7 @@ protected override bool GetHasContent() protected override IEnumerable GetChildTags() { - return new string[] { "else", "elif" }; + return new string[] { "elsematch" }; } public override bool ShouldCreateSecondaryGroup(TagDefinition definition) @@ -48,23 +73,7 @@ public override IEnumerable GetChildContextParameters() } } - public class ExtendedElseTagDefinition : ElseTagDefinition - { - protected override IEnumerable GetClosingTags() - { - var tags = new List(base.GetClosingTags()) { "ifmatch" }; - return tags; - } - } - public class ExtendedElseIfTagDefinition : ElifTagDefinition - { - protected override IEnumerable GetClosingTags() - { - var tags = new List(base.GetClosingTags()) { "ifmatch" }; - return tags; - } - } } diff --git a/ApiDocs.Publishing/PathExtensionMethods.cs b/ApiDocs.Publishing/PathExtensionMethods.cs index 76e9cac..f930dd6 100644 --- a/ApiDocs.Publishing/PathExtensionMethods.cs +++ b/ApiDocs.Publishing/PathExtensionMethods.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Publishing +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Publishing { internal static class PathExtensionMethods { diff --git a/ApiDocs.Publishing/Swagger/SwaggerClasses.cs b/ApiDocs.Publishing/Swagger/SwaggerClasses.cs index f42faa2..a28af39 100644 --- a/ApiDocs.Publishing/Swagger/SwaggerClasses.cs +++ b/ApiDocs.Publishing/Swagger/SwaggerClasses.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Publishing.Swagger +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Publishing.Swagger { using System.Collections.Generic; using System.Linq; diff --git a/ApiDocs.Publishing/Swagger/SwaggerExtensionMethods.cs b/ApiDocs.Publishing/Swagger/SwaggerExtensionMethods.cs index 3d108a5..116a848 100644 --- a/ApiDocs.Publishing/Swagger/SwaggerExtensionMethods.cs +++ b/ApiDocs.Publishing/Swagger/SwaggerExtensionMethods.cs @@ -1,4 +1,27 @@ -using ResourceName = System.String; +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ namespace ApiDocs.Publishing.Swagger { @@ -8,6 +31,7 @@ namespace ApiDocs.Publishing.Swagger using ApiDocs.Validation; using ApiDocs.Validation.Http; using ApiDocs.Validation.Json; + using ResourceName = System.String; public static class SwaggerExtensionMethods { diff --git a/ApiDocs.Publishing/Swagger/SwaggerWriter.cs b/ApiDocs.Publishing/Swagger/SwaggerWriter.cs index 95135b6..1ae9e65 100644 --- a/ApiDocs.Publishing/Swagger/SwaggerWriter.cs +++ b/ApiDocs.Publishing/Swagger/SwaggerWriter.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Publishing.Swagger +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Publishing.Swagger { using System; using System.Collections.Generic; diff --git a/ApiDocs.Publishing/packages.config b/ApiDocs.Publishing/packages.config index 747efc5..7953673 100644 --- a/ApiDocs.Publishing/packages.config +++ b/ApiDocs.Publishing/packages.config @@ -1,4 +1,5 @@  + \ No newline at end of file diff --git a/ApiDocs.Validation.UnitTests/BrokenLinkTests.cs b/ApiDocs.Validation.UnitTests/BrokenLinkTests.cs index 1c0ced1..0819959 100644 --- a/ApiDocs.Validation.UnitTests/BrokenLinkTests.cs +++ b/ApiDocs.Validation.UnitTests/BrokenLinkTests.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.UnitTests +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.UnitTests { using System; using System.IO; diff --git a/ApiDocs.Validation.UnitTests/DocFileForTesting.cs b/ApiDocs.Validation.UnitTests/DocFileForTesting.cs index 862d925..0cc1996 100644 --- a/ApiDocs.Validation.UnitTests/DocFileForTesting.cs +++ b/ApiDocs.Validation.UnitTests/DocFileForTesting.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.UnitTests +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.UnitTests { public class DocFileForTesting : DocFile { diff --git a/ApiDocs.Validation.UnitTests/ExtensionMethods.cs b/ApiDocs.Validation.UnitTests/ExtensionMethods.cs index 9d4f6db..500cd32 100644 --- a/ApiDocs.Validation.UnitTests/ExtensionMethods.cs +++ b/ApiDocs.Validation.UnitTests/ExtensionMethods.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.UnitTests +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.UnitTests { using System.Collections.Generic; using System.Linq; diff --git a/ApiDocs.Validation.UnitTests/JsonPathTest.cs b/ApiDocs.Validation.UnitTests/JsonPathTest.cs index 0f4e311..f18684a 100644 --- a/ApiDocs.Validation.UnitTests/JsonPathTest.cs +++ b/ApiDocs.Validation.UnitTests/JsonPathTest.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.UnitTests +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.UnitTests { using System.Collections.Generic; using ApiDocs.Validation.Json; diff --git a/ApiDocs.Validation.UnitTests/NullableTests.cs b/ApiDocs.Validation.UnitTests/NullableTests.cs index 251f77a..a00a90a 100644 --- a/ApiDocs.Validation.UnitTests/NullableTests.cs +++ b/ApiDocs.Validation.UnitTests/NullableTests.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.UnitTests +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.UnitTests { using System.Collections.Generic; using System.Linq; diff --git a/ApiDocs.Validation.UnitTests/ResourceStringValidationTests.cs b/ApiDocs.Validation.UnitTests/ResourceStringValidationTests.cs index 40cbbb1..fba1d85 100644 --- a/ApiDocs.Validation.UnitTests/ResourceStringValidationTests.cs +++ b/ApiDocs.Validation.UnitTests/ResourceStringValidationTests.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.UnitTests +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.UnitTests { using System.Linq; using ApiDocs.Validation.Error; diff --git a/ApiDocs.Validation.UnitTests/SchemaBuilderTests.cs b/ApiDocs.Validation.UnitTests/SchemaBuilderTests.cs index ffee9c1..40e194e 100644 --- a/ApiDocs.Validation.UnitTests/SchemaBuilderTests.cs +++ b/ApiDocs.Validation.UnitTests/SchemaBuilderTests.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.UnitTests +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.UnitTests { using System; using ApiDocs.Validation.Json; diff --git a/ApiDocs.Validation.UnitTests/SchemaValidatorTests.cs b/ApiDocs.Validation.UnitTests/SchemaValidatorTests.cs index 0e3286d..f8d36da 100644 --- a/ApiDocs.Validation.UnitTests/SchemaValidatorTests.cs +++ b/ApiDocs.Validation.UnitTests/SchemaValidatorTests.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.UnitTests +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.UnitTests { using System; using System.Linq; diff --git a/ApiDocs.Validation/ApiDocs.Validation.nuspec b/ApiDocs.Validation/ApiDocs.Validation.nuspec new file mode 100644 index 0000000..4ab04be --- /dev/null +++ b/ApiDocs.Validation/ApiDocs.Validation.nuspec @@ -0,0 +1,26 @@ + + + + ApiDocs.Library + $version$ + API Documentation Validation Library + Microsoft Corporation + rgregg@microsoft.com + false + Toolkit to enable validation of markdown-based documentation. + Updating with new package + Copyright Microsoft + + + + + + + + + + + + + + diff --git a/ApiDocs.Validation/AuthScopeDefinition.cs b/ApiDocs.Validation/AuthScopeDefinition.cs index 7a0208d..c73e4be 100644 --- a/ApiDocs.Validation/AuthScopeDefinition.cs +++ b/ApiDocs.Validation/AuthScopeDefinition.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation { public class AuthScopeDefinition : ItemDefinition { diff --git a/ApiDocs.Validation/AuthenicationCredentials.cs b/ApiDocs.Validation/AuthenicationCredentials.cs index d0d45dd..e307013 100644 --- a/ApiDocs.Validation/AuthenicationCredentials.cs +++ b/ApiDocs.Validation/AuthenicationCredentials.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation { using System; diff --git a/ApiDocs.Validation/BackoffHelper.cs b/ApiDocs.Validation/BackoffHelper.cs index 81f8720..212e882 100644 --- a/ApiDocs.Validation/BackoffHelper.cs +++ b/ApiDocs.Validation/BackoffHelper.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation { using System; using System.Diagnostics; diff --git a/ApiDocs.Validation/CodeBlockAnnotation.cs b/ApiDocs.Validation/CodeBlockAnnotation.cs index ad07ea8..158c0c3 100644 --- a/ApiDocs.Validation/CodeBlockAnnotation.cs +++ b/ApiDocs.Validation/CodeBlockAnnotation.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation { using System; using System.Diagnostics; diff --git a/ApiDocs.Validation/Config/ApiRequirementsFile.cs b/ApiDocs.Validation/Config/ApiRequirementsFile.cs index d36d943..0d81bb4 100644 --- a/ApiDocs.Validation/Config/ApiRequirementsFile.cs +++ b/ApiDocs.Validation/Config/ApiRequirementsFile.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.Config +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.Config { using Newtonsoft.Json; diff --git a/ApiDocs.Validation/Config/ConfigFile.cs b/ApiDocs.Validation/Config/ConfigFile.cs index 2166750..95406a0 100644 --- a/ApiDocs.Validation/Config/ConfigFile.cs +++ b/ApiDocs.Validation/Config/ConfigFile.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.Config +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.Config { public abstract class ConfigFile { diff --git a/ApiDocs.Validation/DocFile.cs b/ApiDocs.Validation/DocFile.cs index 7a1cf18..77b7596 100644 --- a/ApiDocs.Validation/DocFile.cs +++ b/ApiDocs.Validation/DocFile.cs @@ -1,3 +1,28 @@ +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + namespace ApiDocs.Validation { using System; diff --git a/ApiDocs.Validation/DocSet.cs b/ApiDocs.Validation/DocSet.cs index d64fd30..8eb8342 100644 --- a/ApiDocs.Validation/DocSet.cs +++ b/ApiDocs.Validation/DocSet.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation { using System; using System.Collections.Generic; diff --git a/ApiDocs.Validation/EnumerationDefinition.cs b/ApiDocs.Validation/EnumerationDefinition.cs index bc7d97d..d7ae1f0 100644 --- a/ApiDocs.Validation/EnumerationDefinition.cs +++ b/ApiDocs.Validation/EnumerationDefinition.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation { public class EnumerationDefinition : ItemDefinition { diff --git a/ApiDocs.Validation/Error/ValidationError.cs b/ApiDocs.Validation/Error/ValidationError.cs index ddacef4..77a5ac5 100644 --- a/ApiDocs.Validation/Error/ValidationError.cs +++ b/ApiDocs.Validation/Error/ValidationError.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.Error +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.Error { using System; using System.Collections.Generic; diff --git a/ApiDocs.Validation/Error/ValidationMessage.cs b/ApiDocs.Validation/Error/ValidationMessage.cs index d6c7796..fce8747 100644 --- a/ApiDocs.Validation/Error/ValidationMessage.cs +++ b/ApiDocs.Validation/Error/ValidationMessage.cs @@ -1,4 +1,30 @@ -namespace ApiDocs.Validation.Error +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + +namespace ApiDocs.Validation.Error { public class ValidationMessage : ValidationError { diff --git a/ApiDocs.Validation/Error/ValidationResult.cs b/ApiDocs.Validation/Error/ValidationResult.cs index 03c05cb..b0cccef 100644 --- a/ApiDocs.Validation/Error/ValidationResult.cs +++ b/ApiDocs.Validation/Error/ValidationResult.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.Error +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.Error { using System.Collections.Generic; using System.Linq; diff --git a/ApiDocs.Validation/Error/ValidationWarning.cs b/ApiDocs.Validation/Error/ValidationWarning.cs index afa9432..a87ab9a 100644 --- a/ApiDocs.Validation/Error/ValidationWarning.cs +++ b/ApiDocs.Validation/Error/ValidationWarning.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.Error +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.Error { public class ValidationWarning : ValidationError { diff --git a/ApiDocs.Validation/ErrorDefinition.cs b/ApiDocs.Validation/ErrorDefinition.cs index 6c54b19..9a4bc5c 100644 --- a/ApiDocs.Validation/ErrorDefinition.cs +++ b/ApiDocs.Validation/ErrorDefinition.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation { public class ErrorDefinition : ItemDefinition { diff --git a/ApiDocs.Validation/ExampleDefinition.cs b/ApiDocs.Validation/ExampleDefinition.cs index 42ad89a..20a5269 100644 --- a/ApiDocs.Validation/ExampleDefinition.cs +++ b/ApiDocs.Validation/ExampleDefinition.cs @@ -1,4 +1,29 @@ -using Newtonsoft.Json; +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +using Newtonsoft.Json; using System; using ApiDocs.Validation.Error; diff --git a/ApiDocs.Validation/ExtensionMethods.cs b/ApiDocs.Validation/ExtensionMethods.cs index 14571e0..94d03e8 100644 --- a/ApiDocs.Validation/ExtensionMethods.cs +++ b/ApiDocs.Validation/ExtensionMethods.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation { using System; using System.Collections.Generic; diff --git a/ApiDocs.Validation/Http/HttpParser.cs b/ApiDocs.Validation/Http/HttpParser.cs index b0eb407..f4b1e50 100644 --- a/ApiDocs.Validation/Http/HttpParser.cs +++ b/ApiDocs.Validation/Http/HttpParser.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.Http +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.Http { using System; using System.IO; diff --git a/ApiDocs.Validation/Http/HttpRequest.cs b/ApiDocs.Validation/Http/HttpRequest.cs index b348a03..c7178c8 100644 --- a/ApiDocs.Validation/Http/HttpRequest.cs +++ b/ApiDocs.Validation/Http/HttpRequest.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.Http +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.Http { using System; using System.IO; diff --git a/ApiDocs.Validation/Http/HttpResponse.cs b/ApiDocs.Validation/Http/HttpResponse.cs index 6e1543f..f4ea84b 100644 --- a/ApiDocs.Validation/Http/HttpResponse.cs +++ b/ApiDocs.Validation/Http/HttpResponse.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.Http +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.Http { using System; using System.Collections.Generic; diff --git a/ApiDocs.Validation/Http/HttpValidationExtensionMethods.cs b/ApiDocs.Validation/Http/HttpValidationExtensionMethods.cs index bef3682..b4ad15b 100644 --- a/ApiDocs.Validation/Http/HttpValidationExtensionMethods.cs +++ b/ApiDocs.Validation/Http/HttpValidationExtensionMethods.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.Http +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.Http { using System.Collections.Generic; using System.Linq; diff --git a/ApiDocs.Validation/IServiceAccount.cs b/ApiDocs.Validation/IServiceAccount.cs index f6cd016..b28a27f 100644 --- a/ApiDocs.Validation/IServiceAccount.cs +++ b/ApiDocs.Validation/IServiceAccount.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation { using System; using System.Collections.Generic; diff --git a/ApiDocs.Validation/ItemDefinition.cs b/ApiDocs.Validation/ItemDefinition.cs index 2c6c0a7..80e51a2 100644 --- a/ApiDocs.Validation/ItemDefinition.cs +++ b/ApiDocs.Validation/ItemDefinition.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation { using System.Collections.Generic; diff --git a/ApiDocs.Validation/Json/JsonExample.cs b/ApiDocs.Validation/Json/JsonExample.cs index 6111f1d..97de9c9 100644 --- a/ApiDocs.Validation/Json/JsonExample.cs +++ b/ApiDocs.Validation/Json/JsonExample.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.Json +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.Json { public class JsonExample { diff --git a/ApiDocs.Validation/Json/JsonPath.cs b/ApiDocs.Validation/Json/JsonPath.cs index 06fe029..e232187 100644 --- a/ApiDocs.Validation/Json/JsonPath.cs +++ b/ApiDocs.Validation/Json/JsonPath.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.Json +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.Json { using System; using System.Collections.Generic; diff --git a/ApiDocs.Validation/Json/JsonProperty.cs b/ApiDocs.Validation/Json/JsonProperty.cs index 0400ea0..0c39e38 100644 --- a/ApiDocs.Validation/Json/JsonProperty.cs +++ b/ApiDocs.Validation/Json/JsonProperty.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.Json +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.Json { using System; using System.Collections.Generic; diff --git a/ApiDocs.Validation/Json/JsonResourceCollection.cs b/ApiDocs.Validation/Json/JsonResourceCollection.cs index 12e4883..1398008 100644 --- a/ApiDocs.Validation/Json/JsonResourceCollection.cs +++ b/ApiDocs.Validation/Json/JsonResourceCollection.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.Json +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.Json { using System; using System.Collections.Generic; diff --git a/ApiDocs.Validation/Json/JsonSchema.cs b/ApiDocs.Validation/Json/JsonSchema.cs index 1a575f0..0d8898e 100644 --- a/ApiDocs.Validation/Json/JsonSchema.cs +++ b/ApiDocs.Validation/Json/JsonSchema.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.Json +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.Json { using System; using System.Collections.Generic; diff --git a/ApiDocs.Validation/Json/ValidationOptions.cs b/ApiDocs.Validation/Json/ValidationOptions.cs index af1e851..c036430 100644 --- a/ApiDocs.Validation/Json/ValidationOptions.cs +++ b/ApiDocs.Validation/Json/ValidationOptions.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.Json +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.Json { using System.Linq; diff --git a/ApiDocs.Validation/Logging.cs b/ApiDocs.Validation/Logging.cs index 0532523..d1a5ebb 100644 --- a/ApiDocs.Validation/Logging.cs +++ b/ApiDocs.Validation/Logging.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation { using System; using ApiDocs.Validation.Error; diff --git a/ApiDocs.Validation/MethodDefinition.cs b/ApiDocs.Validation/MethodDefinition.cs index 091f41f..343a189 100644 --- a/ApiDocs.Validation/MethodDefinition.cs +++ b/ApiDocs.Validation/MethodDefinition.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation { using System; using System.Collections.Generic; diff --git a/ApiDocs.Validation/MethodValidationExtensionMethods.cs b/ApiDocs.Validation/MethodValidationExtensionMethods.cs index ee8255d..c85136b 100644 --- a/ApiDocs.Validation/MethodValidationExtensionMethods.cs +++ b/ApiDocs.Validation/MethodValidationExtensionMethods.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation { using System; using System.Collections.Generic; diff --git a/ApiDocs.Validation/OData/Action.cs b/ApiDocs.Validation/OData/Action.cs index cdb27b7..26c1581 100644 --- a/ApiDocs.Validation/OData/Action.cs +++ b/ApiDocs.Validation/OData/Action.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.OData +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.OData { using System; using System.Collections.Generic; diff --git a/ApiDocs.Validation/OData/Annotation.cs b/ApiDocs.Validation/OData/Annotation.cs index 277c95b..a114b51 100644 --- a/ApiDocs.Validation/OData/Annotation.cs +++ b/ApiDocs.Validation/OData/Annotation.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.OData +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.OData { using System; using System.Xml.Linq; diff --git a/ApiDocs.Validation/OData/ComplexType.cs b/ApiDocs.Validation/OData/ComplexType.cs index 8b389cb..3f81662 100644 --- a/ApiDocs.Validation/OData/ComplexType.cs +++ b/ApiDocs.Validation/OData/ComplexType.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.OData +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.OData { using System; using System.Collections.Generic; diff --git a/ApiDocs.Validation/OData/EntityContainer.cs b/ApiDocs.Validation/OData/EntityContainer.cs index 601b548..f973df1 100644 --- a/ApiDocs.Validation/OData/EntityContainer.cs +++ b/ApiDocs.Validation/OData/EntityContainer.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.OData +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.OData { using System; using System.Linq; diff --git a/ApiDocs.Validation/OData/EntitySet.cs b/ApiDocs.Validation/OData/EntitySet.cs index fb6268d..14d8b3e 100644 --- a/ApiDocs.Validation/OData/EntitySet.cs +++ b/ApiDocs.Validation/OData/EntitySet.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.OData +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.OData { using System; using System.Xml.Linq; diff --git a/ApiDocs.Validation/OData/EntityType.cs b/ApiDocs.Validation/OData/EntityType.cs index ff4e3b5..3f8cbcb 100644 --- a/ApiDocs.Validation/OData/EntityType.cs +++ b/ApiDocs.Validation/OData/EntityType.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.OData +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.OData { using System; using System.Collections.Generic; diff --git a/ApiDocs.Validation/OData/ExtensionMethods.cs b/ApiDocs.Validation/OData/ExtensionMethods.cs index 11f88de..550e08c 100644 --- a/ApiDocs.Validation/OData/ExtensionMethods.cs +++ b/ApiDocs.Validation/OData/ExtensionMethods.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.OData +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.OData { using System; using System.Collections.Generic; diff --git a/ApiDocs.Validation/OData/Function.cs b/ApiDocs.Validation/OData/Function.cs index f799b4b..53e64be 100644 --- a/ApiDocs.Validation/OData/Function.cs +++ b/ApiDocs.Validation/OData/Function.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.OData +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.OData { using System; using System.Collections.Generic; diff --git a/ApiDocs.Validation/OData/NavigationProperty.cs b/ApiDocs.Validation/OData/NavigationProperty.cs index 195bafc..68c8cb9 100644 --- a/ApiDocs.Validation/OData/NavigationProperty.cs +++ b/ApiDocs.Validation/OData/NavigationProperty.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.OData +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.OData { using System; using System.Xml.Linq; diff --git a/ApiDocs.Validation/OData/ODataParser.cs b/ApiDocs.Validation/OData/ODataParser.cs index f5d3ff5..69a6a1a 100644 --- a/ApiDocs.Validation/OData/ODataParser.cs +++ b/ApiDocs.Validation/OData/ODataParser.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.OData +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.OData { using System; using System.Collections.Generic; diff --git a/ApiDocs.Validation/OData/Parameter.cs b/ApiDocs.Validation/OData/Parameter.cs index 1848608..cedacf5 100644 --- a/ApiDocs.Validation/OData/Parameter.cs +++ b/ApiDocs.Validation/OData/Parameter.cs @@ -1,10 +1,33 @@ -namespace ApiDocs.Validation.OData +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.OData { using System; using System.Xml.Linq; - // - public class Parameter { public string Name { get; set; } diff --git a/ApiDocs.Validation/OData/Property.cs b/ApiDocs.Validation/OData/Property.cs index f16f826..9dd9380 100644 --- a/ApiDocs.Validation/OData/Property.cs +++ b/ApiDocs.Validation/OData/Property.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.OData +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.OData { using System; using System.Xml.Linq; diff --git a/ApiDocs.Validation/OData/ReturnType.cs b/ApiDocs.Validation/OData/ReturnType.cs index a8fccb7..d7b47ae 100644 --- a/ApiDocs.Validation/OData/ReturnType.cs +++ b/ApiDocs.Validation/OData/ReturnType.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.OData +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.OData { using System; using System.Xml.Linq; diff --git a/ApiDocs.Validation/OData/Schema.cs b/ApiDocs.Validation/OData/Schema.cs index c93dc34..a833fba 100644 --- a/ApiDocs.Validation/OData/Schema.cs +++ b/ApiDocs.Validation/OData/Schema.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.OData +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.OData { using System; using System.Collections.Generic; diff --git a/ApiDocs.Validation/OData/Term.cs b/ApiDocs.Validation/OData/Term.cs index 34e7325..183b6e1 100644 --- a/ApiDocs.Validation/OData/Term.cs +++ b/ApiDocs.Validation/OData/Term.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.OData +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.OData { using System; using System.Collections.Generic; diff --git a/ApiDocs.Validation/OneDrive.ApiDocumentation.Validation.nuspec b/ApiDocs.Validation/OneDrive.ApiDocumentation.Validation.nuspec deleted file mode 100644 index 8ef9948..0000000 --- a/ApiDocs.Validation/OneDrive.ApiDocumentation.Validation.nuspec +++ /dev/null @@ -1,16 +0,0 @@ - - - - $id$ - $version$ - ApiDocs Validation Engine - rgregg@microsoft.com - rgregg@microsoft.com - false - Library that powers the OneDrive API documentation test tool - Copyright 2015 Microsoft Corporation - - - - - \ No newline at end of file diff --git a/ApiDocs.Validation/PageAnnotation.cs b/ApiDocs.Validation/PageAnnotation.cs index 5496ffe..e49335a 100644 --- a/ApiDocs.Validation/PageAnnotation.cs +++ b/ApiDocs.Validation/PageAnnotation.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation { using System; using System.Linq; diff --git a/ApiDocs.Validation/ParameterDefinition.cs b/ApiDocs.Validation/ParameterDefinition.cs index 600240d..a5168fc 100644 --- a/ApiDocs.Validation/ParameterDefinition.cs +++ b/ApiDocs.Validation/ParameterDefinition.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation { using System.Collections.Generic; using ApiDocs.Validation.Json; diff --git a/ApiDocs.Validation/Params/BasicRequestDefinition.cs b/ApiDocs.Validation/Params/BasicRequestDefinition.cs index 1813c34..b6c330a 100644 --- a/ApiDocs.Validation/Params/BasicRequestDefinition.cs +++ b/ApiDocs.Validation/Params/BasicRequestDefinition.cs @@ -1,4 +1,27 @@ - +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ namespace ApiDocs.Validation.Params { diff --git a/ApiDocs.Validation/Params/PlaceholderValue.cs b/ApiDocs.Validation/Params/PlaceholderValue.cs index 394128c..bbd43f1 100644 --- a/ApiDocs.Validation/Params/PlaceholderValue.cs +++ b/ApiDocs.Validation/Params/PlaceholderValue.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.Params +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.Params { using System.ComponentModel; using System.Runtime.CompilerServices; diff --git a/ApiDocs.Validation/Params/RequestDefinitionExtensions.cs b/ApiDocs.Validation/Params/RequestDefinitionExtensions.cs index 30e3665..863738a 100644 --- a/ApiDocs.Validation/Params/RequestDefinitionExtensions.cs +++ b/ApiDocs.Validation/Params/RequestDefinitionExtensions.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.Params +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.Params { using System; using System.Collections.Generic; diff --git a/ApiDocs.Validation/Params/ScenarioDefinition.cs b/ApiDocs.Validation/Params/ScenarioDefinition.cs index 90d7469..7ab740d 100644 --- a/ApiDocs.Validation/Params/ScenarioDefinition.cs +++ b/ApiDocs.Validation/Params/ScenarioDefinition.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.Params +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.Params { using System.Collections.Generic; using Newtonsoft.Json; diff --git a/ApiDocs.Validation/Params/TestSetupRequestDefinition.cs b/ApiDocs.Validation/Params/TestSetupRequestDefinition.cs index 76df16e..3cca70a 100644 --- a/ApiDocs.Validation/Params/TestSetupRequestDefinition.cs +++ b/ApiDocs.Validation/Params/TestSetupRequestDefinition.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.Params +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.Params { using System; using System.Collections.Generic; diff --git a/ApiDocs.Validation/ResourceDefinition.cs b/ApiDocs.Validation/ResourceDefinition.cs index 0727e38..4b0e78b 100644 --- a/ApiDocs.Validation/ResourceDefinition.cs +++ b/ApiDocs.Validation/ResourceDefinition.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation { using System; using ApiDocs.Validation.Error; diff --git a/ApiDocs.Validation/ScenarioExtensionMethods.cs b/ApiDocs.Validation/ScenarioExtensionMethods.cs index 0c74f0b..9a65e90 100644 --- a/ApiDocs.Validation/ScenarioExtensionMethods.cs +++ b/ApiDocs.Validation/ScenarioExtensionMethods.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation { using System; using System.Collections.Generic; diff --git a/ApiDocs.Validation/Scenarios.cs b/ApiDocs.Validation/Scenarios.cs index 50291b0..7bacea4 100644 --- a/ApiDocs.Validation/Scenarios.cs +++ b/ApiDocs.Validation/Scenarios.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation { using System.Collections.Generic; using System.Linq; diff --git a/ApiDocs.Validation/SchemaBuildException.cs b/ApiDocs.Validation/SchemaBuildException.cs index 44176ff..9b61762 100644 --- a/ApiDocs.Validation/SchemaBuildException.cs +++ b/ApiDocs.Validation/SchemaBuildException.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation { using System; diff --git a/ApiDocs.Validation/TableSpec/TableDefinition.cs b/ApiDocs.Validation/TableSpec/TableDefinition.cs index 60e5cef..d9cc61b 100644 --- a/ApiDocs.Validation/TableSpec/TableDefinition.cs +++ b/ApiDocs.Validation/TableSpec/TableDefinition.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.TableSpec +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.TableSpec { using System.Collections.Generic; using System.Linq; diff --git a/ApiDocs.Validation/TableSpec/TableSpecConverter.cs b/ApiDocs.Validation/TableSpec/TableSpecConverter.cs index 413e109..292b040 100644 --- a/ApiDocs.Validation/TableSpec/TableSpecConverter.cs +++ b/ApiDocs.Validation/TableSpec/TableSpecConverter.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.TableSpec +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.TableSpec { using System.Collections.Generic; using System.Linq; diff --git a/ApiDocs.Validation/ValidationConfig.cs b/ApiDocs.Validation/ValidationConfig.cs index 8189b38..9e87c82 100644 --- a/ApiDocs.Validation/ValidationConfig.cs +++ b/ApiDocs.Validation/ValidationConfig.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation { public static class ValidationConfig { diff --git a/ApiDocs.Validation/Writers/DocumentPublisher.cs b/ApiDocs.Validation/Writers/DocumentPublisher.cs index e3fc554..946caf7 100644 --- a/ApiDocs.Validation/Writers/DocumentPublisher.cs +++ b/ApiDocs.Validation/Writers/DocumentPublisher.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.Writers +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.Writers { using System; using System.Collections.Generic; diff --git a/ApiDocs.Validation/Writers/IPublishOptions.cs b/ApiDocs.Validation/Writers/IPublishOptions.cs index 5ce48eb..84fa2c2 100644 --- a/ApiDocs.Validation/Writers/IPublishOptions.cs +++ b/ApiDocs.Validation/Writers/IPublishOptions.cs @@ -1,4 +1,29 @@ -using System; +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +using System; using System.Collections.Generic; using System.Linq; using System.Text; diff --git a/ApiDocs.Validation/Writers/MarkdownPublisher.cs.cs b/ApiDocs.Validation/Writers/MarkdownPublisher.cs.cs index fbdca1e..be8a7ac 100644 --- a/ApiDocs.Validation/Writers/MarkdownPublisher.cs.cs +++ b/ApiDocs.Validation/Writers/MarkdownPublisher.cs.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.Writers +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.Writers { using System.IO; using System.Text; diff --git a/ApiDocs.Validation/Writers/OutlinePublisher.cs b/ApiDocs.Validation/Writers/OutlinePublisher.cs index d531065..b37e66e 100644 --- a/ApiDocs.Validation/Writers/OutlinePublisher.cs +++ b/ApiDocs.Validation/Writers/OutlinePublisher.cs @@ -1,4 +1,29 @@ -namespace ApiDocs.Validation.Writers +/* + * Markdown Scanner + * Copyright (c) Microsoft Corporation + * All rights reserved. + * + * MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the ""Software""), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +namespace ApiDocs.Validation.Writers { using System.IO; using System.Threading.Tasks; diff --git a/MarkdownScanner.sln b/MarkdownScanner.sln index 8772862..1f8a461 100644 --- a/MarkdownScanner.sln +++ b/MarkdownScanner.sln @@ -13,6 +13,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApiDocs.Validation.UnitTest EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Content", "Content", "{464F5D09-2636-459F-96C9-C968FF4CA7B5}" ProjectSection(SolutionItems) = preProject + license.txt = license.txt OpenSourceNotes.md = OpenSourceNotes.md readme.md = readme.md EndProjectSection @@ -26,8 +27,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{8B3410 EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApiDocs.Publishing", "ApiDocs.Publishing\ApiDocs.Publishing.csproj", "{B675CF73-AA42-4A54-B5E7-FF5F155DA4A7}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mustache-sharp", "OSS\mustache-sharp\mustache-sharp\mustache-sharp.csproj", "{D71B378F-A4BA-4263-A4F0-07A49A0C528D}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OSS", "OSS", "{8C71C3F5-7CFD-4143-B391-4D395A376B77}" ProjectSection(SolutionItems) = preProject OpenSourceNotes.md = OpenSourceNotes.md @@ -97,16 +96,6 @@ Global {B675CF73-AA42-4A54-B5E7-FF5F155DA4A7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {B675CF73-AA42-4A54-B5E7-FF5F155DA4A7}.Release|Mixed Platforms.Build.0 = Release|Any CPU {B675CF73-AA42-4A54-B5E7-FF5F155DA4A7}.Release|x86.ActiveCfg = Release|Any CPU - {D71B378F-A4BA-4263-A4F0-07A49A0C528D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D71B378F-A4BA-4263-A4F0-07A49A0C528D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D71B378F-A4BA-4263-A4F0-07A49A0C528D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {D71B378F-A4BA-4263-A4F0-07A49A0C528D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {D71B378F-A4BA-4263-A4F0-07A49A0C528D}.Debug|x86.ActiveCfg = Debug|Any CPU - {D71B378F-A4BA-4263-A4F0-07A49A0C528D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D71B378F-A4BA-4263-A4F0-07A49A0C528D}.Release|Any CPU.Build.0 = Release|Any CPU - {D71B378F-A4BA-4263-A4F0-07A49A0C528D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {D71B378F-A4BA-4263-A4F0-07A49A0C528D}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {D71B378F-A4BA-4263-A4F0-07A49A0C528D}.Release|x86.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -117,7 +106,6 @@ Global {A6F3993F-59C6-4985-ACF1-4D837D61E98F} = {7C7E72AE-EC3D-4EB9-B919-165F794C4902} {EE3453F1-FD69-406C-9BD7-0643D6E999F3} = {7C7E72AE-EC3D-4EB9-B919-165F794C4902} {B675CF73-AA42-4A54-B5E7-FF5F155DA4A7} = {7C7E72AE-EC3D-4EB9-B919-165F794C4902} - {D71B378F-A4BA-4263-A4F0-07A49A0C528D} = {8C71C3F5-7CFD-4143-B391-4D395A376B77} EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution StartupItem = OneDrive.ApiDocumentation.CommandLine\OneDrive.ApiDocumentation.Console.csproj diff --git a/OSS/mustache-sharp/Deployment/NuGet.exe b/OSS/mustache-sharp/Deployment/NuGet.exe deleted file mode 100644 index 8d13fd8..0000000 Binary files a/OSS/mustache-sharp/Deployment/NuGet.exe and /dev/null differ diff --git a/OSS/mustache-sharp/Deployment/publish-mustache-sharp.bat b/OSS/mustache-sharp/Deployment/publish-mustache-sharp.bat deleted file mode 100644 index 6221d79..0000000 --- a/OSS/mustache-sharp/Deployment/publish-mustache-sharp.bat +++ /dev/null @@ -1,4 +0,0 @@ -msbuild ../mustache-sharp.sln /p:Configuration=Release -nuget pack ../mustache-sharp/mustache-sharp.csproj -Properties Configuration=Release -nuget push *.nupkg -del *.nupkg \ No newline at end of file diff --git a/OSS/mustache-sharp/README.md b/OSS/mustache-sharp/README.md deleted file mode 100644 index 3285182..0000000 --- a/OSS/mustache-sharp/README.md +++ /dev/null @@ -1,222 +0,0 @@ -# mustache# - -An extension of the mustache text template engine for .NET. - -Download using NuGet: [mustache#](http://nuget.org/packages/mustache-sharp) - -## Overview -Generating text has always been a chore. Either you're concatenating strings like a mad man or you're getting fancy with `StringBuilder`. Either way, the logic for conditionally including values or looping over a collection really obscures the intention of the code. A more declarative approach would improve your code big time. Hey, that's why server-side scripting got popular in the first place, right? - -[mustache](http://mustache.github.com/) is a really simple tool for generating text. .NET developers already had access to `String.Format` to accomplish pretty much the same thing. The only problem was that `String.Format` used indexes for placeholders: `Hello, {0}!!!`. **mustache** let you use meaningful names for placeholders: `Hello, {{name}}!!!`. - -**mustache** is a logic-less text generator. However, almost every time I've ever needed to generate text I needed to turn some of it on or off depending on a value. Not having the ability to turn things off usually meant going back to building my text in parts. - -Introducing [handlebars.js](http://handlebarsjs.com/)... If you've needed to generate any HTML templates, **handlebars.js** is a really awesome tool. Not only does it support an `if` and `each` tag, it lets you define your own tags! It also makes it easy to reference nested values `{{Customer.Address.ZipCode}}`. - -**mustache#** brings the power of **handlebars.js** to .NET and then takes it a little bit further. It is geared towards building ordinary text documents, rather than just HTML. It differs from **handlebars.js** in the way it handles newlines. With **mustache#**, you explicitly indicate when you want newlines - actual newlines are ignored. - - Hello, {{Customer.Name}} - {{#newline}} - {{#newline}} - {{#with Order}} - {{#if LineItems}} - Here is a summary of your previous order: - {{#newline}} - {{#newline}} - {{#each LineItems}} - {{ProductName}}: {{UnitPrice:C}} x {{Quantity}} - {{#newline}} - {{/each}} - {{#newline}} - Your total was {{Total:C}}. - {{#else}} - You do not have any recent purchases. - {{/if}} - {{/with}} - -Most of the lines in the previous example will never appear in the final output. This allows you to use **mustache#** to write templates for normal text, not just HTML/XML. - -## Placeholders -The placeholders can be any valid identifier. These map to the property names in your classes. - -### Formatting Placeholders -Each format item takes the following form and consists of the following components: - - {{identifier[,alignment][:formatString]}} - -The matching braces are required. Notice that they are double curly braces! The alignment and the format strings are optional and match the syntax accepted by `String.Format`. Refer to [String.Format](http://msdn.microsoft.com/en-us/library/system.string.format.aspx)'s documentation to learn more about the standard and custom format strings. - -### Placeholder Scope -The identifier is used to find a property with a matching name. If you want to print out the object itself, you can use the special identifier `this`. - - FormatCompiler compiler = new FormatCompiler(); - Generator generator = compiler.Compile("Hello, {{this}}!!!"); - string result = generator.Render("Bob"); - Console.Out.WriteLine(result); // Hello, Bob!!! - -Some tags, such as `each` and `with`, change which object the values will be retrieved from. - -If a property with the placeholder name can't be found at the current scope, the name will be searched for at the next highest level. - -**mustache#** will automatically detect when an object is a dictionary and search for a matching key. In this case, it still needs to be a valid identifier name. - -### Nested Placeholders -If you want to grab a nested property, you can separate identifiers using `.`. - - {{Customer.Address.ZipCode}} - -## The 'if' tag -The **if** tag allows you to conditionally include a block of text. - - Hello{{#if Name}}, {{Name}}{{/if}}!!! - -The block will be printed if: -* The value is a non-empty string. -* The value is a non-empty collection. -* The value isn't the NUL char. -* The value is a non-zero number. -* The value evaluates to true. - -The **if** tag has complimentary **elif** and **else** tags. There can be as many **elif** tags as desired but the **else** tag must appear only once and after all other tags. - - {{#if Male}}Mr.{{#elif Married}}Mrs.{{#else}}Ms.{{/if}} - -## The 'each' tag -If you need to print out a block of text for each item in a collection, use the **each** tag. - - {{#each Customers}} - Hello, {{Name}}!! - {{/each}} - -Within the context of the **each** block, the scope changes to the current item. So, in the example above, `Name` would refer to a property in the `Customer` class. - -Additionally, you can access the current index into the collection being enumerated using the **index** tag. - -
    - {{#each Items}} -
  • {{Description}}
  • - {{/each}} -
- -This will build an HTML list, building a list of items with `Description` and `Value` properties. Additionally, the `index` tag is used to create a CSS class with increasing numbers. - -## The 'with' tag -Within a block of text, you may refer to a same top-level placeholder over and over. You can cut down the amount of text by using the **with** tag. - - {{#with Customer.Address}} - {{FirstName}} {{LastName}} - {{Line1}} - {{#if Line2}} - {{Line2}} - {{/if}} - {{#if Line3}} - {{Line3}} - {{/if}} - {{City}} {{State}}, {{ZipCode}} - {{/with}} - -Here, the `Customer.Address` property will be searched first for the placeholders. If a property cannot be found in the `Address` object, it will be searched for in the `Customer` object and on up. - -## The 'set' tag -**mustache#** provides limited support for variables through use of the `set` tag. Once a variable is declared, it is visible to all child scopes. Multiple definitions of a variable with the same name cannot be created within the same scope. In fact, I highly recommend making variable names unique to the entire template just to prevent unexpected behavior! - -The following example will print out "EvenOddEvenOdd" by toggling a variable called `even`: - - FormatCompiler compiler = new FormatCompiler(); - const string format = @"{{#set even}} - {{#each this}} - {{#if @even}} - Even - {{#else}} - Odd - {{/if}} - {{#set even}} - {{/each}}"; - Generator generator = compiler.Compile(format); - generator.ValueRequested += (sender, e) => - { - e.Value = !(bool)(e.Value ?? false); - }; - string result = generator.Render(new int[] { 0, 1, 2, 3 }); - -This code works by specifying a function to call whenever a value is needed for the `even` variable. The first time the function is called, `e.Value` will be null. All additional calls will hold the last known value of the variable. - -Notice that when you set the variable, you don't qualify it with an `@`. You only need the `@` when you request its value, like in the `if` statement above. - -You should attempt to limit your use of variables within templates. Instead, perform as many up-front calculations as possible and make sure your view model closely represents its final appearance. In this case, it would make more sense to first convert the array into strings of "Even" and "Odd". - - FormatCompiler compiler = new FormatCompiler(); - const string format = @"{{#each this}}{{this}}{{/each}}"; - Generator generator = compiler.Compile(format); - string result = generator.Render(new string[] { "Even", "Odd", "Even", "Odd" }); - -This code is much easier to read and understand. It is also going to run significantly faster. In cases where you also need the original value, you can create an array containing objects with properties for the original value *and* `Even`/`Odd`. - -## Defining Your Own Tags -If you need to define your own tags, **mustache#** has everything you need. - -Once you define your own tags, you can register them with the compiler using the `RegisterTag` method. - - FormatCompiler compiler = new FormatCompiler(); - compiler.RegisterTag(myTag); - -Your tag can be referenced within the template by leading its name with a `#`. - -Custom tags can take any number of parameters. Parameters can have default values if you don't want to pass them all the time. Arguments are passed by specifying a placeholder. - -### Multi-line Tags -Here's an example of a tag that will make all of its content upper case: - - public class UpperTagDefinition : ContentTagDefinition - { - public UpperTagDefinition() - : base("upper") - { - } - - public override IEnumerable GetChildContext(TextWriter writer, KeyScope scope, Dictionary arguments) - { - NestedContext context = new NestedContext() - { - KeyScope = scope, - Writer = new StringWriter(), - WriterNeedsConsolidated = true, - }; - yield return context; - } - - public override string ConsolidateWriter(TextWriter writer, Dictionary arguments) - { - return writer.ToString().ToUpperInvariant(); - } - } - -Another solution is to wrap the given TextWriter with another TextWriter that will change the case of the strings passed to it. This approach requires more work, but would be more efficient. You should attempt to wrap or reuse the text writer passed to the tag. - -### In-line Tags -Here's an example of a tag that will join the items of a collection: - - public class JoinTagDefinition : InlineTagDefinition - { - public JoinTagDefinition() - : base("join") - { - } - - protected override IEnumerable GetParameters() - { - return new TagParameter[] { new TagParameter("collection") }; - } - - protected override void GetText(TextWriter writer, Dictionary arguments) - { - IEnumerable collection = (IEnumerable)arguments["collection"]; - string joined = String.Join(", ", collection.Cast().Select(o => o.ToString())); - writer.Write(joined); - } - } - -## License -If you are looking for a license, you won't find one. The software in this project is free, as in "free as air". Feel free to use my software anyway you like. Use it to build up your evil war machine, swindle old people out of their social security or crush the souls of the innocent. - -I love to hear how people are using my code, so drop me a line. Feel free to contribute any enhancements or documentation you may come up with, but don't feel obligated. I just hope this code makes someone's life just a little bit easier. diff --git a/OSS/mustache-sharp/mustache-sharp.sln b/OSS/mustache-sharp/mustache-sharp.sln deleted file mode 100644 index 9a026f2..0000000 --- a/OSS/mustache-sharp/mustache-sharp.sln +++ /dev/null @@ -1,29 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mustache-sharp", "mustache-sharp\mustache-sharp.csproj", "{D71B378F-A4BA-4263-A4F0-07A49A0C528D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mustache-sharp.test", "mustache-sharp.test\mustache-sharp.test.csproj", "{7F607362-0680-4751-B1DC-621219294AE3}" -EndProject -Global - GlobalSection(TestCaseManagementSettings) = postSolution - CategoryFile = mustache-sharp.vsmdi - EndGlobalSection - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D71B378F-A4BA-4263-A4F0-07A49A0C528D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D71B378F-A4BA-4263-A4F0-07A49A0C528D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D71B378F-A4BA-4263-A4F0-07A49A0C528D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D71B378F-A4BA-4263-A4F0-07A49A0C528D}.Release|Any CPU.Build.0 = Release|Any CPU - {7F607362-0680-4751-B1DC-621219294AE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7F607362-0680-4751-B1DC-621219294AE3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7F607362-0680-4751-B1DC-621219294AE3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7F607362-0680-4751-B1DC-621219294AE3}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/OSS/mustache-sharp/mustache-sharp.test/FormatCompilerTester.cs b/OSS/mustache-sharp/mustache-sharp.test/FormatCompilerTester.cs deleted file mode 100644 index 0833b4a..0000000 --- a/OSS/mustache-sharp/mustache-sharp.test/FormatCompilerTester.cs +++ /dev/null @@ -1,1559 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Mustache.Test -{ - /// - /// Tests the FormatParser class. - /// - [TestClass] - public class FormatCompilerTester - { - #region Tagless Formats - - /// - /// If the given format is null, an exception should be thrown. - /// - [TestMethod] - [ExpectedException(typeof(ArgumentNullException))] - public void TestCompile_NullFormat_Throws() - { - FormatCompiler compiler = new FormatCompiler(); - compiler.Compile(null); - } - - /// - /// If the format string contains no tag, then the given format string - /// should be printed. - /// - [TestMethod] - public void TestCompile_NoTags_PrintsFormatString() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = "This is an ordinary string."; - Generator generator = compiler.Compile(format); - string result = generator.Render(null); - Assert.AreEqual(format, result, "The generated text was wrong."); - } - - /// - /// If a line is just whitespace, it should be printed out as is. - /// - [TestMethod] - public void TestCompile_LineAllWhitespace_PrintsWhitespace() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = "\t \t"; - Generator generator = compiler.Compile(format); - string result = generator.Render(null); - Assert.AreEqual(format, result, "The generated text was wrong."); - } - - /// - /// If a line has output, then the next line is blank, then both lines - /// should be printed. - /// - [TestMethod] - public void TestCompile_OutputNewLineBlank_PrintsBothLines() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"Hello{{#newline}} - "; - - const string expected = @"Hello - "; - Generator generator = compiler.Compile(format); - string result = generator.Render(null); - Assert.AreEqual(expected, result, "The wrong text was generated."); - } - - #endregion - - #region Key - - /// - /// Replaces placeholds with the actual value. - /// - [TestMethod] - public void TestCompile_Key_ReplacesWithValue() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"Hello, {{Name}}!!!"; - Generator generator = compiler.Compile(format); - string result = generator.Render(new { Name = "Bob" }); - Assert.AreEqual("Hello, Bob!!!", result, "The wrong text was generated."); - } - - /// - /// If we pass null as the source object and the format string contains "this", - /// then nothing should be printed. - /// - [TestMethod] - public void TestCompile_ThisIsNull_PrintsNothing() - { - FormatCompiler compiler = new FormatCompiler(); - Generator generator = compiler.Compile("{{this}}"); - string result = generator.Render(null); - Assert.AreEqual(String.Empty, result, "The wrong text was generated."); - } - - /// - /// If we try to print a key that doesn't exist, an exception should be thrown. - /// - [TestMethod] - [ExpectedException(typeof(KeyNotFoundException))] - public void TestCompile_MissingKey_Throws() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"Hello, {{Name}}!!!"; - Generator generator = compiler.Compile(format); - generator.Render(new object()); - } - - /// - /// If we try to print a key that doesn't exist, we can provide a - /// handler to provide a substitute. - /// - [TestMethod] - public void TestCompile_MissingKey_CallsKeyNotFoundHandler() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"Hello, {{Name}}!!!"; - Generator generator = compiler.Compile(format); - generator.KeyNotFound += (obj, args) => - { - args.Substitute = "Unknown"; - args.Handled = true; - }; - string actual = generator.Render(new object()); - string expected = "Hello, Unknown!!!"; - Assert.AreEqual(expected, actual, "The wrong message was generated."); - } - - /// - /// If the key is the parent object, the search will go up the hierarchy. - /// - [TestMethod] - public void TestCompile_KeyInParent_LooksUpKeyInParent() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"{{#with Address}}{{FirstName}} from {{City}}{{/with}}"; - Generator generator = compiler.Compile(format); - string actual = generator.Render(new - { - FirstName = "Bob", - Address = new - { - City = "Philadelphia", - } - }); - string expected = "Bob from Philadelphia"; - Assert.AreEqual(expected, actual, "The wrong message was generated."); - } - - /// - /// If part of a key is wrong, the full details should be provided. - /// - [TestMethod] - public void TestCompile_MultipartKey_PartMissing_ProvidesFullDetail() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"{{Customer.Name}}"; - Generator generator = compiler.Compile(format); - generator.KeyNotFound += (obj, args) => - { - args.Substitute = args.Key + "," + args.MissingMember; - args.Handled = true; - }; - string actual = generator.Render(new - { - Customer = new - { - FirstName = "Bob" - } - }); - string expected = "Customer.Name,Name"; - Assert.AreEqual(expected, actual, "The wrong message was generated."); - } - - /// - /// If we specify an alignment with a key, the alignment should - /// be used when rending the value. - /// - [TestMethod] - public void TestCompile_KeyWithNegativeAlignment_AppliesAlignment() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"Hello, {{Name,-10}}!!!"; - Generator generator = compiler.Compile(format); - string result = generator.Render(new { Name = "Bob" }); - Assert.AreEqual("Hello, Bob !!!", result, "The wrong text was generated."); - } - - /// - /// If we specify an alignment with a key, the alignment should - /// be used when rending the value. - /// - [TestMethod] - public void TestCompile_KeyWithPositiveAlignment_AppliesAlignment() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"Hello, {{Name,10}}!!!"; - Generator generator = compiler.Compile(format); - string result = generator.Render(new { Name = "Bob" }); - Assert.AreEqual("Hello, Bob!!!", result, "The wrong text was generated."); - } - - /// - /// If we specify a positive alignment with a key with an optional + character, - /// the alignment should be used when rending the value. - /// - [TestMethod] - public void TestCompile_KeyWithPositiveAlignment_OptionalPlus_AppliesAlignment() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"Hello, {{Name,+10}}!!!"; - Generator generator = compiler.Compile(format); - string result = generator.Render(new { Name = "Bob" }); - Assert.AreEqual("Hello, Bob!!!", result, "The wrong text was generated."); - } - - /// - /// If we specify an format with a key, the format should - /// be used when rending the value. - /// - [TestMethod] - public void TestCompile_KeyWithFormat_AppliesFormatting() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"Hello, {{When:yyyyMMdd}}!!!"; - Generator generator = compiler.Compile(format); - string result = generator.Render(new { When = new DateTime(2012, 01, 31) }); - Assert.AreEqual("Hello, 20120131!!!", result, "The wrong text was generated."); - } - - /// - /// If we specify an alignment with a key, the alignment should - /// be used when rending the value. - /// - [TestMethod] - public void TestCompile_KeyWithAlignmentAndFormat_AppliesBoth() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"Hello, {{When,10:yyyyMMdd}}!!!"; - Generator generator = compiler.Compile(format); - string result = generator.Render(new { When = new DateTime(2012, 01, 31) }); - Assert.AreEqual("Hello, 20120131!!!", result, "The wrong text was generated."); - } - - /// - /// If we dot separate keys, the value will be found by searching - /// through the properties. - /// - [TestMethod] - public void TestCompile_NestedKeys_NestedProperties() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"Hello, {{Top.Middle.Bottom}}!!!"; - Generator generator = compiler.Compile(format); - string result = generator.Render(new { Top = new { Middle = new { Bottom = "Bob" } } }); - Assert.AreEqual("Hello, Bob!!!", result, "The wrong text was generated."); - } - - /// - /// If a line has output, then the next line is blank, then both lines - /// should be printed. - /// - [TestMethod] - public void TestCompile_OutputNewLineOutput_PrintsBothLines() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"{{this}}{{#newline}} -After"; - Generator generator = compiler.Compile(format); - string result = generator.Render("Content"); - const string expected = @"Content -After"; - Assert.AreEqual(expected, result, "The wrong text was generated."); - } - - /// - /// If there is a line followed by a line with a key, both lines should be - /// printed. - /// - [TestMethod] - public void TestCompile_EmptyNewLineKey_PrintsBothLines() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"{{#newline}} -{{this}}"; - Generator generator = compiler.Compile(format); - string result = generator.Render("Content"); - const string expected = @" -Content"; - Assert.AreEqual(expected, result, "The wrong text was generated."); - } - - /// - /// If there is a no-output line followed by a line with a key, the first line - /// should be removed. - /// - [TestMethod] - public void TestCompile_NoOutputNewLineKey_PrintsBothLines() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"{{#! comment }} -{{this}}"; - Generator generator = compiler.Compile(format); - string result = generator.Render("Content"); - const string expected = @"Content"; - Assert.AreEqual(expected, result, "The wrong text was generated."); - } - - /// - /// If there is a comment on one line followed by a line with a key, the first line - /// should be removed. - /// - [TestMethod] - public void TestCompile_KeyKey_PrintsBothLines() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"{{this}}{{#newline}} -{{this}}"; - Generator generator = compiler.Compile(format); - string result = generator.Render("Content"); - const string expected = @"Content -Content"; - Assert.AreEqual(expected, result, "The wrong text was generated."); - } - - /// - /// We can track all of the keys that appear in a template by - /// registering with the PlaceholderFound event. - /// - [TestMethod] - public void TestCompile_FindsPlaceholders_RecordsPlaceholders() - { - FormatCompiler compiler = new FormatCompiler(); - HashSet keys = new HashSet(); - compiler.PlaceholderFound += (o, e) => - { - keys.Add(e.Key); - }; - compiler.Compile(@"{{FirstName}} {{LastName}}"); - string[] expected = new string[] { "FirstName", "LastName" }; - string[] actual = keys.OrderBy(s => s).ToArray(); - CollectionAssert.AreEqual(expected, actual, "Not all placeholders were found."); - } - - /// - /// We can track all of the keys that appear in a template by - /// registering with the PlaceholderFound event. - /// - [TestMethod] - public void TestCompile_FindsVariables_RecordsVariables() - { - FormatCompiler compiler = new FormatCompiler(); - HashSet variables = new HashSet(); - compiler.VariableFound += (o, e) => - { - variables.Add(e.Name); - }; - compiler.Compile(@"{{@FirstName}}{{@LastName}}"); - string[] expected = new string[] { "FirstName", "LastName" }; - string[] actual = variables.OrderBy(s => s).ToArray(); - CollectionAssert.AreEqual(expected, actual, "Not all variables were found."); - } - - /// - /// We can track all of the keys that appear in a template by - /// registering with the PlaceholderFound event. - /// - [TestMethod] - public void TestCompile_FindsPlaceholdersInIf_RecordsPlaceholders() - { - FormatCompiler compiler = new FormatCompiler(); - HashSet keys = new HashSet(); - compiler.PlaceholderFound += (o, e) => - { - keys.Add(e.Key); - }; - compiler.Compile(@"{{#if FirstName}}{{/if}}"); - string[] expected = new string[] { "FirstName" }; - string[] actual = keys.OrderBy(s => s).ToArray(); - CollectionAssert.AreEqual(expected, actual, "Not all placeholders were found."); - } - - /// - /// We can track all of the keys that appear in a template by - /// registering with the PlaceholderFound event. - /// - [TestMethod] - public void TestCompile_FindsVariablesInIf_RecordsVariables() - { - FormatCompiler compiler = new FormatCompiler(); - HashSet variables = new HashSet(); - compiler.VariableFound += (o, e) => - { - variables.Add(e.Name); - }; - compiler.Compile(@"{{#if @FirstName}}{{/if}}"); - string[] expected = new string[] { "FirstName" }; - string[] actual = variables.OrderBy(s => s).ToArray(); - CollectionAssert.AreEqual(expected, actual, "Not all placeholders were found."); - } - - /// - /// We can determine the context in which a placeholder is found by looking at the provided context array. - /// - [TestMethod] - public void TestCompile_FindsPlaceholders_ProvidesContext() - { - FormatCompiler compiler = new FormatCompiler(); - Context[] context = null; - compiler.PlaceholderFound += (o, e) => - { - context = e.Context; - }; - compiler.Compile(@"{{#with Address}}{{ZipCode}}{{/with}}"); - - Assert.IsNotNull(context, "The context was not set."); - Assert.AreEqual(2, context.Length, "The context did not contain the right number of items."); - - Assert.AreEqual(String.Empty, context[0].TagName, "The top-most context had the wrong tag type."); - Assert.AreEqual("with", context[1].TagName, "The bottom context had the wrong tag type."); - - Assert.AreEqual(0, context[0].Parameters.Length, "The top-most context had the wrong number of parameters."); - Assert.AreEqual(1, context[1].Parameters.Length, "The bottom context had the wrong number of parameters."); - Assert.AreEqual("Address", context[1].Parameters[0].Argument, "The bottom context had the wrong argument."); - } - - /// - /// I was leaving behind context even after reaching a closing tag. We need to make sure - /// that context is like a call stack and that it is cleaned up after leaving the context. - /// - [TestMethod] - public void TestCompile_ExitContext_RemoveContext() - { - FormatCompiler compiler = new FormatCompiler(); - Context[] context = null; - compiler.PlaceholderFound += (o, e) => - { - context = e.Context; - }; - compiler.Compile(@"{{#with Address}}{{/with}}{{FirstName}}"); - - Assert.IsNotNull(context, "The context was not set."); - Assert.AreEqual(1, context.Length, "The context did not contain the right number of items."); - - Assert.AreEqual(String.Empty, context[0].TagName, "The top-most context had the wrong tag type."); - } - - /// - /// If a key refers to a public field, its value should be substituted in the output. - /// - [TestMethod] - public void TestGenerate_KeyRefersToPublicField_SubstitutesValue() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"Hello, {{Field}}!!!"; - Generator generator = compiler.Compile(format); - ClassWithPublicField instance = new ClassWithPublicField() { Field = "Bob" }; - string result = generator.Render(instance); - Assert.AreEqual("Hello, Bob!!!", result, "The wrong text was generated."); - } - - public class ClassWithPublicField - { - public string Field; - } - - /// - /// If a derived class replaces a property/field in the base class (via new) - /// it should be used, instead of causing an exception or using the base's - /// property/field. - /// - [TestMethod] - public void TestGenerate_NewPropertyInDerivedClass_UsesDerivedProperty() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"Hello, {{Value}}!!!"; - Generator generator = compiler.Compile(format); - DerivedClass instance = new DerivedClass() { Value = "Derived" }; - string result = generator.Render(instance); - Assert.AreEqual("Hello, Derived!!!", result, "The wrong text was generated."); - } - - public class BaseClass - { - public int Value { get; set; } - } - - public class DerivedClass : BaseClass - { - public DerivedClass() - { - base.Value = 1; - } - - public new string Value { get; set; } - } - - /// - /// If a derived class replaces a property/field in the base class (via new) - /// it should be used, instead of causing an exception or using the base's - /// property/field. - /// - [TestMethod] - public void TestGenerate_NewPropertyInGenericDerivedClass_UsesDerivedProperty() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"Hello, {{Value}}!!!"; - Generator generator = compiler.Compile(format); - DerivedClass instance = new DerivedClass() { Value = "Derived" }; - string result = generator.Render(instance); - Assert.AreEqual("Hello, Derived!!!", result, "The wrong text was generated."); - } - - public class DerivedClass : BaseClass - { - public DerivedClass() - { - base.Value = 1; - } - - public new T Value { get; set; } - } - - #endregion - - #region Comment - - /// - /// Removes comments from the middle of text. - /// - [TestMethod] - public void TestCompile_Comment_RemovesComment() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = "Before{{#! This is a comment }}After"; - Generator generator = compiler.Compile(format); - string result = generator.Render(new object()); - Assert.AreEqual("BeforeAfter", result, "The wrong text was generated."); - } - - /// - /// Removes comments surrounding text. - /// - [TestMethod] - public void TestCompile_CommentContentComment_RemovesComment() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = "{{#! comment }}Middle{{#! comment }}"; - Generator generator = compiler.Compile(format); - string result = generator.Render(new object()); - Assert.AreEqual("Middle", result, "The wrong text was generated."); - } - - /// - /// If blank space is surrounded by comments, the line should be removed. - /// - [TestMethod] - public void TestCompile_CommentBlankComment_RemovesLine() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = "{{#! comment }} {{#! comment }}"; - Generator generator = compiler.Compile(format); - string result = generator.Render(new object()); - Assert.AreEqual(" ", result, "The wrong text was generated."); - } - - /// - /// If a comment follows text, the comment should be removed. - /// - [TestMethod] - public void TestCompile_ContentComment_RemovesComment() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = "Front{{#! comment }}"; - Generator generator = compiler.Compile(format); - string result = generator.Render(new object()); - Assert.AreEqual("Front", result, "The wrong text was generated."); - } - - /// - /// If a comment follows text, the comment should be removed. - /// - [TestMethod] - public void TestCompile_ContentCommentContentComment_RemovesComments() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = "Front{{#! comment }}Middle{{#! comment }}"; - Generator generator = compiler.Compile(format); - string result = generator.Render(new object()); - Assert.AreEqual("FrontMiddle", result, "The wrong text was generated."); - } - - /// - /// If a comment makes up the entire format string, the nothing should be printed out. - /// - [TestMethod] - public void TestCompile_CommentAloneOnlyLine_PrintsSurroundingSpace() - { - FormatCompiler compiler = new FormatCompiler(); - Generator generator = compiler.Compile(" {{#! comment }} "); - string result = generator.Render(null); - Assert.AreEqual(" ", result, "The wrong text was generated."); - } - - /// - /// If a comment is on a line by itself, irrespective of leading or trailing whitespace, - /// the line should be removed from output. - /// - [TestMethod] - public void TestCompile_ContentNewLineCommentNewLineContent_RemovesLine() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"Before - {{#! This is a comment }} -After"; - Generator generator = compiler.Compile(format); - string result = generator.Render(new object()); - const string expected = @"Before After"; - Assert.AreEqual(expected, result, "The wrong text was generated."); - } - - /// - /// If multiple comments are on a line by themselves, irrespective of whitespace, - /// the line should be removed from output. - /// - [TestMethod] - public void TestCompile_ContentNewLineCommentCommentNewLineContent_RemovesLine() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"Before - {{#! This is a comment }} {{#! This is another comment }} -After"; - Generator generator = compiler.Compile(format); - string result = generator.Render(new object()); - const string expected = @"Before After"; - Assert.AreEqual(expected, result, "The wrong text was generated."); - } - - /// - /// If comments are on a multiple lines by themselves, irrespective of whitespace, - /// the lines should be removed from output. - /// - [TestMethod] - public void TestCompile_CommentsOnMultipleLines_RemovesLines() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"Before - {{#! This is a comment }} - {{#! This is another comment }} - {{#newline}} - {{#! This is the final comment }} -After"; - Generator generator = compiler.Compile(format); - string result = generator.Render(new object()); - const string expected = @"Before - After"; - Assert.AreEqual(expected, result, "The wrong text was generated."); - } - - /// - /// If a comment is followed by text, the line should be printed. - /// - [TestMethod] - public void TestCompile_ContentNewLineCommentContentNewLineContent_PrintsLine() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"Before - {{#! This is a comment }}Extra -After"; - Generator generator = compiler.Compile(format); - string result = generator.Render(new object()); - const string expected = @"Before ExtraAfter"; - Assert.AreEqual(expected, result, "The wrong text was generated."); - } - - /// - /// If a comment is followed by the last line in a format string, - /// the comment line should be eliminated and the last line printed. - /// - [TestMethod] - public void TestCompile_CommentNewLineBlank_PrintsBlank() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @" {{#! comment }} - "; - Generator generator = compiler.Compile(format); - string result = generator.Render(null); - Assert.AreEqual(" ", result, "The wrong text was generated."); - } - - /// - /// If a comment is followed by the last line in a format string, - /// the comment line should be eliminated and the last line printed. - /// - [TestMethod] - public void TestCompile_CommentNewLineContent_PrintsContent() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @" {{#! comment }} -After"; - Generator generator = compiler.Compile(format); - string result = generator.Render(null); - Assert.AreEqual(" After", result, "The wrong text was generated."); - } - - /// - /// If a line with content is followed by a line with a comment, the first line should - /// be printed. - /// - [TestMethod] - public void TestCompile_ContentNewLineComment_PrintsContent() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"First -{{#! comment }}"; - Generator generator = compiler.Compile(format); - string result = generator.Render(null); - Assert.AreEqual("First", result, "The wrong text was generated."); - } - - /// - /// If a line has a comment, followed by line with content, followed by a line with a comment, only - /// the content should be printed. - /// - [TestMethod] - public void TestCompile_CommentNewLineContentNewLineComment_PrintsContent() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"{{#! comment }} -First -{{#! comment }}"; - Generator generator = compiler.Compile(format); - string result = generator.Render(null); - Assert.AreEqual("First", result, "The wrong text was generated."); - } - - /// - /// If there are lines with content, then a comment, then content, then a comment, only - /// the content should be printed. - /// - [TestMethod] - public void TestCompile_ContentNewLineCommentNewLineContentNewLineComment_PrintsContent() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"First{{#newline}} -{{#! comment }} -Middle -{{#! comment }}"; - Generator generator = compiler.Compile(format); - string result = generator.Render(null); - const string expected = @"First -Middle"; - Assert.AreEqual(expected, result, "The wrong text was generated."); - } - - /// - /// If there is content and a comment on a line, followed by a comment, - /// only the content should be printed. - /// - [TestMethod] - public void TestCompile_ContentCommentNewLineComment_PrintsContent() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"First{{#! comment }} -{{#! comment }}"; - Generator generator = compiler.Compile(format); - string result = generator.Render(null); - Assert.AreEqual("First", result, "The wrong text was generated."); - } - - #endregion - - #region If - - /// - /// If the condition evaluates to false, the content of an if statement should not be printed. - /// - [TestMethod] - public void TestCompile_If_EvaluatesToFalse_SkipsContent() - { - FormatCompiler parser = new FormatCompiler(); - const string format = "Before{{#if this}}Content{{/if}}After"; - Generator generator = parser.Compile(format); - string result = generator.Render(false); - Assert.AreEqual("BeforeAfter", result, "The wrong text was generated."); - } - - /// - /// If the condition evaluates to false, the content of an if statement should not be printed. - /// - [TestMethod] - public void TestCompile_If_null_SkipsContent() - { - FormatCompiler parser = new FormatCompiler(); - const string format = "Before{{#if this}}Content{{/if}}After"; - Generator generator = parser.Compile(format); - string result = generator.Render(null); - Assert.AreEqual("BeforeAfter", result, "The wrong text was generated."); - } - - /// - /// If the condition evaluates to false, the content of an if statement should not be printed. - /// - [TestMethod] - public void TestCompile_If_DBNull_SkipsContent() - { - FormatCompiler parser = new FormatCompiler(); - const string format = "Before{{#if this}}Content{{/if}}After"; - Generator generator = parser.Compile(format); - string result = generator.Render(DBNull.Value); - Assert.AreEqual("BeforeAfter", result, "The wrong text was generated."); - } - - /// - /// If the condition evaluates to false, the content of an if statement should not be printed. - /// - [TestMethod] - public void TestCompile_If_EmptyIEnumerable_SkipsContent() - { - FormatCompiler parser = new FormatCompiler(); - const string format = "Before{{#if this}}Content{{/if}}After"; - Generator generator = parser.Compile(format); - string result = generator.Render(Enumerable.Empty()); - Assert.AreEqual("BeforeAfter", result, "The wrong text was generated."); - } - - /// - /// If the condition evaluates to false, the content of an if statement should not be printed. - /// - [TestMethod] - public void TestCompile_If_NullChar_SkipsContent() - { - FormatCompiler parser = new FormatCompiler(); - const string format = "Before{{#if this}}Content{{/if}}After"; - Generator generator = parser.Compile(format); - string result = generator.Render('\0'); - Assert.AreEqual("BeforeAfter", result, "The wrong text was generated."); - } - - /// - /// If the condition evaluates to false, the content of an if statement should not be printed. - /// - [TestMethod] - public void TestCompile_If_ZeroInt_SkipsContent() - { - FormatCompiler parser = new FormatCompiler(); - const string format = "Before{{#if this}}Content{{/if}}After"; - Generator generator = parser.Compile(format); - string result = generator.Render(0); - Assert.AreEqual("BeforeAfter", result, "The wrong text was generated."); - } - - /// - /// If the condition evaluates to false, the content of an if statement should not be printed. - /// - [TestMethod] - public void TestCompile_If_ZeroFloat_SkipsContent() - { - FormatCompiler parser = new FormatCompiler(); - const string format = "Before{{#if this}}Content{{/if}}After"; - Generator generator = parser.Compile(format); - string result = generator.Render(0f); - Assert.AreEqual("BeforeAfter", result, "The wrong text was generated."); - } - - /// - /// If the condition evaluates to false, the content of an if statement should not be printed. - /// - [TestMethod] - public void TestCompile_If_ZeroDouble_SkipsContent() - { - FormatCompiler parser = new FormatCompiler(); - const string format = "Before{{#if this}}Content{{/if}}After"; - Generator generator = parser.Compile(format); - string result = generator.Render(0.0); - Assert.AreEqual("BeforeAfter", result, "The wrong text was generated."); - } - - /// - /// If the condition evaluates to false, the content of an if statement should not be printed. - /// - [TestMethod] - public void TestCompile_If_ZeroDecimal_SkipsContent() - { - FormatCompiler parser = new FormatCompiler(); - const string format = "Before{{#if this}}Content{{/if}}After"; - Generator generator = parser.Compile(format); - string result = generator.Render(0m); - Assert.AreEqual("BeforeAfter", result, "The wrong text was generated."); - } - - /// - /// If the condition evaluates to false, the content of an if statement should not be printed. - /// - [TestMethod] - public void TestCompile_If_EvaluatesToTrue_PrintsContent() - { - FormatCompiler parser = new FormatCompiler(); - const string format = "Before{{#if this}}Content{{/if}}After"; - Generator generator = parser.Compile(format); - string result = generator.Render(true); - Assert.AreEqual("BeforeContentAfter", result, "The wrong text was generated."); - } - - /// - /// If the header and footer appear on lines by themselves, they should not generate new lines. - /// - [TestMethod] - public void TestCompile_IfNewLineContentNewLineEndIf_PrintsContent() - { - FormatCompiler parser = new FormatCompiler(); - const string format = @"{{#if this}} -Content -{{/if}}"; - Generator generator = parser.Compile(format); - string result = generator.Render(true); - Assert.AreEqual("Content", result, "The wrong text was generated."); - } - - /// - /// If the header and footer appear on lines by themselves, they should not generate new lines. - /// - [TestMethod] - public void TestCompile_IfNewLineEndIf_PrintsNothing() - { - FormatCompiler parser = new FormatCompiler(); - const string format = @"{{#if this}} -{{/if}}"; - Generator generator = parser.Compile(format); - string result = generator.Render(true); - Assert.AreEqual(String.Empty, result, "The wrong text was generated."); - } - - /// - /// If the footer has content in front of it, the content should be printed. - /// - [TestMethod] - public void TestCompile_IfNewLineContentEndIf_PrintsContent() - { - FormatCompiler parser = new FormatCompiler(); - const string format = @"{{#if this}} -Content{{/if}}"; - Generator generator = parser.Compile(format); - string result = generator.Render(true); - Assert.AreEqual("Content", result, "The wrong text was generated."); - } - - /// - /// If the header has content after it, the content should be printed. - /// - [TestMethod] - public void TestCompile_IfContentNewLineEndIf_PrintsContent() - { - FormatCompiler parser = new FormatCompiler(); - const string format = @"{{#if this}}Content -{{/if}}"; - Generator generator = parser.Compile(format); - string result = generator.Render(true); - Assert.AreEqual("Content", result, "The wrong text was generated."); - } - - /// - /// If the header has content after it, the content should be printed. - /// - [TestMethod] - public void TestCompile_ContentIfNewLineEndIf_PrintsContent() - { - FormatCompiler parser = new FormatCompiler(); - const string format = @"Content{{#if this}} -{{/if}}"; - Generator generator = parser.Compile(format); - string result = generator.Render(true); - Assert.AreEqual("Content", result, "The wrong text was generated."); - } - - /// - /// If the header and footer are adjacent, then there is no content. - /// - [TestMethod] - public void TestCompile_IfEndIf_PrintsNothing() - { - FormatCompiler parser = new FormatCompiler(); - const string format = @"{{#if this}}{{/if}}"; - Generator generator = parser.Compile(format); - string result = generator.Render(true); - Assert.AreEqual(String.Empty, result, "The wrong text was generated."); - } - - /// - /// If the header and footer are adjacent, then there is no inner content. - /// - [TestMethod] - public void TestCompile_ContentIfEndIf_PrintsNothing() - { - FormatCompiler parser = new FormatCompiler(); - const string format = @"Content{{#if this}}{{/if}}"; - Generator generator = parser.Compile(format); - string result = generator.Render(true); - Assert.AreEqual("Content", result, "The wrong text was generated."); - } - - /// - /// If the header and footer are adjacent, then there is no inner content. - /// - [TestMethod] - public void TestCompile_IfNewLineCommentEndIf_PrintsNothing() - { - FormatCompiler parser = new FormatCompiler(); - const string format = @"{{#if this}} -{{#! comment}}{{/if}}"; - Generator generator = parser.Compile(format); - string result = generator.Render(true); - Assert.AreEqual(String.Empty, result, "The wrong text was generated."); - } - - /// - /// If the a header follows a footer, it shouldn't generate a new line. - /// - [TestMethod] - public void TestCompile_IfNewLineContentNewLineEndIfIfNewLineContentNewLineEndIf_PrintsContent() - { - FormatCompiler parser = new FormatCompiler(); - const string format = @"{{#if this}} -First -{{/if}}{{#if this}} -{{#newline}} -Last -{{/if}}"; - Generator generator = parser.Compile(format); - string result = generator.Render(true); - const string expected = @"First -Last"; - Assert.AreEqual(expected, result, "The wrong text was generated."); - } - - /// - /// If the content separates two if statements, it should be unaffected. - /// - [TestMethod] - public void TestCompile_IfNewLineEndIfNewLineContentNewLineIfNewLineEndIf_PrintsContent() - { - FormatCompiler parser = new FormatCompiler(); - const string format = @"{{#if this}} -{{/if}} -Content -{{#if this}} -{{/if}}"; - Generator generator = parser.Compile(format); - string result = generator.Render(true); - const string expected = @"Content"; - Assert.AreEqual(expected, result, "The wrong text was generated."); - } - - /// - /// If there is trailing text of any kind, the newline after content should be preserved. - /// - [TestMethod] - public void TestCompile_IfNewLineEndIfNewLineContentNewLineIfNewLineEndIfContent_PrintsContent() - { - FormatCompiler parser = new FormatCompiler(); - const string format = @"{{#if this}} -{{/if}} -First -{{#newline}} -{{#if this}} -{{/if}} -Last"; - Generator generator = parser.Compile(format); - string result = generator.Render(true); - const string expected = @"First -Last"; - Assert.AreEqual(expected, result, "The wrong text was generated."); - } - - #endregion - - #region If/Else - - /// - /// If the condition evaluates to false, the content of an else statement should be printed. - /// - [TestMethod] - public void TestCompile_IfElse_EvaluatesToFalse_PrintsElse() - { - FormatCompiler parser = new FormatCompiler(); - const string format = "Before{{#if this}}Yay{{#else}}Nay{{/if}}After"; - Generator generator = parser.Compile(format); - string result = generator.Render(false); - Assert.AreEqual("BeforeNayAfter", result, "The wrong text was generated."); - } - - /// - /// If the condition evaluates to true, the content of an if statement should be printed. - /// - [TestMethod] - public void TestCompile_IfElse_EvaluatesToTrue_PrintsIf() - { - FormatCompiler parser = new FormatCompiler(); - const string format = "Before{{#if this}}Yay{{#else}}Nay{{/if}}After"; - Generator generator = parser.Compile(format); - string result = generator.Render(true); - Assert.AreEqual("BeforeYayAfter", result, "The wrong text was generated."); - } - - /// - /// Second else blocks will result in an exceptions being thrown. - /// - [TestMethod] - [ExpectedException(typeof(FormatException))] - public void TestCompile_IfElse_TwoElses_IncludesSecondElseInElse_Throws() - { - FormatCompiler parser = new FormatCompiler(); - const string format = "Before{{#if this}}Yay{{#else}}Nay{{#else}}Bad{{/if}}After"; - Generator generator = parser.Compile(format); - string result = generator.Render(false); - Assert.AreEqual("BeforeNay{{#else}}BadAfter", result, "The wrong text was generated."); - } - - #endregion - - #region If/Elif/Else - - /// - /// If the if statement evaluates to true, its block should be printed. - /// - [TestMethod] - public void TestCompile_IfElifElse_IfTrue_PrintsIf() - { - FormatCompiler parser = new FormatCompiler(); - const string format = "Before{{#if First}}First{{#elif Second}}Second{{#else}}Third{{/if}}After"; - Generator generator = parser.Compile(format); - string result = generator.Render(new { First = true, Second = true }); - Assert.AreEqual("BeforeFirstAfter", result, "The wrong text was generated."); - } - - /// - /// If the elif statement evaluates to true, its block should be printed. - /// - [TestMethod] - public void TestCompile_IfElifElse_ElifTrue_PrintsIf() - { - FormatCompiler parser = new FormatCompiler(); - const string format = "Before{{#if First}}First{{#elif Second}}Second{{#else}}Third{{/if}}After"; - Generator generator = parser.Compile(format); - string result = generator.Render(new { First = false, Second = true }); - Assert.AreEqual("BeforeSecondAfter", result, "The wrong text was generated."); - } - - /// - /// If the elif statement evaluates to false, the else block should be printed. - /// - [TestMethod] - public void TestCompile_IfElifElse_ElifFalse_PrintsElse() - { - FormatCompiler parser = new FormatCompiler(); - const string format = "Before{{#if First}}First{{#elif Second}}Second{{#else}}Third{{/if}}After"; - Generator generator = parser.Compile(format); - string result = generator.Render(new { First = false, Second = false }); - Assert.AreEqual("BeforeThirdAfter", result, "The wrong text was generated."); - } - - #endregion - - #region If/Elif - - /// - /// If the elif statement evaluates to false and there is no else statement, nothing should be printed. - /// - [TestMethod] - public void TestCompile_IfElif_ElifFalse_PrintsNothing() - { - FormatCompiler parser = new FormatCompiler(); - const string format = "Before{{#if First}}First{{#elif Second}}Second{{/if}}After"; - Generator generator = parser.Compile(format); - string result = generator.Render(new { First = false, Second = false }); - Assert.AreEqual("BeforeAfter", result, "The wrong text was generated."); - } - - /// - /// If there are two elif statements and the first is false, the second elif block should be printed. - /// - [TestMethod] - public void TestCompile_IfElifElif_ElifFalse_PrintsSecondElif() - { - FormatCompiler parser = new FormatCompiler(); - const string format = "Before{{#if First}}First{{#elif Second}}Second{{#elif Third}}Third{{/if}}After"; - Generator generator = parser.Compile(format); - string result = generator.Render(new { First = false, Second = false, Third = true }); - Assert.AreEqual("BeforeThirdAfter", result, "The wrong text was generated."); - } - - #endregion - - #region Each - - /// - /// If we pass an empty collection to an each statement, the content should not be printed. - /// - [TestMethod] - public void TestCompile_Each_EmptyCollection_SkipsContent() - { - FormatCompiler parser = new FormatCompiler(); - const string format = "Before{{#each this}}{{this}}{{/each}}After"; - Generator generator = parser.Compile(format); - string result = generator.Render(new int[0]); - Assert.AreEqual("BeforeAfter", result, "The wrong text was generated."); - } - - /// - /// If we pass a populated collection to an each statement, the content should be printed - /// for each item in the collection, using that item as the new scope context. - /// - [TestMethod] - public void TestCompile_Each_PopulatedCollection_PrintsContentForEach() - { - FormatCompiler parser = new FormatCompiler(); - const string format = "Before{{#each this}}{{this}}{{/each}}After"; - Generator generator = parser.Compile(format); - string result = generator.Render(new int[] { 1, 2, 3 }); - Assert.AreEqual("Before123After", result, "The wrong text was generated."); - } - - /// - /// We can use the index tag to get the current iteration. - /// - [TestMethod] - public void TestCompile_Each_Index_PrintsIndexOfItem() - { - FormatCompiler parser = new FormatCompiler(); - const string format = "
    {{#each this}}
  • Item {{#index}}
  • {{/each}}
"; - Generator generator = parser.Compile(format); - string result = generator.Render(new int[] { 1, 2, 3 }); - const string expected = @"
  • Item 0
  • Item 1
  • Item 2
"; - Assert.AreEqual(expected, result, "The wrong text was generated."); - } - - /// - /// A bug was found where the index tag was trying to read the arguments for the next tag. - /// This was caused by the index tag chewing up more of the input than it was supposed to. - /// - [TestMethod] - public void TestCompile_Each_ContextAfterIndexTag() - { - List objects = new List(); - objects.Add(new TestObject { Name = "name1", Val = "val1" }); - objects.Add(new TestObject { Name = "name2", Val = "val2" }); - objects.Add(new TestObject { Name = "name3", Val = "val3" }); - - const string template = @"{{#each this}} -Item Number: {{#index}}
{{#newline}} -{{/each}} -{{#each this}} -Item Number: foo
{{#newline}} -{{/each}}"; - - FormatCompiler compiler = new FormatCompiler(); - Generator generator = compiler.Compile(template); - string actual = generator.Render(objects); - - const string expected = @"Item Number: 0
-Item Number: 1
-Item Number: 2
-Item Number: foo
-Item Number: foo
-Item Number: foo
-"; - - Assert.AreEqual(expected, actual, "The wrong text was found."); - } - - public class TestObject - { - public String Name { get; set; } - - public String Val { get; set; } - } - - #endregion - - #region With - - /// - /// The object replacing the placeholder should be used as the context of a with statement. - /// - [TestMethod] - public void TestCompile_With_AddsScope() - { - FormatCompiler parser = new FormatCompiler(); - const string format = "Before{{#with Nested}}{{this}}{{/with}}After"; - Generator generator = parser.Compile(format); - string result = generator.Render(new { Nested = "Hello" }); - Assert.AreEqual("BeforeHelloAfter", result, "The wrong text was generated."); - } - - #endregion - - #region Default Parameter - - /// - /// If a tag is defined with a default parameter, the default value - /// should be returned if an argument is not provided. - /// - [TestMethod] - public void TestCompile_MissingDefaultParameter_ProvidesDefault() - { - FormatCompiler compiler = new FormatCompiler(); - compiler.RegisterTag(new DefaultTagDefinition(), true); - const string format = @"{{#default}}"; - Generator generator = compiler.Compile(format); - string result = generator.Render(null); - Assert.AreEqual("123", result, "The wrong text was generated."); - } - - private sealed class DefaultTagDefinition : InlineTagDefinition - { - public DefaultTagDefinition() - : base("default") - { - } - - protected override IEnumerable GetParameters() - { - return new TagParameter[] { new TagParameter("param") { IsRequired = false, DefaultValue = 123 } }; - } - - public override void GetText(TextWriter writer, Dictionary arguments, Scope contextScope) - { - writer.Write(arguments["param"]); - } - } - - #endregion - - #region Compound Tags - - /// - /// If a format contains multiple tags, they should be handled just fine. - /// - [TestMethod] - public void TestCompile_MultipleTags() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"Hello {{Customer.FirstName}}: -{{#newline}} -{{#newline}} -{{#with Order}} -{{#if LineItems}} -Below are your order details: -{{#newline}} -{{#newline}} -{{#each LineItems}} - {{Name}}: {{UnitPrice:C}} x {{Quantity}}{{#newline}} -{{/each}} -{{#newline}} -Your order total was: {{Total:C}} -{{/if}} -{{/with}}"; - Generator generator = compiler.Compile(format); - string result = generator.Render(new - { - Customer = new { FirstName = "Bob" }, - Order = new - { - Total = 7.50m, - LineItems = new object[] - { - new { Name = "Banana", UnitPrice = 2.50m, Quantity = 1 }, - new { Name = "Orange", UnitPrice = .50m, Quantity = 5 }, - new { Name = "Apple", UnitPrice = .25m, Quantity = 10 }, - } - } - }); - const string expected = @"Hello Bob: - -Below are your order details: - - Banana: $2.50 x 1 - Orange: $0.50 x 5 - Apple: $0.25 x 10 - -Your order total was: $7.50"; - Assert.AreEqual(expected, result, "The wrong text was generated."); - } - - #endregion - - #region Unknown Tags - - /// - /// If an unknown tag is encountered, an exception should be thrown. - /// - [TestMethod] - [ExpectedException(typeof(FormatException))] - public void TestCompile_UnknownTag() - { - FormatCompiler compiler = new FormatCompiler(); - compiler.Compile("{{#split Names}}"); - } - - #endregion - - #region Context Variables - - /// - /// We will use the index variable to determine whether or not to print out a line. - /// - [TestMethod] - public void TestCompile_CanUseContextVariablesToMakeDecisions() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"{{#each this}}{{#if @index}}{{#index}}{{/if}}{{/each}}"; - Generator generator = compiler.Compile(format); - string actual = generator.Render(new int[] { 1, 1, 1, 1, }); - string expected = "123"; - Assert.AreEqual(expected, actual, "The numbers were not valid."); - } - - /// - /// I can set context variables to control the flow of the code generation. - /// - [TestMethod] - public void TestCompile_CanUseContextVariableToToggle() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"{{#set even}}{{#each this}}{{#if @even}}Even {{#else}}Odd {{/if}}{{#set even}}{{/each}}"; - Generator generator = compiler.Compile(format); - generator.ValueRequested += (sender, e) => - { - e.Value = !(bool)(e.Value ?? false); - }; - string actual = generator.Render(new int[] { 1, 1, 1, 1 }); - string expected = "Even Odd Even Odd "; - Assert.AreEqual(expected, actual, "The context variable was not toggled."); - } - - /// - /// I can set context variables to control the flow of the code generation. - /// It should even support nested context variables... for some reason. - /// - [TestMethod] - public void TestCompile_CanUseNestedContextVariableToToggle() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"{{#set this.variables.even}} -{{#each this}} -{{#if @variables.even}} -Even -{{#else}} -Odd -{{/if}} -{{#set variables.even}} -{{/each}}"; - Generator generator = compiler.Compile(format); - generator.ValueRequested += (sender, e) => - { - e.Value = !(bool)(e.Value ?? false); - }; - string actual = generator.Render(new int[] { 1, 1, 1, 1 }); - string expected = "EvenOddEvenOdd"; - Assert.AreEqual(expected, actual, "The context variable was not toggled."); - } - - #endregion - - #region New Line Management - - /// - /// If the compiler is configured to ignore new lines, - /// they should not be removed from the output. - /// - [TestMethod] - public void TestCompile_PreserveNewLines() - { - FormatCompiler compiler = new FormatCompiler(); - compiler.RemoveNewLines = false; - const string format = @"Hello - "; - - const string expected = @"Hello - "; - Generator generator = compiler.Compile(format); - string result = generator.Render(null); - Assert.AreEqual(expected, result, "The wrong text was generated."); - } - - #endregion - - #region Strings - - /// - /// We will use a string variable to determine whether or not to print out a line. - /// - [TestMethod] - public void TestCompile_StringArgument_PassedToTag() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"{{#if 'hello'}}Hello{{/if}}"; - Generator generator = compiler.Compile(format); - string actual = generator.Render(null); - string expected = "Hello"; - Assert.AreEqual(expected, actual, "The string was not passed to the formatter."); - } - - /// - /// We will use a string variable to determine whether or not to print out a line. - /// - [TestMethod] - public void TestCompile_EmptyStringArgument_PassedToTag() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"{{#if ''}}Hello{{/if}}"; - Generator generator = compiler.Compile(format); - string actual = generator.Render(null); - string expected = ""; - Assert.AreEqual(expected, actual, "The string was not passed to the formatter."); - } - - #endregion - - #region Numbers - - /// - /// We will use a number variable to determine whether or not to print out a line. - /// - [TestMethod] - public void TestCompile_NumberArgument_PassedToTag() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"{{#if 4}}Hello{{/if}}"; - Generator generator = compiler.Compile(format); - string actual = generator.Render(null); - string expected = "Hello"; - Assert.AreEqual(expected, actual, "The number was not passed to the formatter."); - } - - /// - /// We will use a string variable to determine whether or not to print out a line. - /// - [TestMethod] - public void TestCompile_ZeroNumberArgument_PassedToTag() - { - FormatCompiler compiler = new FormatCompiler(); - const string format = @"{{#if 00.0000}}Hello{{/if}}"; - Generator generator = compiler.Compile(format); - string actual = generator.Render(null); - string expected = ""; - Assert.AreEqual(expected, actual, "The number was not passed to the formatter."); - } - - #endregion - } -} diff --git a/OSS/mustache-sharp/mustache-sharp.test/Properties/AssemblyInfo.cs b/OSS/mustache-sharp/mustache-sharp.test/Properties/AssemblyInfo.cs deleted file mode 100644 index 3bbd9f9..0000000 --- a/OSS/mustache-sharp/mustache-sharp.test/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("mustache-sharp.test")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Truncon")] -[assembly: AssemblyProduct("mustache-sharp.test")] -[assembly: AssemblyCopyright("Copyright © 2013")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: ComVisible(false)] -[assembly: Guid("9975f293-f972-4751-9c8c-e25b17c0c8bc")] -[assembly: AssemblyVersion("0.0.0.0")] -[assembly: AssemblyFileVersion("0.0.0.0")] diff --git a/OSS/mustache-sharp/mustache-sharp.test/UpcastDictionaryTester.cs b/OSS/mustache-sharp/mustache-sharp.test/UpcastDictionaryTester.cs deleted file mode 100644 index 2b8b50d..0000000 --- a/OSS/mustache-sharp/mustache-sharp.test/UpcastDictionaryTester.cs +++ /dev/null @@ -1,223 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Mustache.Test -{ - [TestClass] - public class UpcastDictionaryTester - { - [TestMethod] - public void ShouldReturnNullForNull() - { - IDictionary result = UpcastDictionary.Create(null); - Assert.IsNull(result, "Null should be returned for null."); - } - - [TestMethod] - public void ShouldReturnArgumentIfIDictionary_string_object() - { - object source = new Dictionary(); - IDictionary result = UpcastDictionary.Create(source); - Assert.AreSame(source, result, "The up-cast wrapper should not be applied if already a IDictionary."); - } - - [TestMethod] - public void ShouldReturnNullIfNotGenericType() - { - object source = String.Empty; - IDictionary result = UpcastDictionary.Create(source); - Assert.IsNull(result, "Null should be returned for non-generic types."); - } - - [TestMethod] - public void ShouldReturnNullIfWrongNumberOfGenericArguments() - { - object source = new List(); - IDictionary result = UpcastDictionary.Create(source); - Assert.IsNull(result, "Null should be returned for generic types with the wrong number of type arguments."); - } - - [TestMethod] - public void ShouldReturnNullIfFirstGenericTypeArgumentIsNotAString() - { - object source = new Dictionary(); - IDictionary result = UpcastDictionary.Create(source); - Assert.IsNull(result, "Null should be returned if the first generic type argument is not a string."); - } - - [TestMethod] - public void ShouldReturnNullIfNotDictionaryType() - { - object source = (Converter)(s => (object)s); - IDictionary result = UpcastDictionary.Create(source); - Assert.IsNull(result, "Null should be returned for non-dictionary types."); - } - - [TestMethod] - public void ShouldReturnUpcastWrapperForDictionary_string_TValue() - { - object source = new Dictionary(); - IDictionary result = UpcastDictionary.Create(source); - Assert.IsInstanceOfType(result, typeof(UpcastDictionary), "The source was not wrapped."); - } - - [TestMethod] - public void ShouldFindKeyIfInWrappedDictionary() - { - object source = new Dictionary() { { "Name", "Bob" } }; - IDictionary result = UpcastDictionary.Create(source); - bool containsKey = result.ContainsKey("Name"); - Assert.IsTrue(containsKey, "The key Name should have been found."); - } - - [TestMethod] - public void ShouldNotFindKeyIfNotInWrappedDictionary() - { - object source = new Dictionary() { { "Name", "Bob" } }; - IDictionary result = UpcastDictionary.Create(source); - bool containsKey = result.ContainsKey("Age"); - Assert.IsFalse(containsKey, "The key Age should not have been found."); - } - - [TestMethod] - public void ShouldFindKeysInWrappedDictionary() - { - var source = new Dictionary() { { "Name", "Bob" }, { "Age", "100" } }; - IDictionary result = UpcastDictionary.Create(source); - ICollection sourceKeys = source.Keys; - ICollection wrappedKeys = result.Keys.ToArray(); - CollectionAssert.AreEquivalent(sourceKeys, wrappedKeys, "The same keys should have been found in both collections."); - } - - [TestMethod] - public void ShouldFindKeyIfInWrappedDictionary_TryGetValue() - { - var source = new Dictionary() { { "Name", "Bob" } }; - IDictionary result = UpcastDictionary.Create(source); - object value; - bool found = result.TryGetValue("Name", out value); - Assert.IsTrue(found, "The key should have been found."); - Assert.AreSame(source["Name"], value, "The value in the underlying dictionary should have been returned."); - } - - [TestMethod] - public void ShouldNotFindKeyIfNotInWrappedDictionary_TryGetValue() - { - var source = new Dictionary() { { "Age", 100 } }; - IDictionary result = UpcastDictionary.Create(source); - object value; - bool found = result.TryGetValue("Name", out value); - Assert.IsFalse(found, "The key should not have been found."); - Assert.IsNull(value, "The value should be null even if the actual type is a struct."); - - } - - [TestMethod] - public void ShouldReturnValuesAsObjects() - { - var source = new Dictionary() { { "Age", 100 }, { "Weight", 500 } }; - IDictionary result = UpcastDictionary.Create(source); - ICollection sourceValues = source.Values; - ICollection wrappedValues = result.Values.ToArray(); - CollectionAssert.AreEquivalent(sourceValues, wrappedValues, "The underlying values were not returned."); - } - - [TestMethod] - public void ShouldFindKeyIfInWrappedDictionary_Indexer() - { - var source = new Dictionary() { { "Name", "Bob" } }; - IDictionary result = UpcastDictionary.Create(source); - object value = result["Name"]; - Assert.AreSame(source["Name"], value, "The value in the underlying dictionary should have been returned."); - } - - [TestMethod] - [ExpectedException(typeof(KeyNotFoundException))] - public void ShouldNotFindKeyIfNotInWrappedDictionary_Indexer() - { - var source = new Dictionary() { { "Age", 100 } }; - IDictionary result = UpcastDictionary.Create(source); - object value = result["Name"]; - } - - [TestMethod] - public void ShouldNotFindPairIfValueWrongType() - { - var source = new Dictionary() { { "Age", 100 } }; - IDictionary result = UpcastDictionary.Create(source); - bool contains = result.Contains(new KeyValuePair("Age", "Blah")); - Assert.IsFalse(contains, "The pair should not have been found."); - } - - [TestMethod] - public void ShouldFindPairInWrappedDictionary() - { - var source = new Dictionary() { { "Age", 100 } }; - IDictionary result = UpcastDictionary.Create(source); - bool contains = result.Contains(new KeyValuePair("Age", 100)); - Assert.IsTrue(contains, "The pair should have been found."); - } - - [TestMethod] - public void ShouldCopyPairsToArray() - { - var source = new Dictionary() { { "Age", 100 }, { "Weight", 45 } }; - IDictionary result = UpcastDictionary.Create(source); - var array = new KeyValuePair[2]; - result.CopyTo(array, 0); - var expected = new KeyValuePair[] - { - new KeyValuePair("Age", 100), - new KeyValuePair("Weight", 45) - }; - CollectionAssert.AreEqual(expected, array, "The pairs were not copied."); - } - - [TestMethod] - public void ShouldGetCount() - { - var source = new Dictionary() { { "Age", 100 }, { "Weight", 45 } }; - IDictionary result = UpcastDictionary.Create(source); - Assert.AreEqual(source.Count, result.Count, "The source and Upcast dictionary should have the same count."); - } - - [TestMethod] - public void ShouldGetEnumerator() - { - var source = new Dictionary() { { "Age", 100 }, { "Weight", 45 } }; - IDictionary result = UpcastDictionary.Create(source); - IEnumerator> enumerator = result.GetEnumerator(); - var values = new List>(); - while (enumerator.MoveNext()) - { - values.Add(enumerator.Current); - } - var expected = new KeyValuePair[] - { - new KeyValuePair("Age", 100), - new KeyValuePair("Weight", 45) - }; - CollectionAssert.AreEqual(expected, values, "The enumerator did not return the correct pairs."); - } - - /// - /// Newtonsoft's JSON.NET has an object called JObject. This is a concrete class - /// that inherits from IDictionary<string, JToken>. The UpcastDictionary - /// should be able to handle this type. - /// - [TestMethod] - public void ShouldHandleConcreteClassInheritingFromDictionary() - { - var dictionary = new ConcreteDictionary() { { "Name", "Bob" } }; - var result = UpcastDictionary.Create(dictionary); - Assert.AreEqual(dictionary["Name"], result["Name"]); - } - - public class ConcreteDictionary : Dictionary - { - } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp.test/mustache-sharp.test.csproj b/OSS/mustache-sharp/mustache-sharp.test/mustache-sharp.test.csproj deleted file mode 100644 index 9721eea..0000000 --- a/OSS/mustache-sharp/mustache-sharp.test/mustache-sharp.test.csproj +++ /dev/null @@ -1,64 +0,0 @@ - - - - Debug - AnyCPU - - - 2.0 - {7F607362-0680-4751-B1DC-621219294AE3} - Library - Properties - Mustache.Test - mustache-sharp.test - v4.0 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - true - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - False - - - - - - - - - - {d71b378f-a4ba-4263-a4f0-07a49a0c528d} - mustache-sharp - - - - - \ No newline at end of file diff --git a/OSS/mustache-sharp/mustache-sharp/ArgumentCollection.cs b/OSS/mustache-sharp/mustache-sharp/ArgumentCollection.cs deleted file mode 100644 index 07c23af..0000000 --- a/OSS/mustache-sharp/mustache-sharp/ArgumentCollection.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Mustache -{ - /// - /// Associates parameters to their argument values. - /// - internal sealed class ArgumentCollection - { - private readonly Dictionary _argumentLookup; - - /// - /// Initializes a new instance of an ArgumentCollection. - /// - public ArgumentCollection() - { - _argumentLookup = new Dictionary(); - } - - /// - /// Associates the given parameter to the key placeholder. - /// - /// The parameter to associate the key with. - /// The argument. - /// If the key is null, the default value of the parameter will be used. - public void AddArgument(TagParameter parameter, IArgument argument) - { - _argumentLookup.Add(parameter, argument); - } - - /// - /// Gets the key that will be used to find the substitute value. - /// - /// The name of the parameter. - public string GetKey(TagParameter parameter) - { - IArgument argument; - if (_argumentLookup.TryGetValue(parameter, out argument) && argument != null) - { - return argument.GetKey(); - } - else - { - return null; - } - } - - /// - /// Substitutes the key placeholders with their respective values. - /// - /// The key/value pairs in the current lexical scope. - /// The key/value pairs in current context. - /// A dictionary associating the parameter name to the associated value. - public Dictionary GetArguments(Scope keyScope, Scope contextScope) - { - Dictionary arguments = new Dictionary(); - foreach (KeyValuePair pair in _argumentLookup) - { - object value; - if (pair.Value == null) - { - value = pair.Key.DefaultValue; - } - else - { - value = pair.Value.GetValue(keyScope, contextScope); - } - arguments.Add(pair.Key.Name, value); - } - return arguments; - } - - public Dictionary GetArgumentKeyNames() - { - return _argumentLookup.ToDictionary(p => p.Key.Name, p => (object)GetKey(p.Key)); - } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/CompoundGenerator.cs b/OSS/mustache-sharp/mustache-sharp/CompoundGenerator.cs deleted file mode 100644 index 2af4fcb..0000000 --- a/OSS/mustache-sharp/mustache-sharp/CompoundGenerator.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; - -namespace Mustache -{ - /// - /// Builds text by combining the output of other generators. - /// - internal sealed class CompoundGenerator : IGenerator - { - private readonly TagDefinition _definition; - private readonly ArgumentCollection _arguments; - private readonly List _primaryGenerators; - private IGenerator _subGenerator; - - /// - /// Initializes a new instance of a CompoundGenerator. - /// - /// The tag that the text is being generated for. - /// The arguments that were passed to the tag. - public CompoundGenerator(TagDefinition definition, ArgumentCollection arguments) - { - _definition = definition; - _arguments = arguments; - _primaryGenerators = new List(); - } - - /// - /// Adds the given generator. - /// - /// The generator to add. - public void AddGenerator(IGenerator generator) - { - addGenerator(generator, false); - } - - /// - /// Adds the given generator, determining whether the generator should - /// be part of the primary generators or added as an secondary generator. - /// - /// The tag that the generator is generating text for. - /// The generator to add. - public void AddGenerator(TagDefinition definition, IGenerator generator) - { - bool isSubGenerator = _definition.ShouldCreateSecondaryGroup(definition); - addGenerator(generator, isSubGenerator); - } - - private void addGenerator(IGenerator generator, bool isSubGenerator) - { - if (isSubGenerator) - { - _subGenerator = generator; - } - else - { - _primaryGenerators.Add(generator); - } - } - - void IGenerator.GetText(Scope keyScope, TextWriter writer, Scope contextScope) - { - Dictionary arguments = _arguments.GetArguments(keyScope, contextScope); - IEnumerable contexts = _definition.GetChildContext(writer, keyScope, arguments, contextScope); - List generators; - if (_definition.ShouldGeneratePrimaryGroup(arguments)) - { - generators = _primaryGenerators; - } - else - { - generators = new List(); - if (_subGenerator != null) - { - generators.Add(_subGenerator); - } - } - foreach (NestedContext context in contexts) - { - foreach (IGenerator generator in generators) - { - generator.GetText(context.KeyScope ?? keyScope, context.Writer ?? writer, context.ContextScope); - if (context.WriterNeedsConsidated) - { - writer.Write(_definition.ConsolidateWriter(context.Writer ?? writer, arguments)); - } - } - } - } - } -} \ No newline at end of file diff --git a/OSS/mustache-sharp/mustache-sharp/ContentTagDefinition.cs b/OSS/mustache-sharp/mustache-sharp/ContentTagDefinition.cs deleted file mode 100644 index 5fea260..0000000 --- a/OSS/mustache-sharp/mustache-sharp/ContentTagDefinition.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; - -namespace Mustache -{ - /// - /// Defines a tag that can contain inner text. - /// - public abstract class ContentTagDefinition : TagDefinition - { - /// - /// Initializes a new instance of a ContentTagDefinition. - /// - /// The name of the tag being defined. - protected ContentTagDefinition(string tagName) - : base(tagName) - { - } - - /// - /// Initializes a new instance of a ContentTagDefinition. - /// - /// The name of the tag being defined. - /// Specifies whether the tag is a built-in tag. - internal ContentTagDefinition(string tagName, bool isBuiltin) - : base(tagName, isBuiltin) - { - } - - /// - /// Gets or sets whether the tag can have content. - /// - /// True if the tag can have a body; otherwise, false. - protected override bool GetHasContent() - { - return true; - } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/Context.cs b/OSS/mustache-sharp/mustache-sharp/Context.cs deleted file mode 100644 index 2a6c249..0000000 --- a/OSS/mustache-sharp/mustache-sharp/Context.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; - -namespace Mustache -{ - /// - /// Represents a context within a template. - /// - public sealed class Context - { - /// - /// Initializes a new instance of a Context. - /// - /// The name of the tag that created the context. - /// The argument used to create the context. - internal Context(string tagName, ContextParameter[] parameters) - { - TagName = tagName; - Parameters = parameters; - } - - /// - /// Gets the tag that created the context. - /// - public string TagName { get; private set; } - - /// - /// Gets the argument used to create the context. - /// - public ContextParameter[] Parameters { get; private set; } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/ContextParameter.cs b/OSS/mustache-sharp/mustache-sharp/ContextParameter.cs deleted file mode 100644 index 57fbe52..0000000 --- a/OSS/mustache-sharp/mustache-sharp/ContextParameter.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; - -namespace Mustache -{ - /// - /// Holds information describing a parameter that creates a new context. - /// - public sealed class ContextParameter - { - /// - /// Initializes a new instance of a ContextParameter. - /// - /// The parameter that is used to create a new context. - /// The key whose corresponding value will be used to create the context. - internal ContextParameter(string parameter, string argument) - { - Parameter = parameter; - Argument = argument; - } - - /// - /// Gets the parameter that is used to create a new context. - /// - public string Parameter { get; private set; } - - /// - /// Gets the key whose corresponding value will be used to create the context. - /// - public string Argument { get; private set; } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/EachTagDefinition.cs b/OSS/mustache-sharp/mustache-sharp/EachTagDefinition.cs deleted file mode 100644 index 163d7cb..0000000 --- a/OSS/mustache-sharp/mustache-sharp/EachTagDefinition.cs +++ /dev/null @@ -1,94 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; - -namespace Mustache -{ - /// - /// Defines a tag that can iterate over a collection of items and render - /// the content using each item as the context. - /// - internal sealed class EachTagDefinition : ContentTagDefinition - { - private const string collectionParameter = "collection"; - private static readonly TagParameter collection = new TagParameter(collectionParameter) { IsRequired = true }; - - /// - /// Initializes a new instance of an EachTagDefinition. - /// - public EachTagDefinition() - : base("each", true) - { - } - - /// - /// Gets whether the tag only exists within the scope of its parent. - /// - protected override bool GetIsContextSensitive() - { - return false; - } - - /// - /// Gets the parameters that can be passed to the tag. - /// - /// The parameters. - protected override IEnumerable GetParameters() - { - return new TagParameter[] { collection }; - } - - /// - /// Gets the context to use when building the inner text of the tag. - /// - /// The text writer passed - /// The current scope. - /// The arguments passed to the tag. - /// The scope to use when building the inner text of the tag. - public override IEnumerable GetChildContext( - TextWriter writer, - Scope keyScope, - Dictionary arguments, - Scope contextScope) - { - object value = arguments[collectionParameter]; - IEnumerable enumerable = value as IEnumerable; - if (enumerable == null) - { - yield break; - } - int index = 0; - foreach (object item in enumerable) - { - NestedContext childContext = new NestedContext() - { - KeyScope = keyScope.CreateChildScope(item), - Writer = writer, - ContextScope = contextScope.CreateChildScope(), - }; - childContext.ContextScope.Set("index", index); - yield return childContext; - ++index; - } - } - - /// - /// Gets the tags that are in scope under this tag. - /// - /// The name of the tags that are in scope. - protected override IEnumerable GetChildTags() - { - return new string[] { "index" }; - } - - /// - /// Gets the parameters that are used to create a new child context. - /// - /// The parameters that are used to create a new child context. - public override IEnumerable GetChildContextParameters() - { - return new TagParameter[] { collection }; - } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/ElifTagDefinition.cs b/OSS/mustache-sharp/mustache-sharp/ElifTagDefinition.cs deleted file mode 100644 index 5d86aea..0000000 --- a/OSS/mustache-sharp/mustache-sharp/ElifTagDefinition.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Mustache -{ - /// - /// Defines a tag that conditionally renders its content if preceding if and elif tags fail. - /// - public class ElifTagDefinition : ConditionTagDefinition - { - /// - /// Initializes a new instance of an ElifTagDefinition. - /// - public ElifTagDefinition() - : base("elif") - { - } - - /// - /// Gets whether the tag only exists within the scope of its parent. - /// - protected override bool GetIsContextSensitive() - { - return true; - } - - /// - /// Gets the tags that indicate the end of the current tags context. - /// - protected override IEnumerable GetClosingTags() - { - return new string[] { "if" }; - } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/ElseTagDefinition.cs b/OSS/mustache-sharp/mustache-sharp/ElseTagDefinition.cs deleted file mode 100644 index f13877a..0000000 --- a/OSS/mustache-sharp/mustache-sharp/ElseTagDefinition.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Mustache -{ - /// - /// Defines a tag that renders its content if all preceding if and elif tags. - /// - public class ElseTagDefinition : ContentTagDefinition - { - /// - /// Initializes a new instance of a ElseTagDefinition. - /// - public ElseTagDefinition() - : base("else", true) - { - } - - /// - /// Gets whether the tag only exists within the scope of its parent. - /// - protected override bool GetIsContextSensitive() - { - return true; - } - - /// - /// Gets the tags that indicate the end of the current tag's content. - /// - protected override IEnumerable GetClosingTags() - { - return new string[] { "if" }; - } - - /// - /// Gets the parameters that are used to create a new child context. - /// - /// The parameters that are used to create a new child context. - public override IEnumerable GetChildContextParameters() - { - return new TagParameter[0]; - } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/FormatCompiler.cs b/OSS/mustache-sharp/mustache-sharp/FormatCompiler.cs deleted file mode 100644 index a2c0251..0000000 --- a/OSS/mustache-sharp/mustache-sharp/FormatCompiler.cs +++ /dev/null @@ -1,389 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; -using Mustache.Properties; - -namespace Mustache -{ - /// - /// Parses a format string and returns a text generator. - /// - public sealed class FormatCompiler - { - private readonly Dictionary _tagLookup; - private readonly Dictionary _regexLookup; - private readonly MasterTagDefinition _masterDefinition; - - /// - /// Initializes a new instance of a FormatCompiler. - /// - public FormatCompiler() - { - _tagLookup = new Dictionary(); - _regexLookup = new Dictionary(); - _masterDefinition = new MasterTagDefinition(); - - IfTagDefinition ifDefinition = new IfTagDefinition(); - _tagLookup.Add(ifDefinition.Name, ifDefinition); - ElifTagDefinition elifDefinition = new ElifTagDefinition(); - _tagLookup.Add(elifDefinition.Name, elifDefinition); - ElseTagDefinition elseDefinition = new ElseTagDefinition(); - _tagLookup.Add(elseDefinition.Name, elseDefinition); - EachTagDefinition eachDefinition = new EachTagDefinition(); - _tagLookup.Add(eachDefinition.Name, eachDefinition); - IndexTagDefinition indexDefinition = new IndexTagDefinition(); - _tagLookup.Add(indexDefinition.Name, indexDefinition); - WithTagDefinition withDefinition = new WithTagDefinition(); - _tagLookup.Add(withDefinition.Name, withDefinition); - NewlineTagDefinition newlineDefinition = new NewlineTagDefinition(); - _tagLookup.Add(newlineDefinition.Name, newlineDefinition); - SetTagDefinition setDefinition = new SetTagDefinition(); - _tagLookup.Add(setDefinition.Name, setDefinition); - - RemoveNewLines = true; - } - - /// - /// Occurs when a placeholder is found in the template. - /// - public event EventHandler PlaceholderFound; - - /// - /// Occurs when a variable is found in the template. - /// - public event EventHandler VariableFound; - - /// - /// Gets or sets whether newlines are removed from the template (default: true). - /// - public bool RemoveNewLines { get; set; } - - /// - /// Registers the given tag definition with the parser. - /// - /// The tag definition to register. - /// Specifies whether the tag is immediately in scope. - public void RegisterTag(TagDefinition definition, bool isTopLevel) - { - if (definition == null) - { - throw new ArgumentNullException("definition"); - } - //if (_tagLookup.ContainsKey(definition.Name)) - //{ - // string message = String.Format(Resources.DuplicateTagDefinition, definition.Name); - // throw new ArgumentException(message, "definition"); - //} - //_tagLookup.Add(definition.Name, definition); - _tagLookup[definition.Name] = definition; - } - - /// - /// Builds a text generator based on the given format. - /// - /// The format to parse. - /// The text generator. - public Generator Compile(string format) - { - if (format == null) - { - throw new ArgumentNullException("format"); - } - CompoundGenerator generator = new CompoundGenerator(_masterDefinition, new ArgumentCollection()); - List context = new List() { new Context(_masterDefinition.Name, new ContextParameter[0]) }; - int formatIndex = buildCompoundGenerator(_masterDefinition, context, generator, format, 0); - string trailing = format.Substring(formatIndex); - generator.AddGenerator(new StaticGenerator(trailing, RemoveNewLines)); - return new Generator(generator); - } - - private Match findNextTag(TagDefinition definition, string format, int formatIndex) - { - Regex regex = prepareRegex(definition); - return regex.Match(format, formatIndex); - } - - private Regex prepareRegex(TagDefinition definition) - { - Regex regex; - if (!_regexLookup.TryGetValue(definition.Name, out regex)) - { - List matches = new List(); - matches.Add(getKeyRegex()); - matches.Add(getCommentTagRegex()); - foreach (string closingTag in definition.ClosingTags) - { - matches.Add(getClosingTagRegex(closingTag)); - } - foreach (TagDefinition globalDefinition in _tagLookup.Values) - { - if (!globalDefinition.IsContextSensitive) - { - matches.Add(getTagRegex(globalDefinition)); - } - } - foreach (string childTag in definition.ChildTags) - { - TagDefinition childDefinition = _tagLookup[childTag]; - matches.Add(getTagRegex(childDefinition)); - } - matches.Add(getUnknownTagRegex()); - string match = "{{(" + String.Join("|", matches) + ")}}"; - regex = new Regex(match); - _regexLookup.Add(definition.Name, regex); - } - return regex; - } - - private static string getClosingTagRegex(string tagName) - { - StringBuilder regexBuilder = new StringBuilder(); - regexBuilder.Append(@"(?(/(?"); - regexBuilder.Append(tagName); - regexBuilder.Append(@")\s*?))"); - return regexBuilder.ToString(); - } - - private static string getCommentTagRegex() - { - return @"(?#!.*?)"; - } - - private static string getKeyRegex() - { - return @"((?" + RegexHelper.CompoundKey + @")(,(?(\+|-)?[\d]+))?(:(?.*?))?)"; - } - - private static string getTagRegex(TagDefinition definition) - { - StringBuilder regexBuilder = new StringBuilder(); - regexBuilder.Append(@"(?(#(?"); - regexBuilder.Append(definition.Name); - regexBuilder.Append(@")"); - foreach (TagParameter parameter in definition.Parameters) - { - regexBuilder.Append(@"(\s+?"); - regexBuilder.Append(@"(?("); - regexBuilder.Append(RegexHelper.Argument); - regexBuilder.Append(@")))"); - if (!parameter.IsRequired) - { - regexBuilder.Append("?"); - } - } - regexBuilder.Append(@"\s*?))"); - return regexBuilder.ToString(); - } - - private string getUnknownTagRegex() - { - return @"(?(#.*?))"; - } - - private int buildCompoundGenerator( - TagDefinition tagDefinition, - List context, - CompoundGenerator generator, - string format, int formatIndex) - { - while (true) - { - Match match = findNextTag(tagDefinition, format, formatIndex); - - if (!match.Success) - { - if (tagDefinition.ClosingTags.Any()) - { - string message = String.Format(Resources.MissingClosingTag, tagDefinition.Name); - throw new FormatException(message); - } - break; - } - - string leading = format.Substring(formatIndex, match.Index - formatIndex); - - if (match.Groups["key"].Success) - { - generator.AddGenerator(new StaticGenerator(leading, RemoveNewLines)); - formatIndex = match.Index + match.Length; - string key = match.Groups["key"].Value; - string alignment = match.Groups["alignment"].Value; - string formatting = match.Groups["format"].Value; - if (key.StartsWith("@")) - { - VariableFoundEventArgs args = new VariableFoundEventArgs(key.Substring(1), alignment, formatting, context.ToArray()); - if (VariableFound != null) - { - VariableFound(this, args); - key = "@" + args.Name; - alignment = args.Alignment; - formatting = args.Formatting; - } - } - else - { - PlaceholderFoundEventArgs args = new PlaceholderFoundEventArgs(key, alignment, formatting, context.ToArray()); - if (PlaceholderFound != null) - { - PlaceholderFound(this, args); - key = args.Key; - alignment = args.Alignment; - formatting = args.Formatting; - } - } - KeyGenerator keyGenerator = new KeyGenerator(key, alignment, formatting); - generator.AddGenerator(keyGenerator); - } - else if (match.Groups["open"].Success) - { - formatIndex = match.Index + match.Length; - string tagName = match.Groups["name"].Value; - TagDefinition nextDefinition = _tagLookup[tagName]; - if (nextDefinition == null) - { - string message = String.Format(Resources.UnknownTag, tagName); - throw new FormatException(message); - } - - generator.AddGenerator(new StaticGenerator(leading, RemoveNewLines)); - ArgumentCollection arguments = getArguments(nextDefinition, match, context); - - if (nextDefinition.HasContent) - { - CompoundGenerator compoundGenerator = new CompoundGenerator(nextDefinition, arguments); - IEnumerable contextParameters = nextDefinition.GetChildContextParameters(); - bool hasContext = contextParameters.Any(); - if (hasContext) - { - ContextParameter[] parameters = contextParameters.Select(p => new ContextParameter(p.Name, arguments.GetKey(p))).ToArray(); - context.Add(new Context(nextDefinition.Name, parameters)); - } - formatIndex = buildCompoundGenerator(nextDefinition, context, compoundGenerator, format, formatIndex); - generator.AddGenerator(nextDefinition, compoundGenerator); - if (hasContext) - { - context.RemoveAt(context.Count - 1); - } - } - else - { - InlineGenerator inlineGenerator = new InlineGenerator(nextDefinition, arguments); - generator.AddGenerator(inlineGenerator); - } - } - else if (match.Groups["close"].Success) - { - generator.AddGenerator(new StaticGenerator(leading, RemoveNewLines)); - string tagName = match.Groups["name"].Value; - TagDefinition nextDefinition = _tagLookup[tagName]; - formatIndex = match.Index; - if (tagName == tagDefinition.Name) - { - formatIndex += match.Length; - } - break; - } - else if (match.Groups["comment"].Success) - { - generator.AddGenerator(new StaticGenerator(leading, RemoveNewLines)); - formatIndex = match.Index + match.Length; - } - else if (match.Groups["unknown"].Success) - { - string tagName = match.Value; - string message = String.Format(Resources.UnknownTag, tagName); - throw new FormatException(message); - } - } - return formatIndex; - } - - private ArgumentCollection getArguments(TagDefinition definition, Match match, List context) - { - // make sure we don't have too many arguments - List captures = match.Groups["argument"].Captures.Cast().ToList(); - List parameters = definition.Parameters.ToList(); - if (captures.Count > parameters.Count) - { - string message = String.Format(Resources.WrongNumberOfArguments, definition.Name); - throw new FormatException(message); - } - - // provide default values for missing arguments - if (captures.Count < parameters.Count) - { - captures.AddRange(Enumerable.Repeat((Capture)null, parameters.Count - captures.Count)); - } - - // pair up the parameters to the given arguments - // provide default for parameters with missing arguments - // throw an error if a missing argument is for a required parameter - Dictionary arguments = new Dictionary(); - foreach (var pair in parameters.Zip(captures, (p, c) => new { Capture = c, Parameter = p })) - { - string value = null; - if (pair.Capture != null) - { - value = pair.Capture.Value; - } - else if (pair.Parameter.IsRequired) - { - string message = String.Format(Resources.WrongNumberOfArguments, definition.Name); - throw new FormatException(message); - } - arguments.Add(pair.Parameter, value); - } - - // indicate that a key/variable has been encountered - // update the key/variable name - ArgumentCollection collection = new ArgumentCollection(); - foreach (var pair in arguments) - { - string placeholder = pair.Value; - IArgument argument = null; - if (placeholder != null) - { - if (placeholder.StartsWith("@")) - { - string variableName = placeholder.Substring(1); - VariableFoundEventArgs args = new VariableFoundEventArgs(placeholder.Substring(1), String.Empty, String.Empty, context.ToArray()); - if (VariableFound != null) - { - VariableFound(this, args); - variableName = args.Name; - } - argument = new VariableArgument(variableName); - } - else if (RegexHelper.IsString(placeholder)) - { - string value = placeholder.Trim('\''); - argument = new StringArgument(value); - } - else if (RegexHelper.IsNumber(placeholder)) - { - decimal number; - if (Decimal.TryParse(placeholder, out number)) - { - argument = new NumberArgument(number); - } - } - else - { - string placeholderName = placeholder; - PlaceholderFoundEventArgs args = new PlaceholderFoundEventArgs(placeholder, String.Empty, String.Empty, context.ToArray()); - if (PlaceholderFound != null) - { - PlaceholderFound(this, args); - placeholderName = args.Key; - } - argument = new PlaceholderArgument(placeholderName); - } - } - collection.AddArgument(pair.Key, argument); - } - return collection; - } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/Generator.cs b/OSS/mustache-sharp/mustache-sharp/Generator.cs deleted file mode 100644 index bc2f0c7..0000000 --- a/OSS/mustache-sharp/mustache-sharp/Generator.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.IO; - -namespace Mustache -{ - /// - /// Generates text by substituting an object's values for placeholders. - /// - public sealed class Generator - { - private readonly IGenerator _generator; - private readonly List> _foundHandlers; - private readonly List> _notFoundHandlers; - private readonly List> _valueRequestedHandlers; - - /// - /// Initializes a new instance of a Generator. - /// - /// The text generator to wrap. - internal Generator(IGenerator generator) - { - _generator = generator; - _foundHandlers = new List>(); - _notFoundHandlers = new List>(); - _valueRequestedHandlers = new List>(); - } - - /// - /// Occurs when a key/property is found. - /// - public event EventHandler KeyFound - { - add { _foundHandlers.Add(value); } - remove { _foundHandlers.Remove(value); } - } - - /// - /// Occurs when a key/property is not found in the object graph. - /// - public event EventHandler KeyNotFound - { - add { _notFoundHandlers.Add(value); } - remove { _notFoundHandlers.Remove(value); } - } - - /// - /// Occurs when a setter is encountered and requires a value to be provided. - /// - public event EventHandler ValueRequested - { - add { _valueRequestedHandlers.Add(value); } - remove { _valueRequestedHandlers.Remove(value); } - } - - /// - /// Gets the text that is generated for the given object. - /// - /// The object to generate the text with. - /// The text generated for the given object. - public string Render(object source) - { - return render(CultureInfo.CurrentCulture, source); - } - - /// - /// Gets the text that is generated for the given object. - /// - /// The format provider to use. - /// The object to generate the text with. - /// The text generated for the given object. - public string Render(IFormatProvider provider, object source) - { - if (provider == null) - { - provider = CultureInfo.CurrentCulture; - } - return render(provider, source); - } - - private string render(IFormatProvider provider, object source) - { - Scope keyScope = new Scope(source); - Scope contextScope = new Scope(new Dictionary()); - foreach (EventHandler handler in _foundHandlers) - { - keyScope.KeyFound += handler; - contextScope.KeyFound += handler; - } - foreach (EventHandler handler in _notFoundHandlers) - { - keyScope.KeyNotFound += handler; - contextScope.KeyNotFound += handler; - } - foreach (EventHandler handler in _valueRequestedHandlers) - { - contextScope.ValueRequested += handler; - } - StringWriter writer = new StringWriter(provider); - _generator.GetText(keyScope, writer, contextScope); - return writer.ToString(); - } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/IArgument.cs b/OSS/mustache-sharp/mustache-sharp/IArgument.cs deleted file mode 100644 index 4877cc2..0000000 --- a/OSS/mustache-sharp/mustache-sharp/IArgument.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Mustache -{ - public interface IArgument - { - string GetKey(); - - object GetValue(Scope keyScope, Scope contextScope); - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/IGenerator.cs b/OSS/mustache-sharp/mustache-sharp/IGenerator.cs deleted file mode 100644 index 6b2fd24..0000000 --- a/OSS/mustache-sharp/mustache-sharp/IGenerator.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.IO; - -namespace Mustache -{ - /// - /// Applies the values of an object to the format plan, generating a string. - /// - internal interface IGenerator - { - /// - /// Generates the text when applying the format plan. - /// - /// The current lexical scope of the keys. - /// The text writer to send all text to. - /// The data associated to the context. - /// The generated text. - void GetText(Scope keyScope, TextWriter writer, Scope contextScope); - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/IfTagDefinition.cs b/OSS/mustache-sharp/mustache-sharp/IfTagDefinition.cs deleted file mode 100644 index f03e1f8..0000000 --- a/OSS/mustache-sharp/mustache-sharp/IfTagDefinition.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; - -namespace Mustache -{ - /// - /// Defines a tag that renders its content depending on the truthyness - /// of its argument, with optional elif and else nested tags. - /// - internal sealed class IfTagDefinition : ConditionTagDefinition - { - /// - /// Initializes a new instance of a IfTagDefinition. - /// - public IfTagDefinition() - : base("if") - { - } - - /// - /// Gets whether the tag only exists within the scope of its parent. - /// - protected override bool GetIsContextSensitive() - { - return false; - } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/IndexTagDefinition.cs b/OSS/mustache-sharp/mustache-sharp/IndexTagDefinition.cs deleted file mode 100644 index 1d965a7..0000000 --- a/OSS/mustache-sharp/mustache-sharp/IndexTagDefinition.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; - -namespace Mustache -{ - /// - /// Defines a tag that outputs the current index within an each loop. - /// - internal sealed class IndexTagDefinition : InlineTagDefinition - { - /// - /// Initializes a new instance of an IndexTagDefinition. - /// - public IndexTagDefinition() - : base("index", true) - { - } - - /// - /// Gets the text to output. - /// - /// The writer to write the output to. - /// The arguments passed to the tag. - /// Extra data passed along with the context. - public override void GetText(TextWriter writer, Dictionary arguments, Scope contextScope) - { - object index; - if (contextScope.TryFind("index", out index)) - { - writer.Write(index); - } - } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/InlineGenerator.cs b/OSS/mustache-sharp/mustache-sharp/InlineGenerator.cs deleted file mode 100644 index 0093d15..0000000 --- a/OSS/mustache-sharp/mustache-sharp/InlineGenerator.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; - -namespace Mustache -{ - /// - /// Generates the text for a tag that is replaced with its generated text. - /// - internal sealed class InlineGenerator : IGenerator - { - private readonly TagDefinition _definition; - private readonly ArgumentCollection _arguments; - - /// - /// Initializes a new instance of an InlineGenerator. - /// - /// The tag to render the text for. - /// The arguments passed to the tag. - public InlineGenerator(TagDefinition definition, ArgumentCollection arguments) - { - _definition = definition; - _arguments = arguments; - } - - void IGenerator.GetText(Scope scope, TextWriter writer, Scope context) - { - Dictionary arguments; - if (_definition.IsSetter) - { - arguments = _arguments.GetArgumentKeyNames(); - } - else - { - arguments = _arguments.GetArguments(scope, context); - } - _definition.GetText(writer, arguments, context); - } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/InlineTagDefinition.cs b/OSS/mustache-sharp/mustache-sharp/InlineTagDefinition.cs deleted file mode 100644 index 04d45d4..0000000 --- a/OSS/mustache-sharp/mustache-sharp/InlineTagDefinition.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; - -namespace Mustache -{ - /// - /// Defines a tag that cannot contain inner text. - /// - public abstract class InlineTagDefinition : TagDefinition - { - /// - /// Initializes a new instance of an InlineTagDefinition. - /// - /// The name of the tag being defined. - protected InlineTagDefinition(string tagName) - : base(tagName) - { - } - - /// - /// Initializes a new instance of an InlineTagDefinition. - /// - /// The name of the tag being defined. - /// Specifies whether the tag is a built-in tag. - internal InlineTagDefinition(string tagName, bool isBuiltin) - : base(tagName, isBuiltin) - { - } - - /// - /// Gets or sets whether the tag can have content. - /// - /// True if the tag can have a body; otherwise, false. - protected override bool GetHasContent() - { - return false; - } - - /// - /// Gets the parameters that are used to create a child context. - /// - /// The parameters that are used to create a child context. - public override IEnumerable GetChildContextParameters() - { - return new TagParameter[0]; - } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/KeyFoundEventArgs.cs b/OSS/mustache-sharp/mustache-sharp/KeyFoundEventArgs.cs deleted file mode 100644 index c4bf91d..0000000 --- a/OSS/mustache-sharp/mustache-sharp/KeyFoundEventArgs.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; - -namespace Mustache -{ - /// - /// Holds the information about a key that was found. - /// - public class KeyFoundEventArgs : EventArgs - { - /// - /// Initializes a new instance of a KeyFoundEventArgs. - /// - /// The fully-qualified key. - internal KeyFoundEventArgs(string key, object value) - { - Key = key; - Substitute = value; - } - - /// - /// Gets the fully-qualified key. - /// - public string Key { get; private set; } - - /// - /// Gets or sets the object to use as the substitute. - /// - public object Substitute { get; set; } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/KeyGenerator.cs b/OSS/mustache-sharp/mustache-sharp/KeyGenerator.cs deleted file mode 100644 index 2e568ac..0000000 --- a/OSS/mustache-sharp/mustache-sharp/KeyGenerator.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.IO; -using System.Text; - -namespace Mustache -{ - /// - /// Substitutes a key placeholder with the textual representation of the associated object. - /// - internal sealed class KeyGenerator : IGenerator - { - private readonly string _key; - private readonly string _format; - private readonly bool _isVariable; - - /// - /// Initializes a new instance of a KeyGenerator. - /// - /// The key to substitute with its value. - /// The alignment specifier. - /// The format specifier. - public KeyGenerator(string key, string alignment, string formatting) - { - if (key.StartsWith("@")) - { - _key = key.Substring(1); - _isVariable = true; - } - else - { - _key = key; - _isVariable = false; - } - _format = getFormat(alignment, formatting); - } - - private static string getFormat(string alignment, string formatting) - { - StringBuilder formatBuilder = new StringBuilder(); - formatBuilder.Append("{0"); - if (!String.IsNullOrWhiteSpace(alignment)) - { - formatBuilder.Append(","); - formatBuilder.Append(alignment.TrimStart('+')); - } - if (!String.IsNullOrWhiteSpace(formatting)) - { - formatBuilder.Append(":"); - formatBuilder.Append(formatting); - } - formatBuilder.Append("}"); - return formatBuilder.ToString(); - } - - void IGenerator.GetText(Scope scope, TextWriter writer, Scope context) - { - object value = _isVariable ? context.Find(_key) : scope.Find(_key); - writer.Write(_format, value); - } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/KeyNotFoundEventArgs.cs b/OSS/mustache-sharp/mustache-sharp/KeyNotFoundEventArgs.cs deleted file mode 100644 index f29b69e..0000000 --- a/OSS/mustache-sharp/mustache-sharp/KeyNotFoundEventArgs.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; - -namespace Mustache -{ - /// - /// Holds the information needed to handle a missing key. - /// - public class KeyNotFoundEventArgs : EventArgs - { - /// - /// Initializes a new instance of a KeyNotFoundEventArgs. - /// - /// The fully-qualified key. - /// The part of the key that could not be found. - internal KeyNotFoundEventArgs(string key, string missingMember) - { - Key = key; - MissingMember = missingMember; - } - - /// - /// Gets the fully-qualified key. - /// - public string Key { get; private set; } - - /// - /// Gets the part of the key that could not be found. - /// - public string MissingMember { get; private set; } - - /// - /// Gets or sets whether to use the substitute. - /// - public bool Handled { get; set; } - - /// - /// Gets or sets the object to use as the substitute. - /// - public object Substitute { get; set; } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/MasterTagDefinition.cs b/OSS/mustache-sharp/mustache-sharp/MasterTagDefinition.cs deleted file mode 100644 index 4cfd990..0000000 --- a/OSS/mustache-sharp/mustache-sharp/MasterTagDefinition.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Mustache -{ - /// - /// Defines a pseudo tag that wraps the entire content of a format string. - /// - internal sealed class MasterTagDefinition : ContentTagDefinition - { - /// - /// Initializes a new instance of a MasterTagDefinition. - /// - public MasterTagDefinition() - : base(String.Empty, true) - { - } - - /// - /// Gets whether the tag only exists within the scope of its parent. - /// - protected override bool GetIsContextSensitive() - { - return true; - } - - /// - /// Gets the name of the tags that indicate that the tag's context is closed. - /// - /// The tag names. - protected override IEnumerable GetClosingTags() - { - return new string[] { }; - } - - /// - /// Gets the parameters that are used to create a new child context. - /// - /// The parameters that are used to create a new child context. - public override IEnumerable GetChildContextParameters() - { - return new TagParameter[0]; - } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/NestedContext.cs b/OSS/mustache-sharp/mustache-sharp/NestedContext.cs deleted file mode 100644 index 3c98c8b..0000000 --- a/OSS/mustache-sharp/mustache-sharp/NestedContext.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using System.IO; - -namespace Mustache -{ - /// - /// Holds the objects to use when processing a child context of another tag. - /// - public sealed class NestedContext - { - /// - /// Initializes a new instance of a NestedContext. - /// - public NestedContext() - { - } - - /// - /// Gets or sets the writer to use when generating the child context. - /// - /// Setting the writer to null will indicate that the tag's writer should be used. - public TextWriter Writer { get; set; } - - /// - /// Gets or sets whether the text sent to the returned writer needs to be added - /// to the parent tag's writer. This should be false if the parent writer is - /// being returned or is being wrapped. - /// - public bool WriterNeedsConsidated { get; set; } - - /// - /// Gets or sets the key scope to use when generating the child context. - /// - /// Setting the scope to null will indicate that the current scope should be used. - public Scope KeyScope { get; set; } - - /// - /// Gets or sets data associated with the context. - /// - public Scope ContextScope { get; set; } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/NewlineTagDefinition.cs b/OSS/mustache-sharp/mustache-sharp/NewlineTagDefinition.cs deleted file mode 100644 index dca77e4..0000000 --- a/OSS/mustache-sharp/mustache-sharp/NewlineTagDefinition.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; - -namespace Mustache -{ - /// - /// Defines a tag that outputs a newline. - /// - internal sealed class NewlineTagDefinition : InlineTagDefinition - { - /// - /// Initializes a new instance of an NewlineTagDefinition. - /// - public NewlineTagDefinition() - : base("newline") - { - } - - /// - /// Gets the text to output. - /// - /// The writer to write the output to. - /// The arguments passed to the tag. - /// Extra data passed along with the context. - public override void GetText(TextWriter writer, Dictionary arguments, Scope context) - { - writer.Write(Environment.NewLine); - } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/NumberArgument.cs b/OSS/mustache-sharp/mustache-sharp/NumberArgument.cs deleted file mode 100644 index ec40ae4..0000000 --- a/OSS/mustache-sharp/mustache-sharp/NumberArgument.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; - -namespace Mustache -{ - public class NumberArgument : IArgument - { - private readonly decimal value; - - public NumberArgument(decimal value) - { - this.value = value; - } - - public string GetKey() - { - return null; - } - - public object GetValue(Scope keyScope, Scope contextScope) - { - return value; - } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/PlaceholderArgument.cs b/OSS/mustache-sharp/mustache-sharp/PlaceholderArgument.cs deleted file mode 100644 index 39047f3..0000000 --- a/OSS/mustache-sharp/mustache-sharp/PlaceholderArgument.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; - -namespace Mustache -{ - public class PlaceholderArgument : IArgument - { - private readonly string name; - - public PlaceholderArgument(string name) - { - this.name = name; - } - - public string GetKey() - { - return name; - } - - public object GetValue(Scope keyScope, Scope contextScope) - { - return keyScope.Find(name); - } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/PlaceholderFoundEventArgs.cs b/OSS/mustache-sharp/mustache-sharp/PlaceholderFoundEventArgs.cs deleted file mode 100644 index e415512..0000000 --- a/OSS/mustache-sharp/mustache-sharp/PlaceholderFoundEventArgs.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using Mustache.Properties; - -namespace Mustache -{ - /// - /// Holds the information descibing a key that is found in a template. - /// - public class PlaceholderFoundEventArgs : EventArgs - { - /// - /// Initializes a new instance of a PlaceholderFoundEventArgs. - /// - /// The key that was found. - /// The alignment that will be applied to the substitute value. - /// The formatting that will be applied to the substitute value. - /// The context where the placeholder was found. - internal PlaceholderFoundEventArgs(string key, string alignment, string formatting, Context[] context) - { - Key = key; - Alignment = alignment; - Formatting = formatting; - Context = context; - } - - /// - /// Gets or sets the key that was found. - /// - public string Key { get; set; } - - /// - /// Gets or sets the alignment that will be applied to the substitute value. - /// - public string Alignment { get; set; } - - /// - /// Gets or sets the formatting that will be applied to the substitute value. - /// - public string Formatting { get; set; } - - /// - /// Gets the context where the placeholder was found. - /// - public Context[] Context { get; private set; } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/Properties/AssemblyInfo.cs b/OSS/mustache-sharp/mustache-sharp/Properties/AssemblyInfo.cs deleted file mode 100644 index 85e7f9b..0000000 --- a/OSS/mustache-sharp/mustache-sharp/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("mustache-sharp")] -[assembly: AssemblyDescription("A extension of the mustache text template engine for .NET.")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("truncon")] -[assembly: AssemblyProduct("mustache-sharp")] -[assembly: AssemblyCopyright("Copyright © 2013")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: CLSCompliant(true)] -[assembly: ComVisible(false)] -[assembly: Guid("e5a4263d-d450-4d85-a4d5-44c0a2822668")] -[assembly: AssemblyVersion("0.2.8.1")] -[assembly: AssemblyFileVersion("0.2.8.1")] -[assembly: InternalsVisibleTo("mustache-sharp.test")] \ No newline at end of file diff --git a/OSS/mustache-sharp/mustache-sharp/Properties/Resources.Designer.cs b/OSS/mustache-sharp/mustache-sharp/Properties/Resources.Designer.cs deleted file mode 100644 index 3d33190..0000000 --- a/OSS/mustache-sharp/mustache-sharp/Properties/Resources.Designer.cs +++ /dev/null @@ -1,135 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.18052 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Mustache.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Mustache.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to An attempt was made to define a parameter with a null or an invalid identifier.. - /// - internal static string BlankParameterName { - get { - return ResourceManager.GetString("BlankParameterName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to An attempt was made to define a tag with a null or an invalid identifier.. - /// - internal static string BlankTagName { - get { - return ResourceManager.GetString("BlankTagName", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to A parameter with the same name already exists within the tag.. - /// - internal static string DuplicateParameter { - get { - return ResourceManager.GetString("DuplicateParameter", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The {0} tag has already been registered.. - /// - internal static string DuplicateTagDefinition { - get { - return ResourceManager.GetString("DuplicateTagDefinition", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The key {0} could not be found.. - /// - internal static string KeyNotFound { - get { - return ResourceManager.GetString("KeyNotFound", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Expected a matching {0} tag but none was found.. - /// - internal static string MissingClosingTag { - get { - return ResourceManager.GetString("MissingClosingTag", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Encountered an unknown tag: {0}. It was either not registered or exists in a different context.. - /// - internal static string UnknownTag { - get { - return ResourceManager.GetString("UnknownTag", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The wrong number of arguments were passed to an {0} tag.. - /// - internal static string WrongNumberOfArguments { - get { - return ResourceManager.GetString("WrongNumberOfArguments", resourceCulture); - } - } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/Properties/Resources.resx b/OSS/mustache-sharp/mustache-sharp/Properties/Resources.resx deleted file mode 100644 index 7756f43..0000000 --- a/OSS/mustache-sharp/mustache-sharp/Properties/Resources.resx +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - An attempt was made to define a parameter with a null or an invalid identifier. - - - An attempt was made to define a tag with a null or an invalid identifier. - - - A parameter with the same name already exists within the tag. - - - The {0} tag has already been registered. - - - The key {0} could not be found. - - - Expected a matching {0} tag but none was found. - - - Encountered an unknown tag: {0}. It was either not registered or exists in a different context. - - - The wrong number of arguments were passed to an {0} tag. - - \ No newline at end of file diff --git a/OSS/mustache-sharp/mustache-sharp/PropertyDictionary.cs b/OSS/mustache-sharp/mustache-sharp/PropertyDictionary.cs deleted file mode 100644 index dd66458..0000000 --- a/OSS/mustache-sharp/mustache-sharp/PropertyDictionary.cs +++ /dev/null @@ -1,275 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Reflection; - -namespace Mustache -{ - /// - /// Provides methods for creating instances of PropertyDictionary. - /// - internal sealed class PropertyDictionary : IDictionary - { - private static readonly Dictionary>> _cache = new Dictionary>>(); - - private readonly object _instance; - private readonly Dictionary> _typeCache; - - /// - /// Initializes a new instance of a PropertyDictionary. - /// - /// The instance to wrap in the PropertyDictionary. - public PropertyDictionary(object instance) - { - _instance = instance; - if (instance == null) - { - _typeCache = new Dictionary>(); - } - else - { - lock (_cache) - { - _typeCache = getCacheType(_instance); - } - } - } - - private static Dictionary> getCacheType(object instance) - { - Type type = instance.GetType(); - Dictionary> typeCache; - if (!_cache.TryGetValue(type, out typeCache)) - { - typeCache = new Dictionary>(); - - BindingFlags flags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.FlattenHierarchy; - - var properties = getMembers(type, type.GetProperties(flags).Where(p => !p.IsSpecialName)); - foreach (PropertyInfo propertyInfo in properties) - { - typeCache.Add(propertyInfo.Name, i => propertyInfo.GetValue(i, null)); - } - - var fields = getMembers(type, type.GetFields(flags).Where(f => !f.IsSpecialName)); - foreach (FieldInfo fieldInfo in fields) - { - typeCache.Add(fieldInfo.Name, i => fieldInfo.GetValue(i)); - } - - _cache.Add(type, typeCache); - } - return typeCache; - } - - private static IEnumerable getMembers(Type type, IEnumerable members) - where TMember : MemberInfo - { - var singles = from member in members - group member by member.Name into nameGroup - where nameGroup.Count() == 1 - from property in nameGroup - select property; - var multiples = from member in members - group member by member.Name into nameGroup - where nameGroup.Count() > 1 - select - ( - from member in nameGroup - orderby getDistance(type, member) - select member - ).First(); - var combined = singles.Concat(multiples); - return combined; - } - - private static int getDistance(Type type, MemberInfo memberInfo) - { - int distance = 0; - for (; type != null && type != memberInfo.DeclaringType; type = type.BaseType) - { - ++distance; - } - return distance; - } - - /// - /// Gets the underlying instance. - /// - public object Instance - { - get { return _instance; } - } - - [EditorBrowsable(EditorBrowsableState.Never)] - void IDictionary.Add(string key, object value) - { - throw new NotSupportedException(); - } - - /// - /// Determines whether a property with the given name exists. - /// - /// The name of the property. - /// True if the property exists; otherwise, false. - public bool ContainsKey(string key) - { - return _typeCache.ContainsKey(key); - } - - /// - /// Gets the name of the properties in the type. - /// - public ICollection Keys - { - get { return _typeCache.Keys; } - } - - [EditorBrowsable(EditorBrowsableState.Never)] - bool IDictionary.Remove(string key) - { - throw new NotSupportedException(); - } - - /// - /// Tries to get the value for the given property name. - /// - /// The name of the property to get the value for. - /// The variable to store the value of the property or the default value if the property is not found. - /// True if a property with the given name is found; otherwise, false. - /// The name of the property was null. - public bool TryGetValue(string key, out object value) - { - Func getter; - if (!_typeCache.TryGetValue(key, out getter)) - { - value = null; - return false; - } - value = getter(_instance); - return true; - } - - /// - /// Gets the values of all of the properties in the object. - /// - public ICollection Values - { - get - { - ICollection> getters = _typeCache.Values; - List values = new List(); - foreach (Func getter in getters) - { - object value = getter(_instance); - values.Add(value); - } - return values.AsReadOnly(); - } - } - - /// - /// Gets or sets the value of the property with the given name. - /// - /// The name of the property to get or set. - /// The value of the property with the given name. - /// The property name was null. - /// The type does not have a property with the given name. - /// The property did not support getting or setting. - /// - /// The object does not match the target type, or a property is a value type but the value is null. - /// - public object this[string key] - { - get - { - Func getter = _typeCache[key]; - return getter(_instance); - } - [EditorBrowsable(EditorBrowsableState.Never)] - set - { - throw new NotSupportedException(); - } - } - - [EditorBrowsable(EditorBrowsableState.Never)] - void ICollection>.Add(KeyValuePair item) - { - throw new NotSupportedException(); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - void ICollection>.Clear() - { - throw new NotSupportedException(); - } - - bool ICollection>.Contains(KeyValuePair item) - { - Func getter; - if (!_typeCache.TryGetValue(item.Key, out getter)) - { - return false; - } - object value = getter(_instance); - return Equals(item.Value, value); - } - - void ICollection>.CopyTo(KeyValuePair[] array, int arrayIndex) - { - List> pairs = new List>(); - ICollection>> collection = _typeCache; - foreach (KeyValuePair> pair in collection) - { - Func getter = pair.Value; - object value = getter(_instance); - pairs.Add(new KeyValuePair(pair.Key, value)); - } - pairs.CopyTo(array, arrayIndex); - } - - /// - /// Gets the number of properties in the type. - /// - public int Count - { - get { return _typeCache.Count; } - } - - /// - /// Gets or sets whether updates will be ignored. - /// - bool ICollection>.IsReadOnly - { - get { return true; } - } - - [EditorBrowsable(EditorBrowsableState.Never)] - bool ICollection>.Remove(KeyValuePair item) - { - throw new NotSupportedException(); - } - - /// - /// Gets the propety name/value pairs in the object. - /// - /// - public IEnumerator> GetEnumerator() - { - foreach (KeyValuePair> pair in _typeCache) - { - Func getter = pair.Value; - object value = getter(_instance); - yield return new KeyValuePair(pair.Key, value); - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - } -} \ No newline at end of file diff --git a/OSS/mustache-sharp/mustache-sharp/RegexHelper.cs b/OSS/mustache-sharp/mustache-sharp/RegexHelper.cs deleted file mode 100644 index 89c3738..0000000 --- a/OSS/mustache-sharp/mustache-sharp/RegexHelper.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using System.Text.RegularExpressions; - -namespace Mustache -{ - /// - /// Provides utility methods that require regular expressions. - /// - internal static class RegexHelper - { - public const string Key = @"[-_\w][-_\w\d]*"; - public const string String = @"'.*?'"; - public const string Number = @"[-+]?\d*\.?\d+"; - public const string CompoundKey = "@?" + Key + @"(?:\." + Key + ")*"; - public const string Argument = @"(?:(?" + CompoundKey + @")|(?" + String + @")|(?" + Number + @"))"; - - /// - /// Determines whether the given name is a legal identifier. - /// - /// The name to check. - /// True if the name is a legal identifier; otherwise, false. - public static bool IsValidIdentifier(string name) - { - if (name == null) - { - return false; - } - Regex regex = new Regex("^" + Key + "$"); - return regex.IsMatch(name); - } - - public static bool IsString(string value) - { - if (value == null) - { - return false; - } - Regex regex = new Regex("^" + String + "$"); - return regex.IsMatch(value); - } - - public static bool IsNumber(string value) - { - if (value == null) - { - return false; - } - Regex regex = new Regex("^" + Number + "$"); - return regex.IsMatch(value); - } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/Scope.cs b/OSS/mustache-sharp/mustache-sharp/Scope.cs deleted file mode 100644 index f84c5b7..0000000 --- a/OSS/mustache-sharp/mustache-sharp/Scope.cs +++ /dev/null @@ -1,242 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using Mustache.Properties; - -namespace Mustache -{ - /// - /// Represents a scope of keys. - /// - public sealed class Scope - { - private readonly object _source; - private readonly Scope _parent; - - /// - /// Initializes a new instance of a KeyScope. - /// - /// The object to search for keys in. - internal Scope(object source) - : this(source, null) - { - } - - /// - /// Initializes a new instance of a KeyScope. - /// - /// The object to search for keys in. - /// The parent scope to search in if the value is not found. - internal Scope(object source, Scope parent) - { - _parent = parent; - _source = source; - } - - /// - /// Occurs when a key/property is found in the object graph. - /// - public event EventHandler KeyFound; - - /// - /// Occurs when a key/property is not found in the object graph. - /// - public event EventHandler KeyNotFound; - - /// - /// Occurs when a setter is encountered and requires a value to be provided. - /// - public event EventHandler ValueRequested; - - /// - /// Creates a child scope that searches for keys in a default dictionary of key/value pairs. - /// - /// The new child scope. - public Scope CreateChildScope() - { - return CreateChildScope(new Dictionary()); - } - - /// - /// Creates a child scope that searches for keys in the given object. - /// - /// The object to search for keys in. - /// The new child scope. - public Scope CreateChildScope(object source) - { - Scope scope = new Scope(source, this); - scope.KeyFound = KeyFound; - scope.KeyNotFound = KeyNotFound; - scope.ValueRequested = ValueRequested; - return scope; - } - - /// - /// Attempts to find the value associated with the key with given name. - /// - /// The name of the key. - /// The value associated with the key with the given name. - /// A key with the given name could not be found. - internal object Find(string name) - { - SearchResults results = tryFind(name); - if (results.Found) - { - return onKeyFound(name, results.Value); - } - object value; - if (onKeyNotFound(name, results.Member, out value)) - { - return value; - } - string message = String.Format(CultureInfo.CurrentCulture, Resources.KeyNotFound, results.Member); - throw new KeyNotFoundException(message); - } - - private object onKeyFound(string name, object value) - { - if (KeyFound == null) - { - return value; - } - KeyFoundEventArgs args = new KeyFoundEventArgs(name, value); - KeyFound(this, args); - return args.Substitute; - } - - private bool onKeyNotFound(string name, string member, out object value) - { - if (KeyNotFound == null) - { - value = null; - return false; - } - KeyNotFoundEventArgs args = new KeyNotFoundEventArgs(name, member); - KeyNotFound(this, args); - if (!args.Handled) - { - value = null; - return false; - } - value = args.Substitute; - return true; - } - - private static IDictionary toLookup(object value) - { - IDictionary lookup = UpcastDictionary.Create(value); - if (lookup == null) - { - lookup = new PropertyDictionary(value); - } - return lookup; - } - - internal void Set(string key) - { - SearchResults results = tryFind(key); - if (ValueRequested == null) - { - set(results, results.Value); - return; - } - - ValueRequestEventArgs e = new ValueRequestEventArgs(); - if (results.Found) - { - e.Value = results.Value; - } - - ValueRequested(this, e); - set(results, e.Value); - } - - internal void Set(string key, object value) - { - SearchResults results = tryFind(key); - set(results, value); - } - - private void set(SearchResults results, object value) - { - // handle setting value in child scope - while (results.MemberIndex < results.Members.Length - 1) - { - Dictionary context = new Dictionary(); - results.Value = context; - results.Lookup[results.Member] = results.Value; - results.Lookup = context; - ++results.MemberIndex; - } - results.Lookup[results.Member] = value; - } - - public bool TryFind(string name, out object value) - { - SearchResults result = tryFind(name); - value = result.Value; - return result.Found; - } - - private SearchResults tryFind(string name) - { - SearchResults results = new SearchResults(); - results.Members = name.Split('.'); - results.MemberIndex = 0; - if (results.Member == "this") - { - results.Found = true; - results.Lookup = toLookup(_source); - results.Value = _source; - } - else - { - tryFindFirst(results); - } - for (int index = 1; results.Found && index < results.Members.Length; ++index) - { - results.Lookup = toLookup(results.Value); - results.MemberIndex = index; - object value; - results.Found = results.Lookup.TryGetValue(results.Member, out value); - results.Value = value; - } - return results; - } - - private void tryFindFirst(SearchResults results) - { - results.Lookup = toLookup(_source); - object value; - if (results.Lookup.TryGetValue(results.Member, out value)) - { - results.Found = true; - results.Value = value; - return; - } - if (_parent == null) - { - results.Found = false; - results.Value = null; - return; - } - _parent.tryFindFirst(results); - } - } - - internal class SearchResults - { - public IDictionary Lookup { get; set; } - - public string[] Members { get; set; } - - public int MemberIndex { get; set; } - - public string Member { get { return Members[MemberIndex]; } } - - public bool Found { get; set; } - - public object Value { get; set; } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/SetTagDefinition.cs b/OSS/mustache-sharp/mustache-sharp/SetTagDefinition.cs deleted file mode 100644 index 7ee73bb..0000000 --- a/OSS/mustache-sharp/mustache-sharp/SetTagDefinition.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; - -namespace Mustache -{ - /// - /// Defines a tag that declares a named value in the current context. - /// - internal sealed class SetTagDefinition : InlineTagDefinition - { - private const string nameParameter = "name"; - private static readonly TagParameter name = new TagParameter(nameParameter) { IsRequired = true }; - - /// - /// Initializes a new instance of an SetTagDefinition. - /// - public SetTagDefinition() - : base("set", true) - { - } - - protected override bool GetIsSetter() - { - return true; - } - - protected override IEnumerable GetParameters() - { - return new TagParameter[] { name }; - } - - /// - /// Gets the text to output. - /// - /// The writer to write the output to. - /// The arguments passed to the tag. - /// Extra data passed along with the context. - public override void GetText(TextWriter writer, Dictionary arguments, Scope contextScope) - { - string name = (string)arguments[nameParameter]; - contextScope.Set(name); - } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/StaticGenerator.cs b/OSS/mustache-sharp/mustache-sharp/StaticGenerator.cs deleted file mode 100644 index af27a90..0000000 --- a/OSS/mustache-sharp/mustache-sharp/StaticGenerator.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.IO; - -namespace Mustache -{ - /// - /// Generates a static block of text. - /// - internal sealed class StaticGenerator : IGenerator - { - private readonly string value; - - /// - /// Initializes a new instance of a StaticGenerator. - /// - public StaticGenerator(string value, bool removeNewLines) - { - if (removeNewLines) - { - this.value = value.Replace(Environment.NewLine, String.Empty); - } - else - { - this.value = value; - } - } - - /// - /// Gets or sets the static text. - /// - public string Value - { - get { return value; } - } - - void IGenerator.GetText(Scope scope, TextWriter writer, Scope context) - { - writer.Write(Value); - } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/StringArgument.cs b/OSS/mustache-sharp/mustache-sharp/StringArgument.cs deleted file mode 100644 index 36aeec6..0000000 --- a/OSS/mustache-sharp/mustache-sharp/StringArgument.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; - -namespace Mustache -{ - public class StringArgument : IArgument - { - private readonly string value; - - public StringArgument(string value) - { - this.value = value; - } - - public string GetKey() - { - return null; - } - - public object GetValue(Scope keyScope, Scope contextScope) - { - return value; - } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/TagDefinition.cs b/OSS/mustache-sharp/mustache-sharp/TagDefinition.cs deleted file mode 100644 index 429b131..0000000 --- a/OSS/mustache-sharp/mustache-sharp/TagDefinition.cs +++ /dev/null @@ -1,211 +0,0 @@ -using System; -using System.Collections.Generic; -using Mustache.Properties; -using System.IO; - -namespace Mustache -{ - /// - /// Defines the attributes of a custom tag. - /// - public abstract class TagDefinition - { - private readonly string _tagName; - - /// - /// Initializes a new instance of a TagDefinition. - /// - /// The name of the tag. - /// The name of the tag is null or blank. - protected TagDefinition(string tagName) - : this(tagName, false) - { - } - - /// - /// Initializes a new instance of a TagDefinition. - /// - /// The name of the tag. - /// Specifies whether the tag is built-in or not. Checks are not performed on the names of built-in tags. - internal TagDefinition(string tagName, bool isBuiltIn) - { - if (!isBuiltIn && !RegexHelper.IsValidIdentifier(tagName)) - { - throw new ArgumentException(Resources.BlankTagName, "tagName"); - } - _tagName = tagName; - } - - /// - /// Gets the name of the tag. - /// - public string Name - { - get { return _tagName; } - } - - internal bool IsSetter - { - get { return GetIsSetter(); } - } - - protected virtual bool GetIsSetter() - { - return false; - } - - /// - /// Gets whether the tag is limited to the parent tag's context. - /// - internal bool IsContextSensitive - { - get { return GetIsContextSensitive(); } - } - - /// - /// Gets whether a tag is limited to the parent tag's context. - /// - protected virtual bool GetIsContextSensitive() - { - return false; - } - - /// - /// Gets the parameters that are defined for the tag. - /// - internal IEnumerable Parameters - { - get { return GetParameters(); } - } - - /// - /// Specifies which parameters are passed to the tag. - /// - /// The tag parameters. - protected virtual IEnumerable GetParameters() - { - return new TagParameter[] { }; - } - - /// - /// Gets whether the tag contains content. - /// - internal bool HasContent - { - get { return GetHasContent(); } - } - - /// - /// Gets whether tag has content. - /// - /// True if the tag has content; otherwise, false. - protected abstract bool GetHasContent(); - - /// - /// Gets the tags that can indicate that the tag has closed. - /// This field is only used if no closing tag is expected. - /// - internal IEnumerable ClosingTags - { - get { return GetClosingTags(); } - } - - protected virtual IEnumerable GetClosingTags() - { - if (HasContent) - { - return new string[] { Name }; - } - else - { - return new string[] { }; - } - } - - /// - /// Gets the tags that are in scope within the current tag. - /// - internal IEnumerable ChildTags - { - get { return GetChildTags(); } - } - - /// - /// Specifies which tags are scoped under the current tag. - /// - /// The child tag definitions. - protected virtual IEnumerable GetChildTags() - { - return new string[] { }; - } - - /// - /// Gets the parameter that will be used to create a new child scope. - /// - /// The parameter that will be used to create a new child scope -or- null if no new scope is created. - public abstract IEnumerable GetChildContextParameters(); - - /// - /// Gets the context to use when building the inner text of the tag. - /// - /// The text writer passed - /// The current key scope. - /// The arguments passed to the tag. - /// The scope to use when building the inner text of the tag. - public virtual IEnumerable GetChildContext( - TextWriter writer, - Scope keyScope, - Dictionary arguments, - Scope contextScope) - { - NestedContext context = new NestedContext() - { - KeyScope = keyScope, - Writer = writer, - ContextScope = contextScope.CreateChildScope() - }; - yield return context; - } - - /// - /// Applies additional formatting to the inner text of the tag. - /// - /// The text writer to write to. - /// The arguments passed to the tag. - /// The data associated to the context. - public virtual void GetText(TextWriter writer, Dictionary arguments, Scope context) - { - } - - /// - /// Consolidates the text in the given writer to a string, using the given arguments as necessary. - /// - /// The writer containing the text to consolidate. - /// The arguments passed to the tag. - /// The consolidated string. - public virtual string ConsolidateWriter(TextWriter writer, Dictionary arguments) - { - return writer.ToString(); - } - - /// - /// Requests which generator group to associate the given tag type. - /// - /// The child tag definition being grouped. - /// The name of the group to associate the given tag with. - public virtual bool ShouldCreateSecondaryGroup(TagDefinition definition) - { - return false; - } - - /// - /// Gets whether the group with the given name should have text generated for them. - /// - /// The arguments passed to the tag. - /// True if text should be generated for the group; otherwise, false. - public virtual bool ShouldGeneratePrimaryGroup(Dictionary arguments) - { - return true; - } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/TagParameter.cs b/OSS/mustache-sharp/mustache-sharp/TagParameter.cs deleted file mode 100644 index 07235c0..0000000 --- a/OSS/mustache-sharp/mustache-sharp/TagParameter.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using Mustache.Properties; - -namespace Mustache -{ - /// - /// Defines a parameter belonging to a custom tag. - /// - public sealed class TagParameter - { - private readonly string _name; - - /// - /// Initializes a new instance of a TagParameter. - /// - /// The name of the parameter. - /// The parameter name is null or an invalid identifier. - public TagParameter(string parameterName) - { - if (!RegexHelper.IsValidIdentifier(parameterName)) - { - throw new ArgumentException(Resources.BlankParameterName, "parameterName"); - } - _name = parameterName; - } - - /// - /// Gets the name of the parameter. - /// - public string Name - { - get { return _name; } - } - - /// - /// Gets or sets whether the field is required. - /// - public bool IsRequired - { - get; - set; - } - - /// - /// Gets or sets the default value to use when an argument is not provided - /// for the parameter. - /// - public object DefaultValue - { - get; - set; - } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/UpcastDictionary.cs b/OSS/mustache-sharp/mustache-sharp/UpcastDictionary.cs deleted file mode 100644 index e32ba21..0000000 --- a/OSS/mustache-sharp/mustache-sharp/UpcastDictionary.cs +++ /dev/null @@ -1,212 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; - -namespace Mustache -{ - internal static class UpcastDictionary - { - public static IDictionary Create(object source) - { - if (source == null) - { - return null; - } - IDictionary sourceDictionary = source as IDictionary; - if (sourceDictionary != null) - { - return sourceDictionary; - } - Type sourceType = source.GetType(); - var types = getTypes(sourceType); - return getDictionary(types, source); - } - - private static IEnumerable getTypes(Type sourceType) - { - Queue pending = new Queue(); - HashSet visited = new HashSet(); - pending.Enqueue(sourceType); - - while (pending.Count != 0) - { - Type type = pending.Dequeue(); - visited.Add(type); - yield return type; - - if (type.BaseType != null) - { - if (!visited.Contains(type.BaseType)) - { - pending.Enqueue(type.BaseType); - } - } - - foreach (Type interfaceType in type.GetInterfaces()) - { - if (!visited.Contains(interfaceType)) - { - pending.Enqueue(interfaceType); - } - } - } - } - - private static IDictionary getDictionary(IEnumerable types, object source) - { - var dictionaries = from type in types - let valueType = getValueType(type) - where valueType != null - let upcastType = typeof(UpcastDictionary<>).MakeGenericType(valueType) - select (IDictionary)Activator.CreateInstance(upcastType, source); - return dictionaries.FirstOrDefault(); - } - - private static Type getValueType(Type type) - { - if (!type.IsGenericType) - { - return null; - } - Type[] argumentTypes = type.GetGenericArguments(); - if (argumentTypes.Length != 2) - { - return null; - } - Type keyType = argumentTypes[0]; - if (keyType != typeof(string)) - { - return null; - } - Type valueType = argumentTypes[1]; - Type genericType = typeof(IDictionary<,>).MakeGenericType(typeof(string), valueType); - if (!genericType.IsAssignableFrom(type)) - { - return null; - } - return valueType; - } - } - - internal class UpcastDictionary : IDictionary - { - private readonly IDictionary dictionary; - - public UpcastDictionary(IDictionary dictionary) - { - this.dictionary = dictionary; - } - - [EditorBrowsable(EditorBrowsableState.Never)] - void IDictionary.Add(string key, object value) - { - throw new NotSupportedException(); - } - - public bool ContainsKey(string key) - { - return dictionary.ContainsKey(key); - } - - public ICollection Keys - { - get { return dictionary.Keys; } - } - - [EditorBrowsable(EditorBrowsableState.Never)] - bool IDictionary.Remove(string key) - { - throw new NotSupportedException(); - } - - public bool TryGetValue(string key, out object value) - { - TValue result; - if (dictionary.TryGetValue(key, out result)) - { - value = result; - return true; - } - else - { - value = null; - return false; - } - } - - public ICollection Values - { - get { return dictionary.Values.Cast().ToArray(); } - } - - public object this[string key] - { - get - { - return dictionary[key]; - } - [EditorBrowsable(EditorBrowsableState.Never)] - set - { - throw new NotSupportedException(); - } - } - - [EditorBrowsable(EditorBrowsableState.Never)] - void ICollection>.Add(KeyValuePair item) - { - throw new NotSupportedException(); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - void ICollection>.Clear() - { - throw new NotSupportedException(); - } - - bool ICollection>.Contains(KeyValuePair item) - { - if (!(item.Value is TValue)) - { - return false; - } - KeyValuePair pair = new KeyValuePair(item.Key, (TValue)item.Value); - ICollection> collection = dictionary; - return dictionary.Contains(pair); - } - - void ICollection>.CopyTo(KeyValuePair[] array, int arrayIndex) - { - var pairs = dictionary.Select(p => new KeyValuePair(p.Key, p.Value)).ToArray(); - pairs.CopyTo(array, arrayIndex); - } - - public int Count - { - get { return dictionary.Count; } - } - - bool ICollection>.IsReadOnly - { - get { return true; } - } - - [EditorBrowsable(EditorBrowsableState.Never)] - bool ICollection>.Remove(KeyValuePair item) - { - throw new NotSupportedException(); - } - - public IEnumerator> GetEnumerator() - { - return dictionary.Select(p => new KeyValuePair(p.Key, p.Value)).GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/ValueRequestEventArgs.cs b/OSS/mustache-sharp/mustache-sharp/ValueRequestEventArgs.cs deleted file mode 100644 index f6e2c9a..0000000 --- a/OSS/mustache-sharp/mustache-sharp/ValueRequestEventArgs.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -namespace Mustache -{ - /// - /// Holds the value that a context variable is set to. - /// - public class ValueRequestEventArgs : EventArgs - { - /// - /// Gets or sets the value being set. - /// - public object Value { get; set; } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/VariableArgument.cs b/OSS/mustache-sharp/mustache-sharp/VariableArgument.cs deleted file mode 100644 index c59e128..0000000 --- a/OSS/mustache-sharp/mustache-sharp/VariableArgument.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; - -namespace Mustache -{ - public class VariableArgument : IArgument - { - private readonly string name; - - public VariableArgument(string name) - { - this.name = name; - } - - public string GetKey() - { - return null; - } - - public object GetValue(Scope keyScope, Scope contextScope) - { - return contextScope.Find(name); - } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/VariableFoundEventArgs.cs b/OSS/mustache-sharp/mustache-sharp/VariableFoundEventArgs.cs deleted file mode 100644 index 2d15ccc..0000000 --- a/OSS/mustache-sharp/mustache-sharp/VariableFoundEventArgs.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using Mustache.Properties; - -namespace Mustache -{ - /// - /// Holds the information descibing a variable that is found in a template. - /// - public class VariableFoundEventArgs : EventArgs - { - /// - /// Initializes a new instance of a VariableFoundEventArgs. - /// - /// The key that was found. - /// The alignment that will be applied to the substitute value. - /// The formatting that will be applied to the substitute value. - /// The context where the placeholder was found. - internal VariableFoundEventArgs(string name, string alignment, string formatting, Context[] context) - { - Name = name; - Alignment = alignment; - Formatting = formatting; - Context = context; - } - - /// - /// Gets or sets the key that was found. - /// - public string Name { get; set; } - - /// - /// Gets or sets the alignment that will be applied to the substitute value. - /// - public string Alignment { get; set; } - - /// - /// Gets or sets the formatting that will be applied to the substitute value. - /// - public string Formatting { get; set; } - - /// - /// Gets the context where the placeholder was found. - /// - public Context[] Context { get; private set; } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/WithTagDefinition.cs b/OSS/mustache-sharp/mustache-sharp/WithTagDefinition.cs deleted file mode 100644 index 7ef40b5..0000000 --- a/OSS/mustache-sharp/mustache-sharp/WithTagDefinition.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; - -namespace Mustache -{ - /// - /// Defines a tag that changes the scope to the object passed as an argument. - /// - internal sealed class WithTagDefinition : ContentTagDefinition - { - private const string contextParameter = "context"; - private static readonly TagParameter context = new TagParameter(contextParameter) { IsRequired = true }; - - /// - /// Initializes a new instance of a WithTagDefinition. - /// - public WithTagDefinition() - : base("with", true) - { - } - - /// - /// Gets whether the tag only exists within the scope of its parent. - /// - protected override bool GetIsContextSensitive() - { - return false; - } - - /// - /// Gets the parameters that can be passed to the tag. - /// - /// The parameters. - protected override IEnumerable GetParameters() - { - return new TagParameter[] { context }; - } - - /// - /// Gets the parameters that are used to create a new child context. - /// - /// The parameters that are used to create a new child context. - public override IEnumerable GetChildContextParameters() - { - return new TagParameter[] { context }; - } - - /// - /// Gets the context to use when building the inner text of the tag. - /// - /// The text writer passed - /// The current key scope. - /// The arguments passed to the tag. - /// The scope to use when building the inner text of the tag. - public override IEnumerable GetChildContext( - TextWriter writer, - Scope keyScope, - Dictionary arguments, - Scope contextScope) - { - object contextSource = arguments[contextParameter]; - NestedContext context = new NestedContext() - { - KeyScope = keyScope.CreateChildScope(contextSource), - Writer = writer, - ContextScope = contextScope.CreateChildScope() - }; - yield return context; - } - } -} diff --git a/OSS/mustache-sharp/mustache-sharp/mustache-sharp.csproj b/OSS/mustache-sharp/mustache-sharp/mustache-sharp.csproj deleted file mode 100644 index 22eecdc..0000000 --- a/OSS/mustache-sharp/mustache-sharp/mustache-sharp.csproj +++ /dev/null @@ -1,97 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {D71B378F-A4BA-4263-A4F0-07A49A0C528D} - Library - Properties - Mustache - mustache-sharp - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - True - Resources.resx - - - - - - - - - - - - - ResXFileCodeGenerator - Resources.Designer.cs - - - - - \ No newline at end of file diff --git a/OSS/mustache-sharp/mustache-sharp/mustache-sharp.nuspec b/OSS/mustache-sharp/mustache-sharp/mustache-sharp.nuspec deleted file mode 100644 index ed5c838..0000000 --- a/OSS/mustache-sharp/mustache-sharp/mustache-sharp.nuspec +++ /dev/null @@ -1,17 +0,0 @@ - - - - $id$ - $version$ - $title$ - $author$ - $author$ - http://github.com/jehugaleahsa/mustache-sharp - false - $description$ - Copyright 2013 - - mustache handlebars.js text generation building template - - - \ No newline at end of file diff --git a/OpenSourceNotes.md b/OpenSourceNotes.md index 79a22d1..439b250 100644 --- a/OpenSourceNotes.md +++ b/OpenSourceNotes.md @@ -3,9 +3,8 @@ The API Documentation Tool uses the following open source components: * [Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json) - Json parser for .NET apps. MIT license, Copyright (c) 2007 James Newton-King. * [CommandLineParser](https://commandline.codeplex.com/) - Command line parser library. MIT license, Copyright (c) 2005 - 2012 Giacomo Stelluti Scala. -* [AsyncEx](https://github.com/StephenCleary/AsyncEx/) - Command line Async helper. MIT license, Copyright (c) 2014 StephenCleary. -* [MarkdownDeep](https://github.com/toptensoftware/MarkdownDeep) - Markdown for C# parser. Apache 2.0 license, Copyright (C) 2010-2011 Topten Software. * [mustache-sharp] (https://github.com/jehugaleahsa/mustache-sharp) - An extension of the mustache text template engine for .NET. Public domain. +* [MarkdownDeep](https://github.com/toptensoftware/MarkdownDeep) - Markdown for C# parser. Apache 2.0 license, Copyright (C) 2010-2011 Topten Software. ## Markdown Deep diff --git a/license.txt b/license.txt new file mode 100644 index 0000000..ac124d7 --- /dev/null +++ b/license.txt @@ -0,0 +1,22 @@ +Markdown Scanner +Copyright (c) Microsoft Corporation +All rights reserved. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the ""Software""), to deal in +the Software without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the +Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.