Exemple #1
0
        public void CollectionManagerCollatesFilterDescriptorEvents()
        {
            FilterDescriptorCollection collection = new FilterDescriptorCollection();
            ExpressionCache            cache      = new ExpressionCache();
            FilterDescriptor           descriptor = null;

            this.CollectionManagerCollatesTemplate(
                (validationAction) =>
            {
                return(new FilterCollectionManager(collection, cache, fd => validationAction()));
            },
                () =>
            {
                collection.Add(new FilterDescriptor());
            },
                () =>
            {
                collection[0].PropertyPath = "First";
            },
                () =>
            {
                collection.Add(new FilterDescriptor());
            },
                () =>
            {
                collection[1].PropertyPath = "Second";
            },
                () =>
            {
                collection[1] = new FilterDescriptor();
            },
                () =>
            {
                descriptor = collection[0];
                collection.Remove(descriptor);
            },
                () =>
            {
                descriptor.PropertyPath = "Removed";
            });
        }
        public void CollectionManagerCollatesFilterDescriptorEvents()
        {
            FilterDescriptorCollection collection = new FilterDescriptorCollection();
            ExpressionCache cache = new ExpressionCache();
            FilterDescriptor descriptor = null;

            this.CollectionManagerCollatesTemplate(
                (validationAction) => 
                {
                    return new FilterCollectionManager(collection, cache, fd => validationAction());
                },
                () =>
                {
                    collection.Add(new FilterDescriptor());
                },
                () =>
                {
                    collection[0].PropertyPath = "First";
                },
                () =>
                {
                    collection.Add(new FilterDescriptor());
                },
                () =>
                {
                    collection[1].PropertyPath = "Second";
                },
                () =>
                {
                    collection[1] = new FilterDescriptor();
                },
                () =>
                {
                    descriptor = collection[0];
                    collection.Remove(descriptor);
                },
                () =>
                {
                    descriptor.PropertyPath = "Removed";
                });
        }