Comments (4)
Please try Enum.TryParse<BarcodeFormat>("All_1D", out BarcodeFormat format);
from zxing.net.
It works as expected, but you have to take care of the upper case and lower case.
[Test]
public void Test_Enum()
{
BarcodeFormat format;
Enum.TryParse("All_1D", out format);
Assert.That(format, Is.EqualTo(BarcodeFormat.All_1D));
Enum.TryParse<BarcodeFormat>("All_1D", out format);
Assert.That(format, Is.EqualTo(BarcodeFormat.All_1D));
Enum.TryParse("all_1d", true, out format);
Assert.That(format, Is.EqualTo(BarcodeFormat.All_1D));
Enum.TryParse("ALL_1D", true, out format);
Assert.That(format, Is.EqualTo(BarcodeFormat.All_1D));
}
from zxing.net.
Interesting. I did further testing and realized I was using an all-caps name "ALL_1D" because all of the enum names are in all-caps except for this one. Looking closer, I see that the "L" are actually lower-case in this one name.
So, it does work with the correctly cased name. However, is the use of lower-case "L" a mistake since all other names are fully upper-case? I was using a ToUpper() to force all names passed through to upper-case in an attempt to prevent mistakes. Of course, that will cause the passing of "All_1D" to fail as it becomes "ALL_1D".
from zxing.net.
It's not a mistake. I choose lower case because it is not a real barcode format.
You can use Enum.TryParse("ALL_1D", true, out format);
in this case.
from zxing.net.
Related Issues (20)
- How to improve recognition rate if the barcode is too small? HOT 7
- Need example for QR Scanner on .Net core HOT 1
- how to generate a GS1-128 barcode with parentheses HOT 1
- Unable to read QRCode from scan HOT 1
- Unable to Scan the QRCode in Unity Webgl HOT 1
- UTF-8 not properly detected in some cases - german umlauts corrupted (ASSUME_SHIFT_JIS broken with .Net Core) HOT 9
- MSI barcode reading fails
- RobiniaDocs API Explorer
- A different CODE_39 barcode HOT 1
- Add some unsafe methods? HOT 1
- 0.16.6 vs 0.16.9 HOT 1
- Missing BitmapLuminanceSource in the ZXing.Net Nuget Package: HOT 1
- Version out dated while opening in vs22, using version 4.0 HOT 3
- Scannig QR Code with Oppo devices doesn't work HOT 2
- BitArray.xor() should check length of both arrays HOT 3
- A small log bug HOT 1
- 如何设置条形码的尺寸以及密度 HOT 1
- Renderer for net8.0-android? HOT 4
- ZXing.Net Bindings for SkiaSharp Package missing Linux HOT 4
- Upgrade SkiaSharp - current version had Vulnerabilities HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zxing.net.