private void LoadProperties() { InitDefaults(); if (mpi_file == null) { return; } if (mpi_file.HasGroup(StorageGroup)) { if (mpi_file.HasKey(StorageGroup, "FolderDepth")) { FolderDepth = mpi_file.GetInteger(StorageGroup, "FolderDepth"); } if (mpi_file.HasKey(StorageGroup, "PlaylistPath")) { PlaylistPath = mpi_file.GetString(StorageGroup, "PlaylistPath"); } if (mpi_file.HasKey(StorageGroup, "AudioFolders")) { AudioFolders = mpi_file.GetStringList(StorageGroup, "AudioFolders"); } } if (mpi_file.HasGroup(MediaGroup)) { if (mpi_file.HasKey(MediaGroup, "InputFormats")) { InputFormats = mpi_file.GetStringList(MediaGroup, "InputFormats"); } if (mpi_file.HasKey(MediaGroup, "OutputFormats")) { OutputFormats = mpi_file.GetStringList(MediaGroup, "OutputFormats"); } } if (mpi_file.HasGroup(PlaylistGroup) && mpi_file.HasKey(PlaylistGroup, "Formats")) { PlaylistFormats = mpi_file.GetStringList(PlaylistGroup, "Formats") ?? new string [] {}; } if (mpi_file.HasGroup(DeviceGroup) && mpi_file.HasKey(DeviceGroup, "AccessProtocols")) { AccessProtocols = mpi_file.GetStringList(DeviceGroup, "AccessProtocols") ?? new string [] {}; } }
public void GetInteger() { Assert.AreEqual(256, test_keyfile.GetInteger("Group1", "Integer")); Assert.AreEqual(-1024, test_keyfile.GetInteger("Group1", "NegativeInt")); }