예제 #1
0
        public DataContainerCollection Merge(DataContainerCollection dataContainers)
        {
            ArgumentUtility.CheckNotNull("dataContainers", dataContainers);

            DataContainerCollection mergedCollection = new DataContainerCollection();

            foreach (DataContainer dataContainer in this)
            {
                if (dataContainers.Contains(dataContainer.ID))
                {
                    mergedCollection.Add(dataContainers[dataContainer.ID]);
                }
                else
                {
                    mergedCollection.Add(dataContainer);
                }
            }

            return(mergedCollection);
        }
예제 #2
0
        public DataContainerCollection GetDifference(DataContainerCollection dataContainers)
        {
            ArgumentUtility.CheckNotNull("dataContainers", dataContainers);

            DataContainerCollection difference = new DataContainerCollection();

            foreach (DataContainer dataContainer in this)
            {
                if (!dataContainers.Contains(dataContainer.ID))
                {
                    difference.Add(dataContainer);
                }
            }

            return(difference);
        }
예제 #3
0
        // methods and properties

        public DataContainerCollection GetByState(StateType state)
        {
            ArgumentUtility.CheckValidEnumValue("state", state);

            DataContainerCollection collection = new DataContainerCollection();

            foreach (DataContainer dataContainer in this)
            {
                if (dataContainer.State == state)
                {
                    collection.Add(dataContainer);
                }
            }

            return(collection);
        }
예제 #4
0
        // types

        // static members and constants

        public static DataContainerCollection Join(DataContainerCollection firstCollection, DataContainerCollection secondCollection)
        {
            ArgumentUtility.CheckNotNull("firstCollection", firstCollection);
            ArgumentUtility.CheckNotNull("secondCollection", secondCollection);

            DataContainerCollection joinedCollection = new DataContainerCollection(firstCollection, false);

            foreach (DataContainer dataContainer in secondCollection)
            {
                if (!joinedCollection.Contains(dataContainer.ID))
                {
                    joinedCollection.Add(dataContainer);
                }
            }

            return(joinedCollection);
        }
 public void Register(DataContainer dataContainer)
 {
     ArgumentUtility.CheckNotNull("dataContainer", dataContainer);
     _transactionEventSink.RaiseDataContainerMapRegisteringEvent(dataContainer);
     _dataContainers.Add(dataContainer);
 }