|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | namespace WIDESEAWCS_Common.Helper | 
|---|
|  |  |  | { | 
|---|
|  |  |  | public class ConvertHelper | 
|---|
|  |  |  | public static class ConvertHelper | 
|---|
|  |  |  | { | 
|---|
|  |  |  | public static bool[] ByteToBoolArray(byte data) | 
|---|
|  |  |  | public static bool[] ByteToBoolArray(this byte data) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | bool[] result = new bool[8]; | 
|---|
|  |  |  | for (int i = 0; i < 8; i++) | 
|---|
|  |  |  | 
|---|
|  |  |  | return result; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static T ByteToBoolObject<T>(byte data) | 
|---|
|  |  |  | public static T ByteToBoolObject<T>(this byte data) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | bool[] boolArray = ByteToBoolArray(data); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //Array.Reverse(boolArray); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Type type = typeof(T); | 
|---|
|  |  |  | object? obj = Activator.CreateInstance(type); | 
|---|
|  |  |  | if (obj == null) | 
|---|