/// <summary>
        /// Serzs to document.
        /// </summary>
        /// <param name="InputFilePath">The input file path.</param>
        /// <returns>XDocument.</returns>
        public static XDocument SerzToDoc(string InputFilePath)
        {
            string TempFile = $"{Path.GetTempFileName()}.xml";

            SerzToFile(InputFilePath, TempFile);
            var output = FileToDoc(TempFile);

            FilesAndDirectories.DeleteSingleFile(TempFile);
            return(output);
        }
Exemple #2
0
        public static void CopyAssets(List <ProviderProductModel> providerProductList, Boolean toGame, string gameAssetsFolder, string archiveAssetsFolder)
        {
            try
            {
                foreach (var providerProduct in providerProductList)
                {
                    string gameProviderProductFolder =
                        $"{gameAssetsFolder}{providerProduct.Provider}\\{providerProduct.Product}";
                    string archiveProviderProductFolder =
                        $"{archiveAssetsFolder}{providerProduct.Provider}\\{providerProduct.Product}";
                    string DestinationDirectory;
                    string SourceDirectory;

                    if (toGame)
                    {
                        SourceDirectory        = archiveProviderProductFolder;
                        DestinationDirectory   = gameProviderProductFolder;
                        providerProduct.InGame = true;
                    }
                    else
                    {
                        SourceDirectory           = gameProviderProductFolder;
                        DestinationDirectory      = archiveProviderProductFolder;
                        providerProduct.InArchive = true;
                    }
                    // This is a copy function that updates all files and makes sure both folder structures are identical after performing the copy operation.
                    FilesAndDirectories.CopyDir(SourceDirectory, DestinationDirectory, toGame);
                }
            }
            catch (Exception E)
            {
                Log.Trace("Failed to move assets ", E, LogEventType.Error);
            }
            // If it all works, update the status for the InGame field
            UpdateBulkStatus(providerProductList, "InGame");
            // UpdateArchiveLocationsInList(ProviderProduct, ToGame); // List update we will not do this, but leave it to the UI to get the update from the database.
        }