コード例 #1
0
        /// <summary>
        /// Creates the property instance.
        /// </summary>
        /// <param name="owner">The owner.</param>
        /// <returns>ComplexProperty instance.</returns>
        internal override ComplexProperty CreatePropertyInstance(ServiceObject owner)
        {
            TComplexProperty complexProperty = this.propertyCreationDelegate();
            IOwnedProperty   ownedProperty   = complexProperty as IOwnedProperty;

            if (ownedProperty != null)
            {
                ownedProperty.Owner = owner;
            }

            return(complexProperty);
        }
コード例 #2
0
ファイル: PropertyBag.cs プロジェクト: cortfr/ews-managed-api
        /// <summary>
        /// Initializes a ComplexProperty instance. When a property is inserted into the bag, it needs to be
        /// initialized in order for changes that occur on that property to be properly detected and dispatched.
        /// </summary>
        /// <param name="complexProperty">The ComplexProperty instance to initialize.</param>
        private void InitComplexProperty(ComplexProperty complexProperty)
        {
            if (complexProperty != null)
            {
                complexProperty.OnChange += this.PropertyChanged;

                IOwnedProperty ownedProperty = complexProperty as IOwnedProperty;

                if (ownedProperty != null)
                {
                    ownedProperty.Owner = this.Owner;
                }
            }
        }