示例#1
0
        private static void LoadStringSettings()
        {
            using (Settings xmlReader = new SKSettings())
            {
                IDictionary <string, string> allStringSettings = xmlReader.GetSection <string>("stringsettings");

                if (allStringSettings == null)
                {
                    return;
                }

                lock (_skinStringSettings)
                {
                    var enumerator = allStringSettings.GetEnumerator();
                    if (enumerator != null)
                    {
                        while (enumerator.MoveNext())
                        {
                            // Create the new string setting.
                            SkinString newString = new SkinString();
                            newString.Name  = enumerator.Current.Key;
                            newString.Value = enumerator.Current.Value;
                            newString.Kind  = Kind.PERSISTENT;

                            // Add the setting to the dictionary.
                            int key = _skinStringSettings.Count;
                            _skinStringSettings[key] = newString;

                            // Create the setting as a property.
                            GUIPropertyManager.SetProperty(newString.Name, newString.Value);
                        }
                    }
                }
            }
        }
示例#2
0
        private static void LoadBooleanSettings()
        {
            using (Settings xmlReader = new SKSettings())
            {
                IDictionary <string, bool> allBooleanSettings = xmlReader.GetSection <bool>("booleansettings");

                if (allBooleanSettings == null)
                {
                    return;
                }

                lock (_skinBoolSettings)
                {
                    var enumerator = allBooleanSettings.GetEnumerator();
                    if (enumerator != null)
                    {
                        while (enumerator.MoveNext())
                        {
                            // Create the new boolean setting.
                            SkinBool newBool = new SkinBool();
                            newBool.Name  = enumerator.Current.Key;
                            newBool.Value = enumerator.Current.Value;
                            newBool.Kind  = Kind.PERSISTENT;

                            // Add the setting to the dictionary.
                            int key = _skinBoolSettings.Count;
                            _skinBoolSettings[key] = newBool;

                            // Create the setting as a property.  The boolean value is converted as a string representation.
                            GUIPropertyManager.SetProperty(newBool.Name, newBool.Value.ToString());
                        }
                    }
                }
            }
        }
示例#3
0
    private static void LoadStringSettings()
    {
      using (Settings xmlReader = new SKSettings())
      {
        IDictionary<string, string> allStringSettings = xmlReader.GetSection<string>("stringsettings");

        if (allStringSettings == null)
        {
          return;
        }

        lock (_skinStringSettings)
        {
          var enumerator = allStringSettings.GetEnumerator();
          if (enumerator != null)
          {
            while (enumerator.MoveNext())
            {
              // Create the new string setting.
              SkinString newString = new SkinString();
              newString.Name = enumerator.Current.Key;
              newString.Value = enumerator.Current.Value;
              newString.Kind = Kind.PERSISTENT;

              // Add the setting to the dictionary.
              int key = _skinStringSettings.Count;
              _skinStringSettings[key] = newString;

              // Create the setting as a property.
              GUIPropertyManager.SetProperty(newString.Name, newString.Value);
            }
          }
        }
      }
    }
示例#4
0
    private static void LoadBooleanSettings()
    {
      using (Settings xmlReader = new SKSettings())
      {
        IDictionary<string, bool> allBooleanSettings = xmlReader.GetSection<bool>("booleansettings");

        if (allBooleanSettings == null)
        {
          return;
        }

        lock (_skinBoolSettings)
        {
          var enumerator = allBooleanSettings.GetEnumerator();
          if (enumerator != null)
          {
            while (enumerator.MoveNext())
            {
              // Create the new boolean setting.
              SkinBool newBool = new SkinBool();
              newBool.Name = enumerator.Current.Key;
              newBool.Value = enumerator.Current.Value;
              newBool.Kind = Kind.PERSISTENT;

              // Add the setting to the dictionary.
              int key = _skinBoolSettings.Count;
              _skinBoolSettings[key] = newBool;

              // Create the setting as a property.  The boolean value is converted as a string representation.
              GUIPropertyManager.SetProperty(newBool.Name, newBool.Value.ToString());
            }
          }
        }
      }
    }