示例#1
0
        /// <summary>
        /// Resets all references - such as binding references and property modifiers.
        /// </summary>
        internal void Dispose()
        {
            this.lockComposeCount++;
            this.lockValueUpdateCount++;
            //remove binding references
            this.owner.RemoveBinding(this);

            if (this.boundObjects != null)
            {
                int count = this.boundObjects.Count;
                for (int i = count - 1; i >= 0; i--)
                {
                    PropertyBoundObject reference   = this.boundObjects[i];
                    RadObject           boundObject = reference.Object;
                    if (boundObject != null &&
                        !(boundObject.IsDisposed || boundObject.IsDisposing))
                    {
                        boundObject.UnbindProperty(reference.Property);
                    }
                }
                this.boundObjects.Clear();
            }

            //reset references
            this.property         = null;
            this.metadata         = null;
            this.owner            = null;
            this.propertyBinding  = null;
            this.animationSetting = null;
            this.styleSetting     = null;
        }
示例#2
0
 internal void Dispose()
 {
     ++this.lockComposeCount;
     ++this.lockValueUpdateCount;
     if (this.owner != null)
     {
         this.owner.RemoveBinding(this);
     }
     if (this.boundObjects != null)
     {
         for (int index = this.boundObjects.Count - 1; index >= 0; --index)
         {
             PropertyBoundObject boundObject = this.boundObjects[index];
             RadObject           radObject   = boundObject.Object;
             if (radObject != null && !radObject.IsDisposed && !radObject.IsDisposing)
             {
                 int num = (int)radObject.UnbindProperty(boundObject.Property);
             }
         }
         this.boundObjects.Clear();
     }
     this.property         = (RadProperty)null;
     this.metadata         = (RadPropertyMetadata)null;
     this.owner            = (RadObject)null;
     this.propertyBinding  = (PropertyBinding)null;
     this.animationSetting = (AnimatedPropertySetting)null;
     this.styleSetting     = (IPropertySetting)null;
 }