/// <summary> /// Get the byte size of the structure. /// </summary> /// <param name="profileHeader">Structure whose byte size you want to get.</param> /// <returns>Byte size</returns> public static int GetByteSize(TypeOfStruct type) { switch (type) { case TypeOfStruct.PROFILE_HEADER: LJV7IF_PROFILE_HEADER profileHeader = new LJV7IF_PROFILE_HEADER(); return(Marshal.SizeOf(profileHeader)); case TypeOfStruct.PROFILE_FOOTER: LJV7IF_PROFILE_FOOTER profileFooter = new LJV7IF_PROFILE_FOOTER(); return(Marshal.SizeOf(profileFooter)); case TypeOfStruct.MEASURE_DATA: LJV7IF_MEASURE_DATA measureData = new LJV7IF_MEASURE_DATA(); return(Marshal.SizeOf(measureData)); } return(0); }
/// <summary> /// Get the byte size of the structure. /// </summary> /// <param name="profileHeader">Structure whose byte size you want to get.</param> /// <returns>Byte size</returns> public static int GetByteSize(TypeOfStruct type) { switch (type) { case TypeOfStruct.PROFILE_HEADER: LJV7IF_PROFILE_HEADER profileHeader = new LJV7IF_PROFILE_HEADER(); return Marshal.SizeOf(profileHeader); case TypeOfStruct.PROFILE_FOOTER: LJV7IF_PROFILE_FOOTER profileFooter = new LJV7IF_PROFILE_FOOTER(); return Marshal.SizeOf(profileFooter); case TypeOfStruct.MEASURE_DATA: LJV7IF_MEASURE_DATA measureData = new LJV7IF_MEASURE_DATA(); return Marshal.SizeOf(measureData); } return 0; }