ServerModeInfo.cs 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. using System.IO;
  3. using Vinno.vCloud.Protocol.Infrastructures;
  4. namespace vCloud.Server
  5. {
  6. public static class ServerModeInfo
  7. {
  8. public static ServerMode ServerMode {get;set;}
  9. public static bool IsPersonalFlyinsonoServer => ServerMode== ServerMode.PersonalFlyinsonoServer;
  10. public static bool IsCloudFlyinsonoServer=> ServerMode == ServerMode.FlyinsonoServer;
  11. public static bool HasAgentManagement { get; set; }
  12. public static string StorageAddress { get; set; }
  13. public static StorageType StorageType { get; internal set; }
  14. public static void WriteLicenseInfo(string licenseInfo) {
  15. if (IsPersonalFlyinsonoServer)
  16. {
  17. var licenseInfoFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"LicenseStatus.txt");
  18. File.WriteAllText(licenseInfoFilePath, licenseInfo);
  19. }
  20. }
  21. }
  22. public enum ServerMode {
  23. FlyinsonoServer,
  24. PersonalFlyinsonoServer
  25. }
  26. }