コード例 #1
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);
        }
コード例 #2
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);
        }
コード例 #3
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);
        }