From 2a1cd4fda8a4a8e649910d16b4dfa1ce7ae63543 Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Fri, 12 May 2023 09:24:40 +0800 Subject: *misc --- .../src/CsvHelper/Delegates/BadDataFound.cs | 52 +++++++++++++++++++++ .../src/CsvHelper/Delegates/ConvertFromString.cs | 40 ++++++++++++++++ .../src/CsvHelper/Delegates/ConvertToString.cs | 41 +++++++++++++++++ .../src/CsvHelper/Delegates/GetConstructor.cs | 38 ++++++++++++++++ .../src/CsvHelper/Delegates/GetDelimiter.cs | 44 ++++++++++++++++++ .../CsvHelper/Delegates/GetDynamicPropertyName.cs | 44 ++++++++++++++++++ .../src/CsvHelper/Delegates/HeaderValidated.cs | 46 +++++++++++++++++++ .../src/CsvHelper/Delegates/MissingFieldFound.cs | 53 ++++++++++++++++++++++ .../CsvHelper/Delegates/PrepareHeaderForMatch.cs | 47 +++++++++++++++++++ .../Delegates/ReadingExceptionOccurred.cs | 40 ++++++++++++++++ .../CsvHelper/Delegates/ReferenceHeaderPrefix.cs | 44 ++++++++++++++++++ .../src/CsvHelper/Delegates/ShouldQuote.cs | 51 +++++++++++++++++++++ .../src/CsvHelper/Delegates/ShouldSkipRecord.cs | 37 +++++++++++++++ .../Delegates/ShouldUseConstructorParameters.cs | 38 ++++++++++++++++ .../src/CsvHelper/Delegates/Validate.cs | 53 ++++++++++++++++++++++ 15 files changed, 668 insertions(+) create mode 100644 ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/BadDataFound.cs create mode 100644 ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/ConvertFromString.cs create mode 100644 ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/ConvertToString.cs create mode 100644 ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/GetConstructor.cs create mode 100644 ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/GetDelimiter.cs create mode 100644 ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/GetDynamicPropertyName.cs create mode 100644 ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/HeaderValidated.cs create mode 100644 ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/MissingFieldFound.cs create mode 100644 ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/PrepareHeaderForMatch.cs create mode 100644 ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/ReadingExceptionOccurred.cs create mode 100644 ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/ReferenceHeaderPrefix.cs create mode 100644 ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/ShouldQuote.cs create mode 100644 ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/ShouldSkipRecord.cs create mode 100644 ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/ShouldUseConstructorParameters.cs create mode 100644 ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/Validate.cs (limited to 'ThirdParty/CsvHelper-master/src/CsvHelper/Delegates') diff --git a/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/BadDataFound.cs b/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/BadDataFound.cs new file mode 100644 index 0000000..5f25912 --- /dev/null +++ b/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/BadDataFound.cs @@ -0,0 +1,52 @@ +// Copyright 2009-2022 Josh Close +// This file is a part of CsvHelper and is dual licensed under MS-PL and Apache 2.0. +// See LICENSE.txt for details or visit http://www.opensource.org/licenses/ms-pl.html for MS-PL and http://opensource.org/licenses/Apache-2.0 for Apache 2.0. +// https://github.com/JoshClose/CsvHelper +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CsvHelper +{ + /// + /// Function that gets called when bad data is found. + /// + /// The args. + public delegate void BadDataFound(BadDataFoundArgs args); + + /// + /// Information about the field that caused to be called. + /// + public readonly struct BadDataFoundArgs + { + /// + /// The full field unedited. + /// + public readonly string Field; + + /// + /// The full row unedited. + /// + public readonly string RawRecord; + + /// + /// The context. + /// + public readonly CsvContext Context; + + /// + /// Creates a new instance of BadDataFoundArgs. + /// + /// The full field unedited. + /// The full row unedited. + /// The context. + public BadDataFoundArgs(string field, string rawRecord, CsvContext context) + { + Field = field; + RawRecord = rawRecord; + Context = context; + } + } +} diff --git a/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/ConvertFromString.cs b/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/ConvertFromString.cs new file mode 100644 index 0000000..48b2512 --- /dev/null +++ b/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/ConvertFromString.cs @@ -0,0 +1,40 @@ +// Copyright 2009-2022 Josh Close +// This file is a part of CsvHelper and is dual licensed under MS-PL and Apache 2.0. +// See LICENSE.txt for details or visit http://www.opensource.org/licenses/ms-pl.html for MS-PL and http://opensource.org/licenses/Apache-2.0 for Apache 2.0. +// https://github.com/JoshClose/CsvHelper +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CsvHelper +{ + /// + /// Function that converts a string into an object. + /// + /// The type of the member. + /// The args. + /// The class object. + public delegate TMember ConvertFromString(ConvertFromStringArgs args); + + /// + /// args. + /// + public readonly struct ConvertFromStringArgs + { + /// + /// The row. + /// + public readonly IReaderRow Row; + + /// + /// Creates a new instance of ConvertFromStringArgs. + /// + /// The row. + public ConvertFromStringArgs(IReaderRow row) + { + Row = row; + } + } +} diff --git a/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/ConvertToString.cs b/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/ConvertToString.cs new file mode 100644 index 0000000..478526e --- /dev/null +++ b/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/ConvertToString.cs @@ -0,0 +1,41 @@ +// Copyright 2009-2022 Josh Close +// This file is a part of CsvHelper and is dual licensed under MS-PL and Apache 2.0. +// See LICENSE.txt for details or visit http://www.opensource.org/licenses/ms-pl.html for MS-PL and http://opensource.org/licenses/Apache-2.0 for Apache 2.0. +// https://github.com/JoshClose/CsvHelper +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CsvHelper +{ + /// + /// Function that converts an object into a string. + /// + /// The type of the class. + /// The args. + /// The string. + public delegate string ConvertToString(ConvertToStringArgs args); + + /// + /// args. + /// + /// The value to convert. + public readonly struct ConvertToStringArgs + { + /// + /// The value to convert. + /// + public readonly TClass Value; + + /// + /// Creates a new instance of ConvertToStringArgs{TClass}. + /// + /// The value to convert. + public ConvertToStringArgs(TClass value) + { + Value = value; + } + } +} diff --git a/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/GetConstructor.cs b/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/GetConstructor.cs new file mode 100644 index 0000000..8678a5c --- /dev/null +++ b/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/GetConstructor.cs @@ -0,0 +1,38 @@ +// Copyright 2009-2022 Josh Close +// This file is a part of CsvHelper and is dual licensed under MS-PL and Apache 2.0. +// See LICENSE.txt for details or visit http://www.opensource.org/licenses/ms-pl.html for MS-PL and http://opensource.org/licenses/Apache-2.0 for Apache 2.0. +// https://github.com/JoshClose/CsvHelper +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace CsvHelper +{ + /// + /// Function that chooses the constructor to use for constructor mapping. + /// + public delegate ConstructorInfo GetConstructor(GetConstructorArgs args); + + /// + /// GetConstructor args. + /// + public readonly struct GetConstructorArgs + { + /// + /// The class type. + /// + public readonly Type ClassType; + + /// + /// Creates a new instance of GetConstructorArgs. + /// + /// The class type. + public GetConstructorArgs(Type classType) + { + ClassType = classType; + } + } +} diff --git a/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/GetDelimiter.cs b/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/GetDelimiter.cs new file mode 100644 index 0000000..2593200 --- /dev/null +++ b/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/GetDelimiter.cs @@ -0,0 +1,44 @@ +using CsvHelper.Configuration; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CsvHelper.Delegates +{ + /// + /// Function that resolves the delimiter from the given text. + /// Returns null if no delimiter is found. + /// + /// + /// + public delegate string? GetDelimiter(GetDelimiterArgs args); + + /// + /// GetDelimiter args. + /// + public readonly struct GetDelimiterArgs + { + /// + /// The text to resolve the delimiter from. + /// + public readonly string Text; + + /// + /// The configuration. + /// + public readonly IParserConfiguration Configuration; + + /// + /// Creates an instance of GetDelimiterArgs. + /// + /// The text to resolve the delimiter from. + /// The configuration. + public GetDelimiterArgs(string text, IParserConfiguration configuration) + { + Text = text; + Configuration = configuration; + } + } +} diff --git a/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/GetDynamicPropertyName.cs b/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/GetDynamicPropertyName.cs new file mode 100644 index 0000000..4a761d6 --- /dev/null +++ b/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/GetDynamicPropertyName.cs @@ -0,0 +1,44 @@ +// Copyright 2009-2022 Josh Close +// This file is a part of CsvHelper and is dual licensed under MS-PL and Apache 2.0. +// See LICENSE.txt for details or visit http://www.opensource.org/licenses/ms-pl.html for MS-PL and http://opensource.org/licenses/Apache-2.0 for Apache 2.0. +// https://github.com/JoshClose/CsvHelper +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CsvHelper +{ + /// + /// Function that gets the name to use for the property of the dynamic object. + /// + public delegate string GetDynamicPropertyName(GetDynamicPropertyNameArgs args); + + /// + /// GetDynamicPropertyName args. + /// + public readonly struct GetDynamicPropertyNameArgs + { + /// + /// The field index. + /// + public readonly int FieldIndex; + + /// + /// The context. + /// + public readonly CsvContext Context; + + /// + /// Creates a new instance of GetDynamicPropertyNameArgs. + /// + /// The field index. + /// The context. + public GetDynamicPropertyNameArgs(int fieldIndex, CsvContext context) + { + FieldIndex = fieldIndex; + Context = context; + } + } +} diff --git a/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/HeaderValidated.cs b/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/HeaderValidated.cs new file mode 100644 index 0000000..07836d3 --- /dev/null +++ b/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/HeaderValidated.cs @@ -0,0 +1,46 @@ +// Copyright 2009-2022 Josh Close +// This file is a part of CsvHelper and is dual licensed under MS-PL and Apache 2.0. +// See LICENSE.txt for details or visit http://www.opensource.org/licenses/ms-pl.html for MS-PL and http://opensource.org/licenses/Apache-2.0 for Apache 2.0. +// https://github.com/JoshClose/CsvHelper +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CsvHelper +{ + /// + /// Function that is called when a header validation check is ran. The default function + /// will throw a if there is no header for a given member mapping. + /// You can supply your own function to do other things like logging the issue instead of throwing an exception. + /// + public delegate void HeaderValidated(HeaderValidatedArgs args); + + /// + /// HeaderValidated args. + /// + public readonly struct HeaderValidatedArgs + { + /// + /// The invalid headers. + /// + public readonly InvalidHeader[] InvalidHeaders; + + /// + /// The context. + /// + public readonly CsvContext Context; + + /// + /// Creates a new instance of HeaderValidatedArgs. + /// + /// The invalid headers. + /// The context. + public HeaderValidatedArgs(InvalidHeader[] invalidHeaders, CsvContext context) + { + InvalidHeaders = invalidHeaders; + Context = context; + } + } +} diff --git a/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/MissingFieldFound.cs b/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/MissingFieldFound.cs new file mode 100644 index 0000000..cb725fb --- /dev/null +++ b/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/MissingFieldFound.cs @@ -0,0 +1,53 @@ +// Copyright 2009-2022 Josh Close +// This file is a part of CsvHelper and is dual licensed under MS-PL and Apache 2.0. +// See LICENSE.txt for details or visit http://www.opensource.org/licenses/ms-pl.html for MS-PL and http://opensource.org/licenses/Apache-2.0 for Apache 2.0. +// https://github.com/JoshClose/CsvHelper +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CsvHelper +{ + /// + /// Function that is called when a missing field is found. The default function will + /// throw a . You can supply your own function to do other things + /// like logging the issue instead of throwing an exception. + /// + public delegate void MissingFieldFound(MissingFieldFoundArgs args); + + /// + /// MissingFieldFound args. + /// + public readonly struct MissingFieldFoundArgs + { + /// + /// The header names. + /// + public readonly string[]? HeaderNames; + + /// + /// The index. + /// + public readonly int Index; + + /// + /// The context. + /// + public readonly CsvContext Context; + + /// + /// Creates a new instance of MissingFieldFoundArgs. + /// + /// The header names. + /// The index. + /// The context. + public MissingFieldFoundArgs(string[]? headerNames, int index, CsvContext context) + { + HeaderNames = headerNames; + Index = index; + Context = context; + } + } +} diff --git a/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/PrepareHeaderForMatch.cs b/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/PrepareHeaderForMatch.cs new file mode 100644 index 0000000..061e493 --- /dev/null +++ b/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/PrepareHeaderForMatch.cs @@ -0,0 +1,47 @@ +// Copyright 2009-2022 Josh Close +// This file is a part of CsvHelper and is dual licensed under MS-PL and Apache 2.0. +// See LICENSE.txt for details or visit http://www.opensource.org/licenses/ms-pl.html for MS-PL and http://opensource.org/licenses/Apache-2.0 for Apache 2.0. +// https://github.com/JoshClose/CsvHelper +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CsvHelper +{ + /// + /// Function that prepares the header field for matching against a member name. + /// The header field and the member name are both ran through this function. + /// You should do things like trimming, removing whitespace, removing underscores, + /// and making casing changes to ignore case. + /// + public delegate string PrepareHeaderForMatch(PrepareHeaderForMatchArgs args); + + /// + /// PrepareHeaderForMatch args. + /// + public readonly struct PrepareHeaderForMatchArgs + { + /// + /// The header. + /// + public readonly string Header; + + /// + /// The field index. + /// + public readonly int FieldIndex; + + /// + /// Creates a new instance of PrepareHeaderForMatchArgs. + /// + /// The header. + /// The field index. + public PrepareHeaderForMatchArgs(string header, int fieldIndex) + { + Header = header; + FieldIndex = fieldIndex; + } + } +} diff --git a/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/ReadingExceptionOccurred.cs b/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/ReadingExceptionOccurred.cs new file mode 100644 index 0000000..c3737ef --- /dev/null +++ b/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/ReadingExceptionOccurred.cs @@ -0,0 +1,40 @@ +// Copyright 2009-2022 Josh Close +// This file is a part of CsvHelper and is dual licensed under MS-PL and Apache 2.0. +// See LICENSE.txt for details or visit http://www.opensource.org/licenses/ms-pl.html for MS-PL and http://opensource.org/licenses/Apache-2.0 for Apache 2.0. +// https://github.com/JoshClose/CsvHelper +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CsvHelper +{ + /// + /// Function that is called when a reading exception occurs. + /// The default function will re-throw the given exception. If you want to ignore + /// reading exceptions, you can supply your own function to do other things like + /// logging the issue. + /// + public delegate bool ReadingExceptionOccurred(ReadingExceptionOccurredArgs args); + + /// + /// ReadingExceptionOccurred args. + /// + public readonly struct ReadingExceptionOccurredArgs + { + /// + /// The exception. + /// + public readonly CsvHelperException Exception; + + /// + /// Creates a new instance of ReadingExceptionOccurredArgs. + /// + /// The exception. + public ReadingExceptionOccurredArgs(CsvHelperException exception) + { + Exception = exception; + } + } +} diff --git a/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/ReferenceHeaderPrefix.cs b/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/ReferenceHeaderPrefix.cs new file mode 100644 index 0000000..d42d49f --- /dev/null +++ b/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/ReferenceHeaderPrefix.cs @@ -0,0 +1,44 @@ +// Copyright 2009-2022 Josh Close +// This file is a part of CsvHelper and is dual licensed under MS-PL and Apache 2.0. +// See LICENSE.txt for details or visit http://www.opensource.org/licenses/ms-pl.html for MS-PL and http://opensource.org/licenses/Apache-2.0 for Apache 2.0. +// https://github.com/JoshClose/CsvHelper +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CsvHelper +{ + /// + /// Function that will return the prefix for a reference header. + /// + public delegate string ReferenceHeaderPrefix(ReferenceHeaderPrefixArgs args); + + /// + /// ReferenceHeaderPrefix args. + /// + public readonly struct ReferenceHeaderPrefixArgs + { + /// + /// The member type. + /// + public readonly Type MemberType; + + /// + /// The member name. + /// + public readonly string MemberName; + + /// + /// Creates a new instance of ReferenceHeaderPrefixArgs. + /// + /// The member type. + /// The member name. + public ReferenceHeaderPrefixArgs(Type memberType, string memberName) + { + MemberType = memberType; + MemberName = memberName; + } + } +} diff --git a/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/ShouldQuote.cs b/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/ShouldQuote.cs new file mode 100644 index 0000000..ab84ba3 --- /dev/null +++ b/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/ShouldQuote.cs @@ -0,0 +1,51 @@ +// Copyright 2009-2022 Josh Close +// This file is a part of CsvHelper and is dual licensed under MS-PL and Apache 2.0. +// See LICENSE.txt for details or visit http://www.opensource.org/licenses/ms-pl.html for MS-PL and http://opensource.org/licenses/Apache-2.0 for Apache 2.0. +// https://github.com/JoshClose/CsvHelper +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CsvHelper +{ + /// + /// Function that is used to determine if a field should get quoted when writing. + /// + public delegate bool ShouldQuote(ShouldQuoteArgs args); + + /// + /// ShouldQuote args. + /// + public readonly struct ShouldQuoteArgs + { + /// + /// The field. + /// + public readonly string Field; + + /// + /// The field type. + /// + public readonly Type FieldType; + + /// + /// The row. + /// + public readonly IWriterRow Row; + + /// + /// Creates a new instance of ShouldQuoteArgs. + /// + /// The field. + /// The field type. + /// The row. + public ShouldQuoteArgs(string field, Type fieldType, IWriterRow row) + { + Field = field; + FieldType = fieldType; + Row = row; + } + } +} diff --git a/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/ShouldSkipRecord.cs b/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/ShouldSkipRecord.cs new file mode 100644 index 0000000..cf87633 --- /dev/null +++ b/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/ShouldSkipRecord.cs @@ -0,0 +1,37 @@ +// Copyright 2009-2022 Josh Close +// This file is a part of CsvHelper and is dual licensed under MS-PL and Apache 2.0. +// See LICENSE.txt for details or visit http://www.opensource.org/licenses/ms-pl.html for MS-PL and http://opensource.org/licenses/Apache-2.0 for Apache 2.0. +// https://github.com/JoshClose/CsvHelper +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CsvHelper +{ + /// + /// Function that determines whether to skip the given record or not. + /// + public delegate bool ShouldSkipRecord(ShouldSkipRecordArgs args); + + /// + /// ShouldSkipRecord args. + /// + public readonly struct ShouldSkipRecordArgs + { + /// + /// The record. + /// + public readonly IReaderRow Row; + + /// + /// Creates a new instance of ShouldSkipRecordArgs. + /// + /// The row. + public ShouldSkipRecordArgs(IReaderRow row) + { + Row = row; + } + } +} diff --git a/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/ShouldUseConstructorParameters.cs b/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/ShouldUseConstructorParameters.cs new file mode 100644 index 0000000..cfbacd5 --- /dev/null +++ b/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/ShouldUseConstructorParameters.cs @@ -0,0 +1,38 @@ +// Copyright 2009-2022 Josh Close +// This file is a part of CsvHelper and is dual licensed under MS-PL and Apache 2.0. +// See LICENSE.txt for details or visit http://www.opensource.org/licenses/ms-pl.html for MS-PL and http://opensource.org/licenses/Apache-2.0 for Apache 2.0. +// https://github.com/JoshClose/CsvHelper +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CsvHelper +{ + /// + /// Function that determines if constructor parameters should be used to create + /// the class instead of the default constructor and members. + /// + public delegate bool ShouldUseConstructorParameters(ShouldUseConstructorParametersArgs args); + + /// + /// ShouldUseConstructorParameters args. + /// + public readonly struct ShouldUseConstructorParametersArgs + { + /// + /// The parameter type. + /// + public readonly Type ParameterType; + + /// + /// Creates a new instance of ShouldUseConstructorParametersArgs. + /// + /// The parameter type. + public ShouldUseConstructorParametersArgs(Type parameterType) + { + ParameterType = parameterType; + } + } +} diff --git a/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/Validate.cs b/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/Validate.cs new file mode 100644 index 0000000..b2a42ea --- /dev/null +++ b/ThirdParty/CsvHelper-master/src/CsvHelper/Delegates/Validate.cs @@ -0,0 +1,53 @@ +// Copyright 2009-2022 Josh Close +// This file is a part of CsvHelper and is dual licensed under MS-PL and Apache 2.0. +// See LICENSE.txt for details or visit http://www.opensource.org/licenses/ms-pl.html for MS-PL and http://opensource.org/licenses/Apache-2.0 for Apache 2.0. +// https://github.com/JoshClose/CsvHelper +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CsvHelper +{ + /// + /// Function that validates a field. + /// + /// The args. + /// true if the field is valid, otherwise false. + public delegate bool Validate(ValidateArgs args); + + /// + /// Function that gets the exception message when validation fails. + /// + /// The args. + /// The exception message. + public delegate string ValidateMessage(ValidateArgs args); + + /// + /// Validate args. + /// + public readonly struct ValidateArgs + { + /// + /// The field. + /// + public readonly string Field; + + /// + /// The row. + /// + public readonly IReaderRow Row; + + /// + /// Creates a new instance of ValidateArgs. + /// + /// The field. + /// The row. + public ValidateArgs(string field, IReaderRow row) + { + Field = field; + Row = row; + } + } +} -- cgit v1.1-26-g67d0