Beispiel #1
0
        private void LoadWorkflows()
        {
            try
            {
                if (!Directory.Exists(WorkflowsRootFolder))
                {
                    Directory.CreateDirectory(WorkflowsRootFolder);
                }
                this.WorkflowsList = new List <WorkflowInfo>()
                {
                    new WorkflowInfo()
                };
                string[] Dir = Directory.GetFiles(WorkflowsRootFolder);
                foreach (var file in Dir)
                {
                    var workflowInfo = SerialtionHelper <WorkflowInfo> .Deserialize(file);

                    WorkflowsList.Add(workflowInfo);
                }
            }
            catch (Exception ex)
            {
                new Logger().WriteError($"Faild to load WorkFlows{ex.Message}");
                throw new Exception($"Faild to load WorkFlows{ex.Message}");
            }
        }
Beispiel #2
0
        internal void Restore()
        {
            try
            {
                string[]    FilesName = Directory.GetFiles(this._backUpFolderPath);
                BackupSteps steps     = SerialtionHelper <BackupSteps> .Deserialize(_xmlRestoreSteps);

                for (int i = 0; i < steps.FilePath.Count; i++)
                {
                    File.Copy(Path.Combine(this._backUpFolderPath, steps.FileName[i]), steps.FilePath[i], true);
                }
                new Logger().WriteInfo("Restore files seccessfully.");
            }
            catch (Exception ex)
            {
                new Logger().WriteError($"faild to restore:{ex.Message}");
                throw new Exception($"faild to restore:{ex.Message}");
            }
        }