From c94e52c0af1840f9f07fe3f69755d52a4f183824 Mon Sep 17 00:00:00 2001 From: andriks2 <42931926+andriks2@users.noreply.github.com> Date: Wed, 19 Aug 2020 16:58:32 +0200 Subject: [PATCH 1/6] Add files via upload Added meta properties CategoryAttribute and DescriptionAttribute --- Source/lib/aztec/encoder/AztecEncodingOptions.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Source/lib/aztec/encoder/AztecEncodingOptions.cs b/Source/lib/aztec/encoder/AztecEncodingOptions.cs index 9fc8774c..4b4418f2 100644 --- a/Source/lib/aztec/encoder/AztecEncodingOptions.cs +++ b/Source/lib/aztec/encoder/AztecEncodingOptions.cs @@ -15,6 +15,7 @@ */ using System; +using System.ComponentModel; using ZXing.Common; @@ -30,6 +31,9 @@ public class AztecEncodingOptions : EncodingOptions /// Representing the minimal percentage of error correction words. /// Note: an Aztec symbol should have a minimum of 25% EC words. /// +#if !NETSTANDARD && !NETFX_CORE && !WindowsCE && !SILVERLIGHT && !PORTABLE && !UNITY + [CategoryAttribute("Standard"), DescriptionAttribute("The minimal percentage of error correction words (> 25%).")] +#endif public int? ErrorCorrection { get @@ -60,6 +64,11 @@ public int? ErrorCorrection /// 0 indicates to use the minimum number of layers (the default) /// a positive number (1, 2, .. 32) specifies a normal (non-compact) Aztec code /// +#if !NETSTANDARD && !NETFX_CORE && !WindowsCE && !SILVERLIGHT && !PORTABLE && !UNITY + [CategoryAttribute("Standard"), DescriptionAttribute("The required number of layers for an Aztec code" + + " -1 to -4 specify a compact code, 0 indicates to use the minimum number of layers and" + + " 1 to 32 specify a normal (non-compact) Aztec code.")] +#endif public int? Layers { get From da76310539a3b788597c31acd58c1a01af0d857e Mon Sep 17 00:00:00 2001 From: andriks2 <42931926+andriks2@users.noreply.github.com> Date: Wed, 19 Aug 2020 17:00:48 +0200 Subject: [PATCH 2/6] Add files via upload Added meta properties CategoryAttribute and DescriptionAttribute --- Source/lib/common/EncodingOptions.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Source/lib/common/EncodingOptions.cs b/Source/lib/common/EncodingOptions.cs index 5f7edfae..87ab9b80 100644 --- a/Source/lib/common/EncodingOptions.cs +++ b/Source/lib/common/EncodingOptions.cs @@ -37,6 +37,9 @@ public class EncodingOptions /// /// Specifies the height of the barcode image /// +#if !NETSTANDARD && !NETFX_CORE && !WindowsCE && !SILVERLIGHT && !PORTABLE && !UNITY + [CategoryAttribute("Output dimensions"), DescriptionAttribute("Height in pixels.")] +#endif public int Height { get @@ -56,6 +59,9 @@ public int Height /// /// Specifies the width of the barcode image /// +#if !NETSTANDARD && !NETFX_CORE && !WindowsCE && !SILVERLIGHT && !PORTABLE && !UNITY + [CategoryAttribute("Output dimensions"), DescriptionAttribute("Width in pixels.")] +#endif public int Width { get @@ -75,6 +81,9 @@ public int Width /// /// Don't put the content string into the output image. /// +#if !NETSTANDARD && !NETFX_CORE && !WindowsCE && !SILVERLIGHT && !PORTABLE && !UNITY + [CategoryAttribute("Output options"), DescriptionAttribute("Output only barcode, no Human Readable Interpretation.")] +#endif public bool PureBarcode { get @@ -96,6 +105,11 @@ public bool PureBarcode /// by format; for example it controls margin before and after the barcode horizontally for /// most 1D formats. /// +#if !NETSTANDARD && !NETFX_CORE && !WindowsCE && !SILVERLIGHT && !PORTABLE && !UNITY + [CategoryAttribute("Output dimensions"), DescriptionAttribute("Specifies margin, in pixels, to use " + + "when generating the barcode. The meaning can vary by format; for example it controls margin " + + "before and after the barcode horizontally for most 1D formats.")] +#endif public int Margin { get @@ -116,6 +130,10 @@ public int Margin /// Specifies whether the data should be encoded to the GS1 standard; /// FNC1 character is added in front of the data /// +#if !NETSTANDARD && !NETFX_CORE && !WindowsCE && !SILVERLIGHT && !PORTABLE && !UNITY + [CategoryAttribute("Standard"), DescriptionAttribute("Specifies whether the data should be encoded " + + "to the GS1 standard; if so a FNC1 character is added in front of the data.")] +#endif public bool GS1Format { get From 9efffa13009c155e9a6817a5eb78c0d480f6ae73 Mon Sep 17 00:00:00 2001 From: andriks2 <42931926+andriks2@users.noreply.github.com> Date: Wed, 19 Aug 2020 17:01:57 +0200 Subject: [PATCH 3/6] Add files via upload Added meta properties CategoryAttribute and DescriptionAttribute --- .../encoder/DatamatrixEncodingOptions.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Source/lib/datamatrix/encoder/DatamatrixEncodingOptions.cs b/Source/lib/datamatrix/encoder/DatamatrixEncodingOptions.cs index 547e8656..20234005 100644 --- a/Source/lib/datamatrix/encoder/DatamatrixEncodingOptions.cs +++ b/Source/lib/datamatrix/encoder/DatamatrixEncodingOptions.cs @@ -15,6 +15,7 @@ */ using System; +using System.ComponentModel; using ZXing.Common; using ZXing.Datamatrix.Encoder; @@ -30,6 +31,9 @@ public class DatamatrixEncodingOptions : EncodingOptions /// /// Specifies the matrix shape for Data Matrix /// +#if !NETSTANDARD && !NETFX_CORE && !WindowsCE && !SILVERLIGHT && !PORTABLE && !UNITY + [CategoryAttribute("Output options"), DescriptionAttribute("Specifies the matrix shape for Data Matrix.")] +#endif public SymbolShapeHint? SymbolShape { get @@ -57,6 +61,9 @@ public SymbolShapeHint? SymbolShape /// /// Specifies a minimum barcode size /// +#if !NETSTANDARD && !NETFX_CORE && !WindowsCE && !SILVERLIGHT && !PORTABLE && !UNITY + [CategoryAttribute("Standard"), DescriptionAttribute("Specifies a minimum barcode size.")] +#endif public Dimension MinSize { get @@ -84,6 +91,9 @@ public Dimension MinSize /// /// Specifies a maximum barcode size /// +#if !NETSTANDARD && !NETFX_CORE && !WindowsCE && !SILVERLIGHT && !PORTABLE && !UNITY + [CategoryAttribute("Standard"), DescriptionAttribute("Specifies a maximum barcode size.")] +#endif public Dimension MaxSize { get @@ -113,6 +123,11 @@ public Dimension MaxSize /// Make sure that the content fits into the encodation value, otherwise there will be an exception thrown. /// standard value: Encodation.ASCII /// +#if !NETSTANDARD && !NETFX_CORE && !WindowsCE && !SILVERLIGHT && !PORTABLE && !UNITY + [CategoryAttribute("Standard"), DescriptionAttribute("Specifies the default encodation." + + " Make sure that the content fits into the encodation value, otherwise there will be an exception thrown." + + " Standard value: Encodation.ASCII")] +#endif public int? DefaultEncodation { get From 9f5ae79761020d1969654cdff8f01168e0e4425d Mon Sep 17 00:00:00 2001 From: andriks2 <42931926+andriks2@users.noreply.github.com> Date: Wed, 19 Aug 2020 17:03:07 +0200 Subject: [PATCH 4/6] Add files via upload Added meta properties CategoryAttribute and DescriptionAttribute --- Source/lib/oned/Code128EncodingOptions.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/lib/oned/Code128EncodingOptions.cs b/Source/lib/oned/Code128EncodingOptions.cs index 30591c17..cb87709a 100644 --- a/Source/lib/oned/Code128EncodingOptions.cs +++ b/Source/lib/oned/Code128EncodingOptions.cs @@ -15,13 +15,14 @@ */ using System; +using System.ComponentModel; using ZXing.Common; namespace ZXing.OneD { /// - /// The class holds the available options for the QrCodeWriter + /// The class holds the available options for the Code128 1D Writer /// [Serializable] public class Code128EncodingOptions : EncodingOptions @@ -29,6 +30,9 @@ public class Code128EncodingOptions : EncodingOptions /// /// if true, don't switch to codeset C for numbers /// +#if !NETSTANDARD && !NETFX_CORE && !WindowsCE && !SILVERLIGHT && !PORTABLE && !UNITY + [CategoryAttribute("Standard"), DescriptionAttribute("If true, don't switch to codeset C for numbers.")] +#endif public bool ForceCodesetB { get From b3e5f17ba68f6be3ca37649e62236201d7629a7a Mon Sep 17 00:00:00 2001 From: andriks2 <42931926+andriks2@users.noreply.github.com> Date: Wed, 19 Aug 2020 17:04:28 +0200 Subject: [PATCH 5/6] Add files via upload Added meta properties CategoryAttribute and DescriptionAttribute --- Source/lib/pdf417/PDF417EncodingOptions.cs | 230 +++++++++++++++++++++ 1 file changed, 230 insertions(+) create mode 100644 Source/lib/pdf417/PDF417EncodingOptions.cs diff --git a/Source/lib/pdf417/PDF417EncodingOptions.cs b/Source/lib/pdf417/PDF417EncodingOptions.cs new file mode 100644 index 00000000..9a7a2feb --- /dev/null +++ b/Source/lib/pdf417/PDF417EncodingOptions.cs @@ -0,0 +1,230 @@ +/* + * Copyright 2012 ZXing.Net authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using System; +using System.ComponentModel; + +using ZXing.Common; +using ZXing.PDF417.Internal; + +namespace ZXing.PDF417 +{ + /// + /// The class holds the available options for the + /// + [Serializable] + public class PDF417EncodingOptions : EncodingOptions + { + /// + /// Specifies whether to use compact mode for PDF417 (type ). + /// +#if !NETSTANDARD && !NETFX_CORE && !WindowsCE && !SILVERLIGHT && !PORTABLE && !UNITY + [CategoryAttribute("Output options"), DescriptionAttribute("Specifies whether to use compact mode.")] +#endif + public bool Compact + { + get + { + if (Hints.ContainsKey(EncodeHintType.PDF417_COMPACT)) + { + return (bool)Hints[EncodeHintType.PDF417_COMPACT]; + } + return false; + } + set { Hints[EncodeHintType.PDF417_COMPACT] = value; } + } + + /// + /// Specifies what compaction mode to use for PDF417 (type + /// ). + /// +#if !NETSTANDARD && !NETFX_CORE && !WindowsCE && !SILVERLIGHT && !PORTABLE && !UNITY + [CategoryAttribute("Standard"), DescriptionAttribute("Specifies what compaction mode to use.")] +#endif + public Compaction Compaction + { + get + { + if (Hints.ContainsKey(EncodeHintType.PDF417_COMPACTION)) + { + return (Compaction)Hints[EncodeHintType.PDF417_COMPACTION]; + } + return Compaction.AUTO; + } + set { Hints[EncodeHintType.PDF417_COMPACTION] = value; } + } + + /// + /// Specifies the minimum and maximum number of rows and columns for PDF417 (type + /// ). + /// +#if !NETSTANDARD && !NETFX_CORE && !WindowsCE && !SILVERLIGHT && !PORTABLE && !UNITY + [CategoryAttribute("Standard"), DescriptionAttribute("Specifies the minimum and maximum number of rows and columns.")] +#endif + public Dimensions Dimensions + { + get + { + if (Hints.ContainsKey(EncodeHintType.PDF417_DIMENSIONS)) + { + return (Dimensions)Hints[EncodeHintType.PDF417_DIMENSIONS]; + } + return null; + } + set { Hints[EncodeHintType.PDF417_DIMENSIONS] = value; } + } + + /// + /// Specifies what degree of error correction to use + /// +#if !NETSTANDARD && !NETFX_CORE && !WindowsCE && !SILVERLIGHT && !PORTABLE && !UNITY + [CategoryAttribute("Standard"), DescriptionAttribute("Specifies what degree of error correction to use.")] +#endif + public PDF417ErrorCorrectionLevel ErrorCorrection + { + get + { + if (Hints.ContainsKey(EncodeHintType.ERROR_CORRECTION)) + { + var value = Hints[EncodeHintType.ERROR_CORRECTION]; + if (value is PDF417ErrorCorrectionLevel) + { + return (PDF417ErrorCorrectionLevel)value; + } + if (value is int) + { + return (PDF417ErrorCorrectionLevel)Enum.Parse(typeof(PDF417ErrorCorrectionLevel), value.ToString(), true); + } + } + return PDF417ErrorCorrectionLevel.L2; + } + set { Hints[EncodeHintType.ERROR_CORRECTION] = value; } + } + + /// + /// Specifies the aspect ratio of the smallest codeword. + /// (Width of narrowest bar / Row Height) + /// +#if !NETSTANDARD && !NETFX_CORE && !WindowsCE && !SILVERLIGHT && !PORTABLE && !UNITY + [CategoryAttribute("Output options"), DescriptionAttribute("Specifies the aspect ratio of the " + + "smallest codeword. (Width of narrowest bar / row height).")] +#endif + public PDF417AspectRatio AspectRatio + { + get + { + if (Hints.ContainsKey(EncodeHintType.PDF417_ASPECT_RATIO)) + { + var value = Hints[EncodeHintType.PDF417_ASPECT_RATIO]; + if (value is PDF417AspectRatio) + { + return (PDF417AspectRatio)value; + } + if (value is int) + { + return (PDF417AspectRatio)Enum.Parse(typeof(PDF417AspectRatio), value.ToString(), true); + } + } + return PDF417AspectRatio.A4; + } + set { Hints[EncodeHintType.PDF417_ASPECT_RATIO] = value; } + } + + /// + /// Specifies the desired output image aspect ratio (Width / Height). + /// The actual aspect ratio is calculated based on the necessary number of codewords. + /// +#if !NETSTANDARD && !NETFX_CORE && !WindowsCE && !SILVERLIGHT && !PORTABLE && !UNITY + [CategoryAttribute("Output options"), DescriptionAttribute("Specifies the desired output image aspect ratio (Width / Height)." + + "The actual aspect ratio is calculated based on the necessary number of codewords.")] +#endif + public float ImageAspectRatio + { + get + { + if (Hints.ContainsKey(EncodeHintType.PDF417_IMAGE_ASPECT_RATIO)) + { + var value = Hints[EncodeHintType.PDF417_IMAGE_ASPECT_RATIO]; + if (value is float) + { + return (float)value; + } + } + return PDF417.Internal.PDF417.DEFAULT_PREFERRED_RATIO; + } + set { Hints[EncodeHintType.PDF417_IMAGE_ASPECT_RATIO] = value; } + } + + /// + /// Specifies what character encoding to use where applicable (type {@link String}) + /// +#if !NETSTANDARD && !NETFX_CORE && !WindowsCE && !SILVERLIGHT && !PORTABLE && !UNITY + [CategoryAttribute("Standard"), DescriptionAttribute("Specifies what character encoding to " + + "use where applicable.")] +#endif + public string CharacterSet + { + get + { + if (Hints.ContainsKey(EncodeHintType.CHARACTER_SET)) + { + return (string)Hints[EncodeHintType.CHARACTER_SET]; + } + return null; + } + set + { + if (value == null) + { + if (Hints.ContainsKey(EncodeHintType.CHARACTER_SET)) + Hints.Remove(EncodeHintType.CHARACTER_SET); + } + else + { + Hints[EncodeHintType.CHARACTER_SET] = value; + } + } + } + + /// + /// Explicitly disables ECI segment when generating PDF417 Code + /// That is against the specification but some + /// readers have problems if the charset is switched from + /// CP437 (default) to UTF-8 with the necessary ECI segment. + /// If you set the property to true you can use different encodings + /// and the ECI segment is omitted. + /// +#if !NETSTANDARD && !NETFX_CORE && !WindowsCE && !SILVERLIGHT && !PORTABLE && !UNITY + [CategoryAttribute("Standard"), DescriptionAttribute("Explicitly disables ECI segment when generating PDF417 Code." + + "That is against the specification but some readers have problems otherwise when switching charset to UTF-8.")] +#endif + public bool DisableECI + { + get + { + if (Hints.ContainsKey(EncodeHintType.DISABLE_ECI)) + { + return (bool)Hints[EncodeHintType.DISABLE_ECI]; + } + return false; + } + set + { + Hints[EncodeHintType.DISABLE_ECI] = value; + } + } + } +} From dafb1971ef0c31435e27956d91adfafb21c5a129 Mon Sep 17 00:00:00 2001 From: andriks2 <42931926+andriks2@users.noreply.github.com> Date: Wed, 19 Aug 2020 17:05:29 +0200 Subject: [PATCH 6/6] Add files via upload Added meta properties CategoryAttribute and DescriptionAttribute --- .../lib/qrcode/encoder/QrCodeEncodingOptions.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Source/lib/qrcode/encoder/QrCodeEncodingOptions.cs b/Source/lib/qrcode/encoder/QrCodeEncodingOptions.cs index 89f31dae..a53467a6 100644 --- a/Source/lib/qrcode/encoder/QrCodeEncodingOptions.cs +++ b/Source/lib/qrcode/encoder/QrCodeEncodingOptions.cs @@ -34,7 +34,8 @@ public class QrCodeEncodingOptions : EncodingOptions /// . /// #if !NETSTANDARD && !NETFX_CORE && !WindowsCE && !SILVERLIGHT && !PORTABLE && !UNITY - [TypeConverter(typeof(ErrorLevelConverter))] + [TypeConverter(typeof(ErrorLevelConverter))] + [CategoryAttribute("Standard"), DescriptionAttribute("Specifies what degree of error correction to use.")] #endif public ErrorCorrectionLevel ErrorCorrection { @@ -63,6 +64,10 @@ public ErrorCorrectionLevel ErrorCorrection /// /// Specifies what character encoding to use where applicable (type ) /// +#if !NETSTANDARD && !NETFX_CORE && !WindowsCE && !SILVERLIGHT && !PORTABLE && !UNITY + [CategoryAttribute("Standard"), DescriptionAttribute("Specifies what character encoding to " + + "use where applicable.")] +#endif public string CharacterSet { get @@ -95,6 +100,10 @@ public string CharacterSet /// If you set the property to true you can use UTF-8 encoding /// and the ECI segment is omitted. /// +#if !NETSTANDARD && !NETFX_CORE && !WindowsCE && !SILVERLIGHT && !PORTABLE && !UNITY + [CategoryAttribute("Standard"), DescriptionAttribute("Explicitly disables ECI segment when generating QR Code." + + "That is against the specification but some readers have problems otherwise when switching charset to UTF-8.")] +#endif public bool DisableECI { get @@ -115,6 +124,11 @@ public bool DisableECI /// Specifies the exact version of QR code to be encoded. An integer, range 1 to 40. If the data specified /// cannot fit within the required version, a WriterException will be thrown. /// +#if !NETSTANDARD && !NETFX_CORE && !WindowsCE && !SILVERLIGHT && !PORTABLE && !UNITY + [CategoryAttribute("Standard"), DescriptionAttribute("Specifies the exact version of QR code to be encoded. " + + "An integer, range 1 to 40. If the data specified cannot fit within the required version, " + + "a WriterException will be thrown.")] +#endif public int? QrVersion { get