EntityCollectionChangedParams.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataWeb / Client / System / Data / Services / Client / Binding / EntityCollectionChangedParams.cs / 1305376 / EntityCollectionChangedParams.cs

                            //---------------------------------------------------------------------- 
// 
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// 
//  
//   EntityCollectionChangedParams class
//  
// 
//---------------------------------------------------------------------
 
namespace System.Data.Services.Client
{
#region Namespaces
    using System.Collections; 
    using System.Collections.Specialized;
#endregion 
 
    /// Encapsulates the arguments of an EntityCollectionChanged delegate
    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704", Justification = "Name gets too long with Parameters")] 
    public sealed class EntityCollectionChangedParams
    {
        #region Fields
 
        /// Context associated with the BindingObserver.
        private readonly DataServiceContext context; 
 
        /// 
        /// The source object that references the target object through a collection navigation property. 
        /// 
        private readonly object sourceEntity;

        /// The property of the source object that references the collection that has changed. 
        private readonly string propertyName;
 
        /// The entity set of the source object. 
        private readonly string sourceEntitySet;
 
        /// The collection that has changed.
        private readonly ICollection collection;

        /// The target entity object involved in the change. 
        private readonly object targetEntity;
 
        /// The entity set name of the target object. 
        private readonly string targetEntitySet;
 
        /// 
        /// The action that indicates how the collection was changed. The value will be Add or Remove.
        /// 
        private readonly NotifyCollectionChangedAction action; 

        #endregion 
 
        #region Constructor
 
        /// 
        /// Construct an EntityCollectionChangedParams object.
        /// 
        /// The DataServiceContext associated with the BindingObserver. 
        /// The source object that references the target object through a collection navigation property.
        /// The property of the source object that references the collection that has changed. 
        /// The entity set of the source object. 
        /// The collection that has changed.
        /// The target entity object involved in the change. 
        /// The entity set name of the target object.
        /// The action that indicates how the collection was changed. The value will be Add or Remove.
        internal EntityCollectionChangedParams(
            DataServiceContext context, 
            object sourceEntity,
            string propertyName, 
            string sourceEntitySet, 
            ICollection collection,
            object targetEntity, 
            string targetEntitySet,
            NotifyCollectionChangedAction action)
        {
            this.context = context; 
            this.sourceEntity = sourceEntity;
            this.propertyName = propertyName; 
            this.sourceEntitySet = sourceEntitySet; 
            this.collection = collection;
            this.targetEntity = targetEntity; 
            this.targetEntitySet = targetEntitySet;
            this.action = action;
        }
 
        #endregion
 
        #region Properties 

        /// Context to which source and target entities belong. 
        public DataServiceContext Context
        {
            get { return this.context; }
        } 

        ///  
        /// The source object that references the target object through a collection navigation property. 
        /// 
        public object SourceEntity 
        {
            get { return this.sourceEntity; }
        }
 
        /// 
        /// The property of the source object that references the collection that has changed. 
        ///  
        public string PropertyName
        { 
            get { return this.propertyName; }
        }

        /// The entity set of the source object. 
        public string SourceEntitySet
        { 
            get { return this.sourceEntitySet; } 
        }
 
        /// The target entity object involved in the change.
        public object TargetEntity
        {
            get { return this.targetEntity; } 
        }
 
        /// The entity set name of the target object. 
        public string TargetEntitySet
        { 
            get { return this.targetEntitySet; }
        }

        /// The collection that has changed. 
        public ICollection Collection
        { 
            get { return this.collection; } 
        }
 
        /// 
        /// The action that indicates how the collection was changed. The value will be Add or Remove.
        /// 
        public NotifyCollectionChangedAction Action 
        {
            get { return this.action; } 
        } 

        #endregion 
    }
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.


                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK