ExportAssets() public method

public ExportAssets ( ) : void
return void
Ejemplo n.º 1
0
        public override void Perform(Resource obj)
        {
            // If we still have the original source files around, prefer them.
            string[] importedPaths = AssetManager.GetAssetSourceFiles(obj);
            if (importedPaths.Length > 0 && importedPaths.All(p => File.Exists(p)))
            {
                this.OpenPaths(importedPaths);
                return;
            }

            // Otherwise, export the Resource and open the result.
            string[] exportedPaths = AssetManager.ExportAssets(obj);
            this.OpenPaths(exportedPaths);
        }
Ejemplo n.º 2
0
        public override void Perform(Resource obj)
        {
            string[] exportedPaths = AssetManager.ExportAssets(obj);

            // If there is only a single source path, open the file right away
            if (exportedPaths.Length == 1)
            {
                System.Diagnostics.Process.Start(exportedPaths[0]);
            }
            // If there are multiple source paths, just open the base directory
            else
            {
                string mutualBaseDir = PathHelper.GetMutualBaseDirectory(exportedPaths);
                System.Diagnostics.Process.Start(mutualBaseDir);
            }
        }
        /// <summary>
        /// Performs an export operation for the current <see cref="Resource"/> selection.
        /// </summary>
        private void ExportResource()
        {
            Resource[] resources = this.GetValue().OfType <Resource>().ToArray();

            // Check again which actions are available, in case this has changed in the mean time.
            CheckAvailableActions(resources);
            if (!this.CanExportResource)
            {
                return;
            }

            // Perform the export operation
            foreach (Resource res in resources)
            {
                AssetManager.ExportAssets(res);
            }
        }