public ModelConstants(IniFile.Section iniSection) { this.series = iniSection.Name.Substring(iniSection.Name.Length - 1); this.avbtChannelLength = iniSection.GetInt("map-AirA"); this.dvbtChannelLength = iniSection.GetInt("map-AirD"); this.dvbsChannelLength = iniSection.GetInt("map-SateD"); this.hdplusChannelLength = iniSection.GetInt("map-AstraHDPlusD"); this.cyfraPlusChannelSize = iniSection.GetInt("map-CyfraPlusD"); this.ptcLength = iniSection.GetInt("PTC"); this.dvbsSatelliteLength = iniSection.GetInt("SatDataBase.dat"); this.dvbsTransponderLength = iniSection.GetInt("TransponderDataBase.dat"); this.avbtFineTuneLength = iniSection.GetInt("FineTune"); this.dvbtFineTuneLength = iniSection.GetInt("FineTune_Digital"); this.serviceProviderLength = iniSection.GetInt("ServiceProvider", 108); int numFavorites = iniSection.GetInt("Favorites"); int mask = 0; for (int i = 0; i < numFavorites; i++) { mask = (mask << 1) | 1; } this.supportedFavorites = (Favorites)mask; this.SortedFavorites = (FavoritesIndexMode)iniSection.GetInt("SortedFavorites"); }
public void Save_tests() { var ini = new IniFile(); var section = new IniFile.Section("Test") { { "Player1", "Jeevan" }, { "Player2", "Merina" } }; ini.Add(section); ini.Add(new IniFile.Section("Jeevan") { { "Powers", "Superspeed,Super strength" }, { "Costume", "Scarlet" } }); ini.Add(new IniFile.Section("Merina") { { "Powers", "Stretchability, Invisibility" }, { "Costume", "Blue" } }); }
public FirmwareData(IniFile.Section settings) : base(settings) { }
public static SearchScenario[] ParseIniFile ( [NotNull] IniFile iniFile ) { IniFile.Section section = iniFile["SEARCH"]; if (ReferenceEquals(section, null)) { return(new SearchScenario[0]); } int count = section.GetValue("ItemNumb", 0); if (count == 0) { return(new SearchScenario[0]); } List <SearchScenario> result = new List <SearchScenario>(count); for (int i = 0; i < count; i++) { string name = section.GetValue ( "ItemName" + i, null ); if (string.IsNullOrEmpty(name)) { Log.Error ( "SearchScenario::ParseIniFile: " + "item name not set: " + i ); throw new IrbisException ( "Item name not set: " + i ); } SearchScenario scenario = new SearchScenario { Name = name, Prefix = section.GetValue ( "ItemPref" + i, string.Empty ), DictionaryType = (DictionaryType)section .GetValue ( "ItemDictionType" + i, 0 ), Advance = section.GetValue ( "ItemAdv" + i, null ), Format = section.GetValue ( "ItemPft" + i, null ), Hint = section.GetValue ( "ItemHint" + i, null ), Logic = (SearchLogicType)section .GetValue ( "ItemLogic" + i, 0 ), MenuName = section.GetValue ( "ItemMenu" + i, null ), ModByDicAuto = section.GetValue ( "ItemModByDicAuto" + i, null ), Correction = section.GetValue ( "ModByDic" + i, null ), Truncation = Convert.ToBoolean ( section.GetValue("ItemTranc" + i, 0) ) }; result.Add(scenario); } return(result.ToArray()); }