Ejemplo n.º 1
0
        public bool LoadSettings()
        {
            if (Display.Storage == null)
            {
                return(false);
            }

            string rawData;
            bool   loadedSomething = false;

            if (Display.Storage.TryGetValue(Session.Instance.DisplaySettingsGuid, out rawData))
            {
                DisplaySettingsValues loadedSettings = null;
                var base64 = Convert.FromBase64String(rawData);
                loadedSettings = MyAPIGateway.Utilities.SerializeFromBinary <DisplaySettingsValues>(base64);

                if (loadedSettings != null)
                {
                    Settings        = loadedSettings;
                    loadedSomething = true;
                }

                if (Session.Enforced.Debug == 3)
                {
                    Log.Line($"Loaded - DisplayId [{Display.EntityId}]:\n{Settings.ToString()}");
                }
            }

            return(loadedSomething);
        }
Ejemplo n.º 2
0
 internal void UpdateSettings(DisplaySettingsValues newSettings)
 {
     if (newSettings.MId > Set.Settings.MId)
     {
         SettingsUpdated = true;
         Set.Settings    = newSettings;
         if (Session.Enforced.Debug == 3)
         {
             Log.Line("UpdateSettings for display");
         }
     }
 }
 public DataDisplaySettings(long entityId, DisplaySettingsValues settings) : base(entityId)
 {
     Settings = settings;
 }