Code39Symbology Class
Represents a bar code symbology implementation for Code 39
.
This symbology is also known as Alpha39, Code 39 mod 43, Code 3 of 9, Code 3/9, USD-3, and USS Code 39.
public class Code39Symbology : LinearBarCodeSymbology
- Inheritance:
- object Visual UIElement FrameworkElement BarCodeSymbology LinearBarCodeSymbology object
- Derived:
- Code39ExtendedSymbology
Remarks
Code 39 is a linear symbology, and is one of the first alphanumeric bar codes. Each character encoded is made up of 5 bars and 4 spaces for a total of 9 elements. 3 out of the 9 element are always wide. Although it is not as dense of a symbology such as Code 128, it is one of the most widely supported symbologies by devices.
This symbology can encode numbers, uppercase letters, and -$% ./+
characters.
Each encoded value must start and stop with *
, which is automatically inserted.
The AreStartStopCharactersVisible property determines whether these start/stop characters are included
in the DisplayValue.
This symbology is self-checking, so no checksum or check digit is required.
However if the IsChecksumEnabled property is true
, the symbology's implementation auto-calculates and inserts
a check digit. This is referred to as Code 39 mod 43.
An extended implementation of Code 39 is available in Code39ExtendedSymbology. That implementation allows for all lower 128 ASCII characters to be encoded based on the core Code 39 concepts.
For detailed documentation on this symbology's features and how to use them, please see the Code 39 documentation topic.
Constructors
Code39Symbology()
Initializes an instance of the Code39Symbology
class.
public Code39Symbology()
Properties
AreStartStopCharactersVisible
Gets or sets whether the start/stop characters (*) are visible in the displayed value.
public bool AreStartStopCharactersVisible { get; set; }
Property Value
- bool:
true
if the start/stop characters (*) are visible in the displayed value; otherwise,false
. The default value isfalse
.
IsChecksumEnabled
Gets or sets whether the optional checksum should be added.
public bool IsChecksumEnabled { get; set; }
Property Value
- bool:
true
if the optional checksum should be added; otherwise,false
. The default value isfalse
.
Methods
OnValueChanged(string, string)
Occurs when the value of the Value property is changed.
protected override void OnValueChanged(string oldValue, string newValue)
Parameter | Type | Description |
---|---|---|
oldValue | string | The old value. |
newValue | string | The new value. |
PreprocessCharacter(char)
Pre-processes the specified character and expands it if necessary.
protected virtual string PreprocessCharacter(char ch)
Parameter | Type | Description |
---|---|---|
ch | char | The character to examine. |
Returns
- string:
The pre-processing result.
ValidateValue(string)
Validates that the symbology can parse the specified value.
public override ValidationResult ValidateValue(string value)
Parameter | Type | Description |
---|---|---|
value | string | The value to validate. |
Returns
- ValidationResult:
A ValidationResult containing the result of the validation.
Fields
AreStartStopCharactersVisibleProperty
Identifies the AreStartStopCharactersVisible dependency property. This field is read-only.
public static readonly DependencyProperty AreStartStopCharactersVisibleProperty
IsChecksumEnabledProperty
Identifies the IsChecksumEnabled dependency property. This field is read-only.
public static readonly DependencyProperty IsChecksumEnabledProperty
Inherited Members
- LinearBarCodeSymbology.BarDataProperty
- LinearBarCodeSymbology.BarHeightProperty
- LinearBarCodeSymbology.BarWidthRatioProperty
- LinearBarCodeSymbology.DisplayValueProperty
- LinearBarCodeSymbology.InstructionsProperty
- LinearBarCodeSymbology.MinBarHeightWidthRatioProperty
- LinearBarCodeSymbology.QuietZoneThicknessProperty
- LinearBarCodeSymbology.ValueDisplayStyleProperty
- LinearBarCodeSymbology.ValueIntrusionOffsetProperty
- LinearBarCodeSymbology.MeasureOverride(Size)
- LinearBarCodeSymbology.Render(DrawingContext, Point, Size)
- LinearBarCodeSymbology.BarData
- LinearBarCodeSymbology.BarHeight
- LinearBarCodeSymbology.BarWidthRatio
- LinearBarCodeSymbology.DisplayValue
- LinearBarCodeSymbology.Instructions
- LinearBarCodeSymbology.MinBarHeightWidthRatio
- LinearBarCodeSymbology.QuietZoneThickness
- LinearBarCodeSymbology.ValueDisplayStyle
- LinearBarCodeSymbology.ValueIntrusionOffset
- BarCodeSymbology.BackgroundProperty
- BarCodeSymbology.ForegroundProperty
- BarCodeSymbology.ValueProperty
- BarCodeSymbology.MeasureDesiredSize(Size)
- BarCodeSymbology.OnRender(DrawingContext)
- BarCodeSymbology.ToBitmap(double, double)
- BarCodeSymbology.Background
- BarCodeSymbology.DisplayName
- BarCodeSymbology.Foreground
- BarCodeSymbology.Value