2
using System.Collections.Generic;
4
using System.Diagnostics;
9
/// The <b>FI1BIT</b> structure represents a single bit.
10
/// It's value can be <i>0</i> or <i>1</i>.
12
[DebuggerDisplay("{value}"),
17
/// Represents the largest possible value of <see cref="FI1BIT"/>. This field is constant.
19
public const byte MaxValue = 0x01;
22
/// Represents the smallest possible value of <see cref="FI1BIT"/>. This field is constant.
24
public const byte MinValue = 0x00;
27
/// The value of the structure.
32
/// Initializes a new instance based on the specified value.
34
/// <param name="value">The value to initialize with.</param>
35
private FI1BIT(byte value)
37
this.value = (byte)(value & MaxValue);
41
/// Converts the value of a <see cref="FI1BIT"/> structure to a <see cref="Byte"/> structure.
43
/// <param name="value">A <see cref="FI1BIT"/> structure.</param>
44
/// <returns>A new instance of <see cref="FI1BIT"/> initialized to <paramref name="value"/>.</returns>
45
public static implicit operator byte(FI1BIT value)
51
/// Converts the value of a <see cref="Byte"/> structure to a <see cref="FI1BIT"/> structure.
53
/// <param name="value">A <see cref="Byte"/> structure.</param>
54
/// <returns>A new instance of <see cref="FI1BIT"/> initialized to <paramref name="value"/>.</returns>
55
public static implicit operator FI1BIT(byte value)
57
return new FI1BIT(value);
61
/// Converts the numeric value of the <see cref="FI1BIT"/> object
62
/// to its equivalent string representation.
64
/// <returns>The string representation of the value of this instance.</returns>
65
public override string ToString()
67
return value.ToString();