ANT_VersionInfo.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. This software is subject to the license described in the License.txt file
  3. included with this software distribution. You may not use this file except in compliance
  4. with this license.
  5. Copyright (c) Dynastream Innovations Inc. 2013
  6. All rights reserved.
  7. */
  8. using System;
  9. using System.Collections.Generic;
  10. using System.Linq;
  11. using System.Text;
  12. using System.Reflection;
  13. using System.Runtime.InteropServices;
  14. namespace ANT_Managed_Library
  15. {
  16. /// <summary>
  17. /// The information for this version of the ANT Managed Library
  18. /// </summary>
  19. public static class ANT_VersionInfo
  20. {
  21. private static string applicationCode = "AMO";
  22. private static string versionSuffix = "";
  23. /// <summary>
  24. /// This string shows the date the library received its current version number
  25. /// </summary>
  26. public static string versionNumberLastChangedOn = "May 28 2013";
  27. /// <summary>
  28. /// Returns the version information as a string
  29. /// </summary>
  30. /// <returns>Managed Library Version String</returns>
  31. public static string getManagedLibraryVersion()
  32. {
  33. return applicationCode + Assembly.GetExecutingAssembly().GetName().Version.ToString(4) + versionSuffix;
  34. }
  35. [DllImport(ANT_Common.ANT_UNMANAGED_WRAPPER, CallingConvention=CallingConvention.Cdecl)]
  36. private static extern IntPtr getUnmanagedVersion();
  37. /// <summary>
  38. /// Gets the version string of the underlying unmanaged wrapper library, ANT_WrappedLib.dll
  39. /// </summary>
  40. /// <returns>Unmanaged Wrapper Version String</returns>
  41. public static string getUnmanagedLibraryVersion()
  42. {
  43. IntPtr pVerStr = getUnmanagedVersion();
  44. return Marshal.PtrToStringAnsi(pVerStr);
  45. }
  46. }
  47. }