Ejemplo n.º 1
0
        /// <summary>
        /// Verify if an item is filtered with a particular ObjectStateFilter
        /// PendingAdded items are always visible
        /// </summary>
        /// <param name="Item">Item to verify</param>
        /// <param name="Filter">State to verify against the item</param>
        /// <returns>true/false</returns>
        private bool IsVisible(Box <T> Item, ObjectStateFilter Filter)
        {
            if (Item.Storage.Status == ObjectStatusType.PendingAdded)
            {
                return(true);
            }
            bool bMaskedVisible = ((int)Item.Storage.Status & (int)Filter) > 0;

            if (bMaskedVisible)
            {
                if (Item.Visible)
                {
                    return(true);
                }
            }
            return(false);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Collection constructor
        /// </summary>
        public RafCollection()
        {
            _StateFilter           = ObjectStateFilter.Current;
            _Filter                = string.Empty;
            _InvisibleCount        = 0;
            _CurrentStorageElement = null;

            _AllowNew    = this.ItemTypeHasDefaultConstructor;
            _AllowEdit   = true;
            _AllowRemove = true;
            _IsSorted    = false;

            _SortDescriptions = null;
            CreateArray();

            // I create the event handler only once here
            _PropertyChangedEventHandler = new PropertyChangedEventHandler(CollectedItem_PropertyChanged);
        }