Ejemplo n.º 1
0
        public override void Run(List <Variable> variableList)
        {
            var fileMaker = new NgFileMaker();

            Console.Write($@"Activating {ListFileCopy.Count} File ... ");
            foreach (var file in ListFileCopy)
            {
                var FileInfoSource      = file.FileInfoSource;
                var FileInfoDestination = file.FileInfoDestination;

                foreach (var variable in variableList)
                {
                    FileInfoSource      = FileInfoSource.Replace("@(" + variable.Name + ")", variable.Value);
                    FileInfoDestination = FileInfoDestination.Replace("@(" + variable.Name + ")", variable.Value);
                }

                var fsource = Environment.ExpandEnvironmentVariables(FileInfoSource);
                var fdest   = Environment.ExpandEnvironmentVariables(FileInfoDestination);

                var from = new FileInfo(fsource);
                var to   = new FileInfo(fdest);

                fileMaker.CopyFile(from, to);
            }
            Console.WriteLine("Done");
        }
Ejemplo n.º 2
0
        public override void Run(List <Variable> variablesList)
        {
            foreach (var variable in variablesList)
            {
                FileInfoSource      = FileInfoSource.Replace("@(" + variable.Name + ")", variable.Value);
                FileInfoDestination = FileInfoDestination.Replace("@(" + variable.Name + ")", variable.Value);
            }

            Console.Write($"Activating File {new FileInfo(FileInfoSource).Name} ... ");

            var fileMaker = new NgFileMaker();
            var fsource   = Environment.ExpandEnvironmentVariables(FileInfoSource);
            var fdest     = Environment.ExpandEnvironmentVariables(FileInfoDestination);

            var from = new System.IO.FileInfo(fsource);
            var to   = new System.IO.FileInfo(fdest);

            fileMaker.CopyFile(from, to);
            Console.WriteLine($"Done");
        }