public void EntityStoreSchemaFilterEntry_ctor_sets_types_All_and_effect_Allows_by_default()
        {
            var filterEntry =
                new EntityStoreSchemaFilterEntry("catalog", "schema", "name");

            Assert.Equal("catalog", filterEntry.Catalog);
            Assert.Equal("schema", filterEntry.Schema);
            Assert.Equal("name", filterEntry.Name);
            Assert.Equal(EntityStoreSchemaFilterObjectTypes.All, filterEntry.Types);
            Assert.Equal(EntityStoreSchemaFilterEffect.Allow, filterEntry.Effect);
        }
        public void EntityStoreSchemaFilterEntry_ctor_sets_fields()
        {
            var filterEntry =
                new EntityStoreSchemaFilterEntry(
                    "catalog",
                    "schema",
                    "name",
                    EntityStoreSchemaFilterObjectTypes.Table,
                    EntityStoreSchemaFilterEffect.Exclude);

            Assert.Equal("catalog", filterEntry.Catalog);
            Assert.Equal("schema", filterEntry.Schema);
            Assert.Equal("name", filterEntry.Name);
            Assert.Equal(EntityStoreSchemaFilterObjectTypes.Table, filterEntry.Types);
            Assert.Equal(EntityStoreSchemaFilterEffect.Exclude, filterEntry.Effect);
        }
        public static void EnsureSchemaAndLeafNode(
            TreeNode rootNode,
            DatabaseObject dbObj,
            TreeViewImage leafNodeImage,
            EntityStoreSchemaFilterEntry leafNodeTagObject)
        {
            Debug.Assert(rootNode != null, "rootNode must be non-null");
            if (rootNode == null)
            {
                return;
            }
            // find or create schema node
            var schemaName = (dbObj.Schema ?? Resources.SelectTablesPage_NullSchemaDisplayName);
            var schemaNode = FindOrCreateTreeSchemaNode(rootNode, schemaName, TreeViewImage.DbDatabaseSchemaImage);

            Debug.Assert(schemaNode != null, "null schemaNode for rootNode with label " + rootNode.Name + ", schemaName " + schemaName);
            if (schemaNode != null)
            {
                // now add child node to schema node
                var detailNode = CreateTreeNode(dbObj.Name, false, leafNodeTagObject, dbObj.Name, leafNodeImage, null);
                schemaNode.Nodes.Add(detailNode);
            }
        }
        private static void EnsureSchemaAndLeafNode(
            TreeNode rootNode,
            EntityStoreSchemaFilterEntry entry,
            TreeViewImage leafNodeImage)
        {
            Debug.Assert(rootNode != null, "rootNode must be non-null");
            Debug.Assert(entry != null, "entry must be non-null");

            var dbObj = DatabaseObject.CreateFromEntityStoreSchemaFilterEntry(entry, null);
            EnsureSchemaAndLeafNode(rootNode, dbObj, leafNodeImage, entry);
        }