protected override IEnumerable <TaskInfo> GetChildren() { yield return(TaskInfo.FromAction("loadGameClient", 1.0, progress => { progress.ReportStatusMessage(this.L("game_client_manager", "status_loading_game_client")); _client = new LocalGameClient(_path, progress); })); yield return(TaskInfo.FromAction("loadGameClientConfiguration", 9.0, progress => { progress.ReportStatusMessage(this.L("game_client_manager", "status_loading_game_client_configuration")); var repositoryConfigFile = ApplicationPath.GetRepositoryConfigFile(_client, RepositoryConfigFile); RepositoryConfiguration config; if (File.Exists(repositoryConfigFile)) { config = RepositoryConfiguration.Load(repositoryConfigFile); config.MarkerColor = _repositoryManager.MarkerManager.ApplyForColor(config.MarkerColor); } else { config = new RepositoryConfiguration(_client); config.MarkerColor = _repositoryManager.MarkerManager.ApplyForColor(); } _repositoryManager._repositoryConfigurations[_client] = config; _repositoryManager._repositories.Add(_client); })); }
public LocalGameClientPath(LocalGameClient client) { this.Client = client; this.RootPath = client.RootPath; this.ReadVersion(); this.LoadClientPaths(); _nationFolders = Directory.GetDirectories(this.VehiclesFolder).Where(LocalGameClientPath.IsNationFolder).ToArray(); _nations = _nationFolders.Select(Path.GetFileName).ToArray(); }
public static void Save(LocalGameClient client, LocalGameClientConfiguration config) { var configFile = LocalGameClientConfiguration.GetConfigFile(client); try { using (var file = File.Create(configFile)) { Serializer.WriteObject(file, config); } } catch (Exception ex) { typeof(LocalGameClientConfiguration).LogError("failed to save local game client configuration file '{0}': {1}", configFile, ex.Message); } }
public static LocalGameClientConfiguration Load(LocalGameClient client) { var configFile = LocalGameClientConfiguration.GetConfigFile(client); if (File.Exists(configFile)) { try { using (var file = File.OpenRead(configFile)) { var config = (LocalGameClientConfiguration)Serializer.ReadObject(file); return(config); } } catch (Exception ex) { typeof(LocalGameClientConfiguration).LogError("failed to load local game client configuration file '{0}': {1}", configFile, ex.Message); } } return(new LocalGameClientConfiguration()); }
internal LocalGameClientCacheManager(LocalGameClient client) { _client = client; this.IsCacheExpired = this.GetIsCacheExpired(); }
internal LocalGameClientPackageIndexer(LocalGameClient client) { _client = client; this.LoadPackageIndices(); }
private static string GetConfigFile(LocalGameClient client) { return(ApplicationPath.GetRepositoryConfigFile(client, c_configFile)); }
public LocalGameClientFileLocator(LocalGameClient client, FileSource source) { this.Client = client; this.Source = source; }