This repository was archived by the owner on Feb 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathBarcode.cs
More file actions
63 lines (51 loc) · 1.4 KB
/
Copy pathBarcode.cs
File metadata and controls
63 lines (51 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using System;
namespace Rb.Forms.Barcode.Pcl
{
public class Barcode
{
public enum BarcodeFormat
{
Unknown = 0,
Code128 = 1,
Code39 = 2,
Code93 = 4,
Codabar = 8,
DataMatrix = 16,
Ean13 = 32,
Ean8 = 64,
Itf = 128,
QrCode = 256,
UpcA = 512,
UpcE = 1024,
Pdf417 = 2048,
Interleaved2of5 = 4096,
}
public BarcodeFormat Format { get; private set; }
public String Result { get; private set; }
public Barcode(String result, BarcodeFormat format)
{
this.Result = result;
this.Format = format;
}
public override bool Equals(object obj)
{
Barcode barcode = obj as Barcode;
if (barcode == null) {
return false;
}
if (ReferenceEquals(this, barcode)) {
return true;
}
if (barcode.GetType() != typeof(Barcode)) {
return false;
}
return Format == barcode.Format && Result == barcode.Result;
}
public override int GetHashCode()
{
unchecked {
return Format.GetHashCode() ^ (Result != null ? Result.GetHashCode() : 0);
}
}
}
}