#region Copyright (c) 2011-2023 Technosoftware GmbH. All rights reserved //----------------------------------------------------------------------------- // Copyright (c) 2011-2023 Technosoftware GmbH. All rights reserved // Web: https://www.technosoftware.com // // The source code in this file is covered under a dual-license scenario: // - Owner of a purchased license: SCLA 1.0 // - GPL V3: everybody else // // SCLA license terms accompanied with this source code. // See SCLA 1.0: https://technosoftware.com/license/Source_Code_License_Agreement.pdf // // GNU General Public License as published by the Free Software Foundation; // version 3 of the License are accompanied with this source code. // See https://technosoftware.com/license/GPLv3License.txt // // This source code is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY // or FITNESS FOR A PARTICULAR PURPOSE. //----------------------------------------------------------------------------- #endregion Copyright (c) 2011-2023 Technosoftware GmbH. All rights reserved #region Using Directives using System; using System.Collections; using System.Reflection; #endregion namespace Technosoftware.DaAeHdaClient { /// /// Defines constants for standard data types. /// public class OpcType { /// public static Type SBYTE = typeof(sbyte); /// public static Type BYTE = typeof(byte); /// public static Type SHORT = typeof(short); /// public static Type USHORT = typeof(ushort); /// public static Type INT = typeof(int); /// public static Type UINT = typeof(uint); /// public static Type LONG = typeof(long); /// public static Type ULONG = typeof(ulong); /// public static Type FLOAT = typeof(float); /// public static Type DOUBLE = typeof(double); /// public static Type DECIMAL = typeof(decimal); /// public static Type BOOLEAN = typeof(bool); /// public static Type DATETIME = typeof(DateTime); /// public static Type DURATION = typeof(TimeSpan); /// public static Type STRING = typeof(string); /// public static Type ANY_TYPE = typeof(object); /// public static Type BINARY = typeof(byte[]); /// public static Type ARRAY_SHORT = typeof(short[]); /// public static Type ARRAY_USHORT = typeof(ushort[]); /// public static Type ARRAY_INT = typeof(int[]); /// public static Type ARRAY_UINT = typeof(uint[]); /// public static Type ARRAY_LONG = typeof(long[]); /// public static Type ARRAY_ULONG = typeof(ulong[]); /// public static Type ARRAY_FLOAT = typeof(float[]); /// public static Type ARRAY_DOUBLE = typeof(double[]); /// public static Type ARRAY_DECIMAL = typeof(decimal[]); /// public static Type ARRAY_BOOLEAN = typeof(bool[]); /// public static Type ARRAY_DATETIME = typeof(DateTime[]); /// public static Type ARRAY_STRING = typeof(string[]); /// public static Type ARRAY_ANY_TYPE = typeof(object[]); /// public static Type ILLEGAL_TYPE = typeof(OpcType); /// /// Returns an array of all well-known types. /// public static Type[] Enumerate() { var values = new ArrayList(); var fields = typeof(OpcType).GetFields(BindingFlags.Static | BindingFlags.Public); Array.ForEach(fields, field => values.Add(field.GetValue(typeof(Type)))); return (Type[])values.ToArray(typeof(Type)); } } }