示例#1
0
        public ICommandResult Execute(CommandContext context)
        {
            IOperationSource source = context.GetOperationSource(stage, stashes);

            if (source.IsNullOrEmpty())
            {
                return(new TextResult("The stage is empty."));
            }

            SearchContext searchContext = new SearchContext
            {
                SearchTerm      = context.GetParameterValue(ApplyParameters.SEARCH_TERM),
                Items           = source.GetPaths(),
                SourceLobby     = source.GetLobby(),
                IsRegex         = context.HasOption(ApplyOptions.REGEX),
                IsCaseSensitive = context.HasOption(ApplyOptions.CASE_SENSITIVE)
            };

            if (string.IsNullOrEmpty(searchContext.SearchTerm))
            {
                return(new TextResult("Empty search term."));
            }

            return(Search(searchContext));
        }
示例#2
0
 public OperationInternals(
     IOperationSource <T> source,
     ClientDiagnostics clientDiagnostics,
     HttpPipeline pipeline,
     Request originalRequest,
     Response originalResponse,
     OperationFinalStateVia finalStateVia,
     string scopeName)
     : base(clientDiagnostics, pipeline, originalRequest, originalResponse, finalStateVia, scopeName)
 {
     _source = source;
 }
 public OperationOrResponseInternals(
     IOperationSource <T> source,
     ClientDiagnostics clientDiagnostics,
     HttpPipeline pipeline,
     Request originalRequest,
     Response originalResponse,
     OperationFinalStateVia finalStateVia,
     string scopeName)
     : base(new OperationInternals <T>(source, clientDiagnostics, pipeline, originalRequest, originalResponse, finalStateVia, scopeName))
 {
     _operation = Operation as OperationInternals <T>;
 }
示例#4
0
        public ICommandResult Execute(CommandContext context)
        {
            IOperationSource source = context.GetOperationSource(stage, stashes);

            if (source.IsNullOrEmpty())
            {
                return(new TextResult("The stage is empty."));
            }

            return(Delete(new DeleteContext
            {
                Items = source.GetPaths(),
                SourceLobby = source.GetLobby(),
                Preview = context.HasOption(ApplyOptions.PREVIEW)
            }));
        }
示例#5
0
        public ICommandResult Execute(CommandContext context)
        {
            IOperationSource source = context.GetOperationSource(stage, stashes);

            if (source.IsNullOrEmpty())
            {
                return(new TextResult("The stage is empty."));
            }

            return(Zip(new ZipContext
            {
                Items = source.GetPaths(),
                DestinationZipFile = context.GetTargetFile(),
                SourceLobby = source.GetLobby(),
                Flat = context.HasOption(ApplyOptions.FLATTEN) || !source.HasLobby(),
                Override = context.HasOption(ApplyOptions.OVERWRITE),
                Add = context.HasOption(ApplyOptions.ADD)
            }));
        }
示例#6
0
        public ICommandResult Execute(CommandContext context)
        {
            IOperationSource source = context.GetOperationSource(stage, stashes);

            if (source.IsNullOrEmpty())
            {
                return(new TextResult("The stage is empty."));
            }

            CopyContext copyContext = new CopyContext
            {
                Items       = source.GetPaths(),
                Destination = context.GetTargetDirectory(),
                SourceLobby = source.GetLobby(),
                Flat        = context.HasOption(ApplyOptions.FLATTEN) || !source.HasLobby(),
                Overwrite   = context.HasOption(ApplyOptions.OVERWRITE),
                Preview     = context.HasOption(ApplyOptions.PREVIEW)
            };

            return(Copy(copyContext));
        }
        public ArmOperationHelpers(
            IOperationSource <T> source,
            ClientDiagnostics clientDiagnostics,
            HttpPipeline pipeline,
            Request originalRequest,
            Response originalResponse,
            OperationFinalStateVia finalStateVia,
            string scopeName)
        {
            _source        = source;
            _rawResponse   = originalResponse;
            _requestMethod = originalRequest.Method;
            _originalUri   = originalRequest.Uri.ToString();
            _finalStateVia = finalStateVia;
            InitializeScenarioInfo();

            _pipeline          = pipeline;
            _clientDiagnostics = clientDiagnostics;
            _scopeName         = scopeName;
            // When the original response has no headers, we do not start polling immediately.
            _shouldPoll = _headerFrom != HeaderFrom.None;
        }
示例#8
0
        internal WorkloadsArmOperation(IOperationSource <T> source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia)
        {
            var nextLinkOperation = NextLinkOperationImplementation.Create(source, pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia);

            _operation = new OperationInternal <T>(clientDiagnostics, nextLinkOperation, response, "WorkloadsArmOperation", fallbackStrategy: new ExponentialDelayStrategy());
        }
 internal HybridConnectivityArmOperation(IOperationSource <T> source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia)
 {
     _operation = new OperationOrResponseInternals <T>(source, clientDiagnostics, pipeline, request, response, finalStateVia, "HybridConnectivityArmOperation");
 }
 internal DesktopVirtualizationArmOperation(IOperationSource <T> source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia)
 {
     _operation = new OperationOrResponseInternals <T>(source, clientDiagnostics, pipeline, request, response, finalStateVia, "DesktopVirtualizationArmOperation");
 }
示例#11
0
 internal static bool HasLobby(this IOperationSource source)
 {
     return(!string.IsNullOrEmpty(source.GetLobby()));
 }
示例#12
0
 internal static bool IsNullOrEmpty(this IOperationSource source)
 {
     return(source == null || source.GetPaths().Count < 1);
 }
示例#13
0
 internal ServiceLinkerArmOperation(IOperationSource <T> source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia)
 {
     _operation = new OperationOrResponseInternals <T>(source, clientDiagnostics, pipeline, request, response, finalStateVia, "ServiceLinkerArmOperation");
 }