Exemplo n.º 1
0
        internal override void DetachDataItem()
        {
            PW.DetachFromRootItem();
            if (XmlWorker != null)
            {
                XmlWorker.DetachDataItem();
            }

            // cancel any pending async requests.  If it has already completed,
            // but is now waiting in the dispatcher queue, it will be ignored because
            // we set _pending*Request to null.
            AsyncGetValueRequest pendingGetValueRequest = (AsyncGetValueRequest)GetValue(Feature.PendingGetValueRequest, null);

            if (pendingGetValueRequest != null)
            {
                pendingGetValueRequest.Cancel();
                ClearValue(Feature.PendingGetValueRequest);
            }

            AsyncSetValueRequest pendingSetValueRequest = (AsyncSetValueRequest)GetValue(Feature.PendingSetValueRequest, null);

            if (pendingSetValueRequest != null)
            {
                pendingSetValueRequest.Cancel();
                ClearValue(Feature.PendingSetValueRequest);
            }
        }
Exemplo n.º 2
0
        // Token: 0x06007492 RID: 29842 RVA: 0x00215B9C File Offset: 0x00213D9C
        private void RequestAsyncSetValue(object item, object value)
        {
            string nameFromInfo = this.GetNameFromInfo(this.PW.GetAccessor(this.PW.Length - 1));

            Invariant.Assert(nameFromInfo != null, "Async SetValue expects a name");
            AsyncSetValueRequest asyncSetValueRequest = (AsyncSetValueRequest)base.GetValue(BindingWorker.Feature.PendingSetValueRequest, null);

            if (asyncSetValueRequest != null)
            {
                asyncSetValueRequest.Cancel();
            }
            asyncSetValueRequest = new AsyncSetValueRequest(item, nameFromInfo, value, base.ParentBinding.AsyncState, ClrBindingWorker.DoSetValueCallback, ClrBindingWorker.CompleteSetValueCallback, new object[]
            {
                this
            });
            base.SetValue(BindingWorker.Feature.PendingSetValueRequest, asyncSetValueRequest);
            base.Engine.AddAsyncRequest(base.TargetElement, asyncSetValueRequest);
        }
Exemplo n.º 3
0
        // Token: 0x0600746F RID: 29807 RVA: 0x002152B4 File Offset: 0x002134B4
        internal override void DetachDataItem()
        {
            this.PW.DetachFromRootItem();
            if (this.XmlWorker != null)
            {
                this.XmlWorker.DetachDataItem();
            }
            AsyncGetValueRequest asyncGetValueRequest = (AsyncGetValueRequest)base.GetValue(BindingWorker.Feature.PendingGetValueRequest, null);

            if (asyncGetValueRequest != null)
            {
                asyncGetValueRequest.Cancel();
                base.ClearValue(BindingWorker.Feature.PendingGetValueRequest);
            }
            AsyncSetValueRequest asyncSetValueRequest = (AsyncSetValueRequest)base.GetValue(BindingWorker.Feature.PendingSetValueRequest, null);

            if (asyncSetValueRequest != null)
            {
                asyncSetValueRequest.Cancel();
                base.ClearValue(BindingWorker.Feature.PendingSetValueRequest);
            }
        }
Exemplo n.º 4
0
        void RequestAsyncSetValue(object item, object value)
        {
            // get information about the property whose value we want
            string name = GetNameFromInfo(PW.GetAccessor(PW.Length - 1));

            Invariant.Assert(name != null, "Async SetValue expects a name");

            // abandon any previous request
            AsyncSetValueRequest pendingSetValueRequest = (AsyncSetValueRequest)GetValue(Feature.PendingSetValueRequest, null);

            if (pendingSetValueRequest != null)
            {
                pendingSetValueRequest.Cancel();
            }

            // issue the new request
            pendingSetValueRequest =
                new AsyncSetValueRequest(item, name, value, ParentBinding.AsyncState,
                                         DoSetValueCallback, CompleteSetValueCallback,
                                         this);
            SetValue(Feature.PendingSetValueRequest, pendingSetValueRequest);
            Engine.AddAsyncRequest(TargetElement, pendingSetValueRequest);
        }