/// <summary>
        /// Creates a new <see cref="IOneGetContext"/> interceptor.
        /// </summary>
        /// <param name="request">The OneGet request interface to pass to the constructor of the target <see cref="IOneGetContext"/> implementation.</param>
        public OneGetContextInterceptor([NotNull] Request request)
        {
            #region Sanity checks
            if (request == null) throw new ArgumentNullException(nameof(request));
            #endregion

            _request = request;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates a new OneGet command.
 /// </summary>
 /// <param name="request">The OneGet request callback object.</param>
 /// <param name="machineWide">Apply operations machine-wide instead of just for the current user.</param>
 public OneGetCommand([NotNull] Request request, bool machineWide = false)
     : base(new OneGetHandler(request))
 {
     _request = request;
     _machineWide = machineWide;
 }
 /// <inheritdoc/>
 protected override IOneGetContext BuildContext(Request request) =>
     new ProxyFactory().CreateProxy<IOneGetContext>(new OneGetContextInterceptor(request));
 public RequestInterceptor([NotNull] Request request)
 {
     _request = request;
 }
Ejemplo n.º 5
0
 /// <inheritdoc/>
 protected override IOneGetContext BuildContext(Request request) => new OneGetContext(request);
Ejemplo n.º 6
0
 public RequestLogger(Request request)
 {
     _request = request;
 }
Ejemplo n.º 7
0
 public OneGetHandler(Request request)
 {
     _request = request;
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Creates a new OneGet command.
 /// </summary>
 /// <param name="request">The OneGet request callback object.</param>
 public OneGetContext([NotNull] Request request)
     : base(new OneGetHandler(request))
 {
     _request = request;
 }
Ejemplo n.º 9
0
 protected override OneGetCommand BuildCommand(Request request)
 {
     return new OneGetCommand(request);
 }
 protected override OneGetCommand BuildCommand(Request request)
 {
     if (!WindowsUtils.IsAdministrator) throw new NotAdminException(Resources.MustBeAdminForMachineWide);
     return new OneGetCommand(request, machineWide: true);
 }
        public override void GetFeatures(Request request)
        {
            base.GetFeatures(request);

            if (IsDisabled) request.Yield(new KeyValuePair<string, string[]>(Constants.Features.AutomationOnly, Constants.FeaturePresent));
        }