Beispiel #1
0
        public IEnumerable <Action <UpdateModel> > GetProcess(UpdateModel updateModel)
        {
            if (updateModel.UserParams.IsUndoProcess)
            {
                return(new List <Action <UpdateModel> >
                {
                    SetOffline,
                    UndoProcess,
                    SetOnline
                });
            }

            return(new List <Action <UpdateModel> >
            {
                PrepareEnviroment,
                Unzip,
                CheckVersion,
                MakeBackup,
                SetOffline,
                CopyFiles,
                VerifyCopy,
                EditWebConfig,
                SetOnline
            });
        }
 private void ExecuteProcess(IEnumerable <Action <UpdateModel> > actions, UpdateModel updateModel)
 {
     foreach (var action in actions)
     {
         action.Invoke(updateModel);
         Console.WriteLine();
     }
 }
        public void PrepareEnviroment(UpdateModel updateModel)
        {
            var process = new PrepareEnviroment();

            process.ProcessEvent += ProcessEvent;
            process.ConfirmEvent += ConfirmEvent;

            ResultEvetnt(process.Process(updateModel), null);
        }
        public void EditWebConfig(UpdateModel updateModel)
        {
            var process = new EditWebConfigProcess();

            process.ProcessEvent += ProcessEvent;
            process.ConfirmEvent += ConfirmEvent;

            ResultEvetnt(process.Process(updateModel), null);
        }
        public void Unzip(UpdateModel updateModel)
        {
            var process = new UnzipProcess();

            process.ProcessEvent += ProcessEvent;
            process.ConfirmEvent += ConfirmEvent;

            ResultEvetnt(process.Process(updateModel), null);
        }
        public void MakeBackup(UpdateModel updateModel)
        {
            var process = new BackupProcess(ConfigurationRoot);

            process.ProcessEvent += ProcessEvent;
            process.ConfirmEvent += ConfirmEvent;

            ResultEvetnt(process.Process(updateModel), null);
        }
        public void CopyFiles(UpdateModel updateModel)
        {
            var process = new CopyFilesProcess();

            process.ProcessEvent += ProcessEvent;
            process.ConfirmEvent += ConfirmEvent;

            ResultEvetnt(process.Process(updateModel), null);
        }
        public void CheckVersion(UpdateModel updateModel)
        {
            var process = new CheckVersionProcess(ConfigurationRoot, environmentManager);

            process.ProcessEvent += ProcessEvent;
            process.ConfirmEvent += ConfirmEvent;

            ResultEvetnt(process.Process(updateModel), null);
        }
Beispiel #9
0
        public void SetOffline(UpdateModel updateModel)
        {
            var process = new SetOffLineProcess();

            process.ProcessEvent += ProcessEvent;
            process.ConfirmEvent += ConfirmEvent;

            ResultEvetnt(process.Process(updateModel), null);
        }
Beispiel #10
0
        private static UpdateModel GetUpdateModel(string[] args)
        {
            if (args.Length != 6)
            {
                throw new ArgumentException("No suitable parameters");
            }

            var updateModel = new UpdateModel
            {
                UserParams = new UserParams
                {
                    Strategy         = GetParam(args, 0, "Strategy"),
                    PathToZipFile    = new FileInfo(GetParam(args, 1, "PathToZipFile")),
                    BackupDirectory  = new DirectoryInfo(GetParam(args, 2, "BackupDirectory")),
                    IntepubDirectory = new DirectoryInfo(GetParam(args, 3, "IntepubDirectory")),
                    Version          = GetParam(args, 4, "Version"),
                    IsUndoProcess    = bool.Parse(GetParam(args, 5, "IsUndoProcess"))
                }
            };

            return(updateModel);
        }
 public void Update(UpdateModel updateModel)
 {
     ExecuteProcess(UpdateProcess.GetProcess(updateModel), updateModel);
 }
 public void VerifyCopy(UpdateModel updateModel)
 {
 }
 public void CreateReport(UpdateModel updateModel)
 {
     return;
 }