Ejemplo n.º 1
0
 private LocalDatabaseConfig GetLocalDatabaseConfig()
 {
     if (Exists)
     {
         return(LocalDatabaseConfig.Load(localDatabaseConfigFile));
     }
     return(null);
 }
Ejemplo n.º 2
0
        private void InitDatabase(string wotGameDirectory, string wotVersion)
        {
            var localDatabaseConfig = new LocalDatabaseConfig
            {
                WoTHome    = wotGameDirectory,
                WoTVersion = wotVersion,
                Packages   = new List <LocalDatabasePackageInfo>()
            };

            localDatabaseConfig.Save(localDatabaseConfigFile);
            packageCache = new LocalRepository(localDatabasePath);
        }
Ejemplo n.º 3
0
 private static XDocument CreateXDocument(LocalDatabaseConfig config)
 {
     if (config.Packages == null)
     {
         config.Packages = new List <LocalDatabasePackageInfo>();
     }
     return(new XDocument(
                new XDeclaration("1.0", "utf-8", string.Empty),
                new XElement("databaseConfig",
                             new XElement("wotHome", config.WoTHome),
                             new XElement("wotVersion", config.WoTVersion),
                             new XElement("packages", config.Packages.Select(p => new XElement("package", new XAttribute("name", p.Name), new XAttribute("version", p.Version)))
                                          ))
                ));
 }