Пример #1
0
        public Message Process(Message request)
        {
            var content = request.CacheFileRequest.Content;
            var file    = request.CacheFileRequest.FilePath;
            var status  = request.CacheFileRequest.Status;

            switch (status)
            {
            case FileStatus.Changed:
            case FileStatus.Opened:
                _loader.ReloadSteps(content, file);
                break;

            case FileStatus.Created:
            case FileStatus.Closed:
                LoadFromDisk(file);
                break;

            case FileStatus.Deleted:
                _loader.RemoveSteps(file);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            return(new Message());
        }
Пример #2
0
        public Empty Process(CacheFileRequest request)
        {
            var content = request.Content;
            var file    = request.FilePath;
            var status  = request.Status;

            switch (status)
            {
            case FileStatus.Changed:
            case FileStatus.Opened:
                _loader.ReloadSteps(content, file);
                break;

            case FileStatus.Created:
                if (!_loader.GetStepRegistry().IsFileCached(file))
                {
                    LoadFromDisk(file);
                }
                break;

            case FileStatus.Closed:
                LoadFromDisk(file);
                break;

            case FileStatus.Deleted:
                _loader.RemoveSteps(file);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            return(new Empty());
        }