diff --git a/README.md b/README.md index 697872f78..bfdf0590f 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ ExtendedXmlSerializer addresses a lot of these problems and much much more! - Property encryption - Support `XmlElementAttribute`, `XmlRootAttribute`, and `XmlTypeAttribute` for identity resolution - Additional attribute support: `XmlIgnoreAttribute`, `XmlAttributeAttribute`, and `XmlEnumAttribute` -- Deserialization xml from classic `XmlSerializer` (mostly, [details in FAQ](https://github.com/ExtendedXmlSerializer/home/wiki/01.-FAQs#systemxmlserializer-vs-extendedxmlserializer)) +- Deserialization xml from classic `XmlSerializer` (mostly, [details in FAQ](https://github.com/ExtendedXmlSerializer/home/wiki/FAQs#systemxmlserializer-vs-extendedxmlserializer)) Supported platforms: diff --git a/documentation/conceptual/index.md b/documentation/conceptual/index.md new file mode 100644 index 000000000..2046ab15a --- /dev/null +++ b/documentation/conceptual/index.md @@ -0,0 +1,5 @@ +# Concepts and Topics + +Here you will find articles that give a general overview and introduction to ExtendedXmlSerializer. + +**Note:** This section is a mirrored view of our [repository wiki](https://github.com/ExtendedXmlSerializer/home/wiki). All topics here can also be viewed in our wiki. Whereas the content found on site is published and refreshed with each new release of our project, our wiki is updated instantly. As a result, the information on the wiki may differ from the content found within this site. \ No newline at end of file diff --git a/documentation/conceptual/intro.md b/documentation/conceptual/intro.md deleted file mode 100644 index c0478cede..000000000 --- a/documentation/conceptual/intro.md +++ /dev/null @@ -1 +0,0 @@ -# Add your introductions here! diff --git a/documentation/conceptual/toc.yml b/documentation/conceptual/toc.yml index 6356cd8e3..3f2523999 100644 --- a/documentation/conceptual/toc.yml +++ b/documentation/conceptual/toc.yml @@ -1,6 +1,12 @@ - name: Introduction - href: intro.md + href: index.md - name: FAQs - href: documents/01.-FAQs.md + href: documents/FAQs.md - name: The Basics - href: documents/02.-The-Basics.md \ No newline at end of file + href: documents/The-Basics.md +- name: Features + href: documents/Features.md +- name: API Overview + href: documents/API-Overview.md +- name: Example Scenarios + href: documents/Example-Scenarios.md \ No newline at end of file diff --git a/documentation/index.md b/documentation/index.md index 3ae250636..1ebc31967 100644 --- a/documentation/index.md +++ b/documentation/index.md @@ -1,4 +1,27 @@ -# This is the **HOMEPAGE**. -Refer to [Markdown](http://daringfireball.net/projects/markdown/) for how to write markdown files. -## Quick Start Notes: -1. Add images to the *images* folder if the file is referencing an image. +# Welcome! + +Welcome to the ExtendedXmlSerializer documentation site. This is an automated site that is part of our continuous integration workflow and is generated on each new release. + +### [Conceptual Topics](https://extendedxmlserializer.github.io/documentation/conceptual/) + +If you are new to ExtendedXmlSerializer, you might benefit most by [reviewing our conceptual topics](/conceptual/) first to get an overview of our offering. + +### [API Reference](https://extendedxmlserializer.github.io/documentation/reference/) + +Our [API reference](/reference/) is generated from the publicly-accessible surface API of our code. + +### [Releases](https://github.com/ExtendedXmlSerializer/home/releases) + +Want to see a history of our product? Then [check out our releases](https://github.com/ExtendedXmlSerializer/home/releases). + +### [CHANGELOG](https://github.com/ExtendedXmlSerializer/home/blob/master/CHANGELOG.md) + +A [single-page history](https://github.com/ExtendedXmlSerializer/home/blob/master/CHANGELOG.md) of our releases starting with `v2.2.0`. + +### [README](https://github.com/ExtendedXmlSerializer/home/blob/master/README.md) + +[Our repository document](https://github.com/ExtendedXmlSerializer/home/blob/master/README.md) that highlights important high-level information, as most repository README's do. + +### [Submit an issue](https://github.com/ExtendedXmlSerializer/home/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc) + +Found a bug or have a question? [Check out our issues](https://github.com/ExtendedXmlSerializer/home/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc) and see if we can help. \ No newline at end of file diff --git a/documentation/reference/index.md b/documentation/reference/index.md index 78dc9c005..14bf4264e 100644 --- a/documentation/reference/index.md +++ b/documentation/reference/index.md @@ -1,2 +1,7 @@ -# PLACEHOLDER -TODO: Add .NET projects to the *src* folder and run `docfx` to generate **REAL** *API Documentation*! +# ExtendedXmlSerializer API Reference + +Welcome to the API Reference documentation. Here you will find all documented classes from code defined within the ExtendedXmlSerializer project. + +Start by visiting a topic within the Table of Contents. + +If you are unsure of a topic to start with, we recommend visiting the `ConfigurationContainer` ([link](/reference/ExtendedXmlSerializer.Configuration.ConfigurationContainer.html)) as that is where all the fun starts. 👍 \ No newline at end of file diff --git a/documentation/templates/default/styles/main.css b/documentation/templates/default/styles/main.css index dad5f4340..9846822b4 100644 --- a/documentation/templates/default/styles/main.css +++ b/documentation/templates/default/styles/main.css @@ -52,6 +52,7 @@ article h4 { .sidetoc, .sidefilter { margin-left: -15px; } + .row { margin-left: unset; margin-right: unset; } } @media (max-width: 767px) { diff --git a/src/ExtendedXmlSerializer/ExtensionMethodsForContent.cs b/src/ExtendedXmlSerializer/ExtensionMethodsForContent.cs index a572f329c..f9ef47a28 100644 --- a/src/ExtendedXmlSerializer/ExtensionMethodsForContent.cs +++ b/src/ExtendedXmlSerializer/ExtensionMethodsForContent.cs @@ -98,7 +98,7 @@ public static ITypeConfiguration WithMonitor(this ITypeConfiguration @t /// /// The container to configure. /// The configured container. - /// + /// public static IConfigurationContainer EnableParameterizedContent(this IConfigurationContainer @this) => @this.Extend(ParameterizedMembersExtension.Default); diff --git a/src/ExtendedXmlSerializer/ExtensionMethodsForExtensionModel.cs b/src/ExtendedXmlSerializer/ExtensionMethodsForExtensionModel.cs index 192bd2b6f..6dbe09bc0 100644 --- a/src/ExtendedXmlSerializer/ExtensionMethodsForExtensionModel.cs +++ b/src/ExtendedXmlSerializer/ExtensionMethodsForExtensionModel.cs @@ -12,12 +12,12 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using System.Xml; - -// ReSharper disable TooManyArguments - +using System.Xml; + +// ReSharper disable TooManyArguments + namespace ExtendedXmlSerializer -{ +{ /// /// Extension methods that assist or enable functionality found within the extension model namespace ( /// ). @@ -110,7 +110,7 @@ public static IConfigurationContainer EnableExpressions(this IConfigurationConta /// The configuration container to configure. /// The configured configuration container. /// - /// + /// /// public static IConfigurationContainer EnableMarkupExtensions(this IConfigurationContainer @this) => @this.EnableExpressions() diff --git a/test/ExtendedXmlSerializer.Tests.ReportedIssues/Issue282Tests.cs b/test/ExtendedXmlSerializer.Tests.ReportedIssues/Issue282Tests.cs new file mode 100644 index 000000000..c03c1347c --- /dev/null +++ b/test/ExtendedXmlSerializer.Tests.ReportedIssues/Issue282Tests.cs @@ -0,0 +1,58 @@ +using ExtendedXmlSerializer.Configuration; +using ExtendedXmlSerializer.ContentModel; +using ExtendedXmlSerializer.ContentModel.Format; +using ExtendedXmlSerializer.Tests.ReportedIssues.Support; +using FluentAssertions; +using Xunit; + +namespace ExtendedXmlSerializer.Tests.ReportedIssues +{ + public sealed class Issue282Tests + { + [Fact] + void Verify() + { + var serializer = new ConfigurationContainer().Type() + .Register() + .Serializer() + .Using(SubjectSerializer.Default) + .Create() + .ForTesting(); + + var instance = new Subject("Hello World!", 123); + serializer.Assert(instance, @"Hello World!|123"); + serializer.Cycle(instance).Should().BeEquivalentTo(instance); + } + + public sealed class SubjectSerializer : ISerializer + { + public static SubjectSerializer Default { get; } = new SubjectSerializer(); + + SubjectSerializer() {} + + public Subject Get(IFormatReader parameter) + { + var parts = parameter.Content().Split('|'); + var result = new Subject(parts[0], int.Parse(parts[1])); + return result; + } + + public void Write(IFormatWriter writer, Subject instance) + { + writer.Content($"{instance.Text}|{instance.Number}"); + } + } + + public class Subject + { + public Subject(string text, int number) + { + Text = text; + Number = number; + } + + public string Text { get; } + public int Number { get; } + } + } +} \ No newline at end of file