Esempio n. 1
0
        public CancellableRequest(CancellableRequestsFeature feature, IRequest req, string tag)
        {
            this.TokenSource = new CancellationTokenSource();
            this.Token       = this.TokenSource.Token;
            this.feature     = feature;
            this.requestTag  = tag;
            this.stopwatch   = Stopwatch.StartNew();

            this.feature.UnregisterCancellableRequest(this.requestTag);

            req.Items[typeof(CancellableRequest).Name] = feature.RequestsMap[tag] = this;
        }
        public CancellableRequest(CancellableRequestsFeature feature, IRequest req, string tag)
        {
            this.TokenSource = new CancellationTokenSource();
            this.Token = this.TokenSource.Token;
            this.feature = feature;
            this.requestTag = tag;
            this.stopwatch = Stopwatch.StartNew();

            this.feature.UnregisterCancellableRequest(this.requestTag);

            req.Items[typeof(CancellableRequest).Name] = feature.RequestsMap[tag] = this;
        }