LanguageData.cs 906 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using System;
  2. namespace I2.Loc
  3. {
  4. [Serializable]
  5. public class LanguageData
  6. {
  7. public bool IsEnabled()
  8. {
  9. return (this.Flags & 1) == 0;
  10. }
  11. public void SetEnabled(bool bEnabled)
  12. {
  13. if (bEnabled)
  14. {
  15. this.Flags = (byte)((int)this.Flags & -2);
  16. }
  17. else
  18. {
  19. this.Flags |= 1;
  20. }
  21. }
  22. public bool IsLoaded()
  23. {
  24. return (this.Flags & 4) == 0;
  25. }
  26. public bool CanBeUnloaded()
  27. {
  28. return (this.Flags & 2) == 0;
  29. }
  30. public void SetLoaded(bool loaded)
  31. {
  32. if (loaded)
  33. {
  34. this.Flags = (byte)((int)this.Flags & -5);
  35. }
  36. else
  37. {
  38. this.Flags |= 4;
  39. }
  40. }
  41. public void SetCanBeUnLoaded(bool allowUnloading)
  42. {
  43. if (allowUnloading)
  44. {
  45. this.Flags = (byte)((int)this.Flags & -3);
  46. }
  47. else
  48. {
  49. this.Flags |= 2;
  50. }
  51. }
  52. public string Name;
  53. public string Code;
  54. public byte Flags;
  55. [NonSerialized]
  56. public bool Compressed;
  57. }
  58. }