Esempio n. 1
0
        /// <summary>
        /// Sorts the data in this <see cref="ChangeCachingCollectionDataDecorator"/> and the data in the <see cref="OriginalData"/> collection
        /// using the given <paramref name="comparison"/>. This operation causes the change state to be invalidated if the original data is not the same
        /// as the current data.
        /// </summary>
        /// <param name="comparison"></param>
        public void SortOriginalAndCurrent(Comparison <DomainObject> comparison)
        {
            ArgumentUtility.CheckNotNull("comparison", comparison);

            // Sort the unobserved inner collection to avoid copy on write: if the contents hasn't been copied, we want to sort both
            // collections at the same time!
            _unobservedWrappedData.Sort(comparison);

            // If the original collection has already been copied, we must sort it manually. This might cause the change state cache to be wrong, so it is
            // invalidated (and a notification raised).
            if (_originalData.IsContentsCopied)
            {
                _originalData.Sort(comparison);
                OnChangeStateUnclear();
            }
        }
 public virtual void Sort(Comparison <DomainObject> comparison)
 {
     ArgumentUtility.CheckNotNull("comparison", comparison);
     _wrappedData.Sort(comparison);
 }
        protected void Sort(Comparison <DomainObject> comparison)
        {
            ArgumentUtility.CheckNotNull("comparison", comparison);

            _dataStrategy.Sort(comparison);
        }