From 9e52e84ef91db25980066f3130184bcaeb1cfd3d Mon Sep 17 00:00:00 2001 From: Brian Ball Date: Tue, 29 Jan 2019 14:51:03 -0500 Subject: [PATCH] Added more XML document comments. --- ...nventionBasedModelDefinitionInitializer.cs | 11 +++++++++ Args/FluentModelBindingConfiguration.cs | 3 +++ Args/Help/HelpProvider.cs | 6 +++++ Args/Help/IHelpProvider.cs | 12 ++++++++++ Args/Help/MemberHelp.cs | 23 +++++++++++++++---- Args/Help/ModelHelp.cs | 17 ++++++++++---- 6 files changed, 64 insertions(+), 8 deletions(-) diff --git a/Args/ConventionBasedModelDefinitionInitializer.cs b/Args/ConventionBasedModelDefinitionInitializer.cs index dce050e..3fb8456 100644 --- a/Args/ConventionBasedModelDefinitionInitializer.cs +++ b/Args/ConventionBasedModelDefinitionInitializer.cs @@ -69,12 +69,23 @@ public void Initialize(IModelBindingDefinition init) init.SetOrdinalArguments(ordinalArguments.Select(a => a.Value)); } + /// + /// Returns the members for the movided model type + /// + /// + /// protected virtual IEnumerable GetMembers(Type modelType) { return modelType.GetFields(BindingFlags.Instance | BindingFlags.Public) .Concat(modelType.GetProperties(BindingFlags.Instance | BindingFlags.Public).Where(p => p.CanWrite).Cast()); } + /// + /// Detrmines the short version of a switch argument + /// + /// + /// + /// protected virtual string DeriveShortName(IEnumerable members, MemberInfo currentMember) { return DeriveShortNameRecursive(members, currentMember, 1); diff --git a/Args/FluentModelBindingConfiguration.cs b/Args/FluentModelBindingConfiguration.cs index 9066dfc..f7a7b2a 100644 --- a/Args/FluentModelBindingConfiguration.cs +++ b/Args/FluentModelBindingConfiguration.cs @@ -116,6 +116,9 @@ public FluentMemberBindingConfiguration ForMember(Expression + /// Helper methods for fluent configuration + /// public static class FluentModelBindingConfigurationExtensions { /// diff --git a/Args/Help/HelpProvider.cs b/Args/Help/HelpProvider.cs index 8fb22f9..a8e0b31 100644 --- a/Args/Help/HelpProvider.cs +++ b/Args/Help/HelpProvider.cs @@ -38,6 +38,12 @@ public ModelHelp GenerateModelHelp(IModelBindingDefinition defin return modelHelp; } + /// + /// Generates help for members + /// + /// + /// + /// public MemberHelp GenerateMemberHelp(IMemberBindingDefinition definition) { var memberHelp = new MemberHelp diff --git a/Args/Help/IHelpProvider.cs b/Args/Help/IHelpProvider.cs index 156bafd..93e2bb1 100644 --- a/Args/Help/IHelpProvider.cs +++ b/Args/Help/IHelpProvider.cs @@ -10,7 +10,19 @@ namespace Args.Help /// public interface IHelpProvider { + /// + /// Generates help for the provided model definition + /// + /// + /// + /// ModelHelp GenerateModelHelp(IModelBindingDefinition definition); + /// + /// Generates help for the provided member definition + /// + /// + /// + /// MemberHelp GenerateMemberHelp(IMemberBindingDefinition definition); } } \ No newline at end of file diff --git a/Args/Help/MemberHelp.cs b/Args/Help/MemberHelp.cs index 5c3b0af..f4415d5 100644 --- a/Args/Help/MemberHelp.cs +++ b/Args/Help/MemberHelp.cs @@ -1,16 +1,31 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using System.Collections.Generic; namespace Args.Help { + /// + /// Holds help information for model members + /// public class MemberHelp { + /// + /// Name of the member + /// public string Name { get; set; } + /// + /// List of switches configured for the member + /// public IEnumerable Switches { get; set; } + /// + /// The default value if no value is provided + /// public string DefaultValue { get; set; } + /// + /// Help text for the member + /// public string HelpText { get; set; } + /// + /// Ordinal position for the member + /// public int? OrdinalIndex { get; set; } } } diff --git a/Args/Help/ModelHelp.cs b/Args/Help/ModelHelp.cs index f85fe00..359c447 100644 --- a/Args/Help/ModelHelp.cs +++ b/Args/Help/ModelHelp.cs @@ -1,14 +1,23 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using System.Collections.Generic; namespace Args.Help { + /// + /// Holds help information for the model + /// public class ModelHelp { + /// + /// The delimited for the switches + /// public string SwitchDelimiter { get; set; } + /// + /// List of members that are configured + /// public IEnumerable Members { get; set; } + /// + /// Help text for the entire model + /// public string HelpText { get; set; } } }