Example #1
0
        public void Execute(int timeout, ILog log)
        {
            log.Write("Executing Template Instance '{0}'", this.SavedObjectName);

            string path = FileTools.ResolvePath(this.TemplatePath);

            ZeusTemplate template = new ZeusTemplate(path);

            ZeusInput zin = new ZeusInput();

            zin.AddItems(this.InputItems);

            this.ApplyOverrideData(zin);

            ZeusContext context = new ZeusContext(zin, /*new GuiController(),*/ new Hashtable());

            context.Log = log;

            template.Execute(context, timeout, true);

            foreach (string file in context.Output.SavedFiles)
            {
                if (!SavedFiles.Contains(file))
                {
                    SavedFiles.Add(file);
                }
            }
        }
Example #2
0
        /// <summary>
        /// Get all the saved files.
        /// </summary>
        /// <returns></returns>
        private static async Task <SavedFiles> GetFilesAsync()
        {
            SavedFiles allFiles = new SavedFiles
            {
                //Ignore files beginning with underscores. This allows us to use those as config (etc) files.
                LocalFiles   = (await _localFolder.GetFilesAsync()).Where(x => x.Name[0] != '_'),
                RoamingFiles = (await _roamingFolder.GetFilesAsync()).Where(x => x.Name[0] != '_')
            };

            return(allFiles);
        }
Example #3
0
    public Vector2 lastCheckPoint;      //Es la posición donde se guardó el juego por ultima vez

    void Awake()
    {
        if (instance == null)            //Si no existe una instancia...
        {
            instance = this;             //Instancia se vuelve "this", es decir, el objeto al que está asignado el código
            DontDestroyOnLoad(instance); //No se destruirá el objeto al cargar el juego o una escena
        }
        else //Si existe una instancia
        {
            Destroy(gameObject); //Se destruye el objeto
        }
    }
        private async void SaveAsync(object sender, ExecutedRoutedEventArgs e)
        {
            var p = (PackageSearchMetadataBuilder.ClonedPackageSearchMetadata)e.Parameter;

            var packageId = p.Identity.Id;

            var packageVersion = p.Identity.Version;
            var dlls           = await NugetUtils.SaveAsync(packageId, packageVersion);

            foreach (var dll in dlls)
            {
                var destFile = Path.Combine(AnalyzersDir, Path.GetFileName(dll));
                File.Copy(dll, destFile);
                SavedFiles.Add(destFile);
            }
            Window.GetWindow(this)?.Close();
        }
Example #5
0
        /// <summary>
        /// Projects the UpdateFileInfo into a <see cref="FileCacheEntry"/>
        /// </summary>
        /// <param name="file">The <see cref="UpdateFileInfo"/> received from remote</param>
        /// <param name="fileName">Filename stored on local FS</param>
        /// <returns>true when added</returns>
        public bool AddFile(UpdateFileInfo file, string fileName)
        {
            if (SavedFiles == null)
            {
                SavedFiles = new List <FileCacheEntry>();
            }


            SavedFiles.Add(new FileCacheEntry()
            {
                FileName = fileName,
                Name     = file.Name,
                Revision = file.Revision
            });

            return(true);
        }
 public Task Save(StoredFile file)
 {
     SavedFiles.Add(file);
     return(Task.CompletedTask);
 }
Example #7
0
 void Start()
 {
     Save = GameObject.FindGameObjectWithTag("Save").GetComponent <SavedFiles>();
 }
Example #8
0
    private SavedFiles Save; //Usamos la clase SavedFiles

    void Start()
    {
        Save = GameObject.FindGameObjectWithTag("Save").GetComponent <SavedFiles>(); //El objeto con el tag correspondiente se guardará como el atributo Save...
        transform.position = Save.lastCheckPoint;                                    //Y se guardará su ultima checkpoint
    }
Example #9
0
 /// <summary>
 /// Has this file been downloaded already
 /// </summary>
 /// <param name="file">The file to check against</param>
 /// <returns>true if downloaded already</returns>
 public bool HasFile(UpdateFileInfo file)
 {
     return(SavedFiles.Any(f => f.Name == file.Name && f.Revision == file.Revision));
 }