示例#1
0
 /// <summary>
 ///     Add a TreeView with settings; pass in null for settings to use the default settings
 /// </summary>
 internal void AddTreeView(TreeView treeView, TreeViewSchemaFilterMapperSettings settings)
 {
     _treeViews.Add(treeView);
     if (settings == null)
     {
         settings = TreeViewSchemaFilterMapperSettings.GetDefaultSettings();
     }
     _treeView2Settings.Add(treeView, settings);
 }
 // <summary>
 //     Add a TreeView with settings; pass in null for settings to use the default settings
 // </summary>
 internal void AddTreeView(TreeView treeView, TreeViewSchemaFilterMapperSettings settings)
 {
     _treeViews.Add(treeView);
     if (settings == null)
     {
         settings = TreeViewSchemaFilterMapperSettings.GetDefaultSettings();
     }
     _treeView2Settings.Add(treeView, settings);
 }
示例#3
0
        private static void UpdateSchemaFilterEntryBagFromLeafNode(
            TreeNode leafNode, SchemaFilterEntryBag schemaFilterEntryBag, TreeViewSchemaFilterMapperSettings settings)
        {
            Debug.Assert(
                settings != null,
                "We should not be passing null settings into this method; they should at least be the default settings");
            if (settings == null)
            {
                return;
            }

            var e = leafNode.Tag as EntityStoreSchemaFilterEntry;
            Debug.Assert(
                e != null,
                "Either the Tag property of the leaf node is null or the leaf node is not an EntityStoreSchemaFilterEntry");
            if (e != null)
            {
                switch (e.Types)
                {
                    case EntityStoreSchemaFilterObjectTypes.Table:
                        if (false == settings.UseOnlyCheckedNodes
                            || leafNode.Checked)
                        {
                            schemaFilterEntryBag.IncludedTableEntries.Add(e);
                        }
                        else
                        {
                            schemaFilterEntryBag.ExcludedTableEntries.Add(
                                new EntityStoreSchemaFilterEntry(
                                    e.Catalog, e.Schema, e.Name, e.Types, EntityStoreSchemaFilterEffect.Exclude));
                        }
                        break;
                    case EntityStoreSchemaFilterObjectTypes.View:
                        if (false == settings.UseOnlyCheckedNodes
                            || leafNode.Checked)
                        {
                            schemaFilterEntryBag.IncludedViewEntries.Add(e);
                        }
                        else
                        {
                            schemaFilterEntryBag.ExcludedViewEntries.Add(
                                new EntityStoreSchemaFilterEntry(
                                    e.Catalog, e.Schema, e.Name, e.Types, EntityStoreSchemaFilterEffect.Exclude));
                        }
                        break;
                    case EntityStoreSchemaFilterObjectTypes.Function:
                        if (false == settings.UseOnlyCheckedNodes
                            || leafNode.Checked)
                        {
                            schemaFilterEntryBag.IncludedSprocEntries.Add(e);
                        }
                        else
                        {
                            schemaFilterEntryBag.ExcludedSprocEntries.Add(
                                new EntityStoreSchemaFilterEntry(
                                    e.Catalog, e.Schema, e.Name, e.Types, EntityStoreSchemaFilterEffect.Exclude));
                        }
                        break;
                    default:
                        Debug.Fail("Unexpected filter object type");
                        break;
                }
            }
        }
示例#4
0
 /// <summary>
 ///     Instantiate the mapper with a TreeView: pass in null for settings to use the default settings
 /// </summary>
 internal TreeViewSchemaFilterMapper(TreeView treeView, TreeViewSchemaFilterMapperSettings settings = null)
     : this()
 {
     AddTreeView(treeView, settings);
 }
        private static void UpdateSchemaFilterEntryBagFromLeafNode(
            TreeNode leafNode, SchemaFilterEntryBag schemaFilterEntryBag, TreeViewSchemaFilterMapperSettings settings)
        {
            Debug.Assert(
                settings != null,
                "We should not be passing null settings into this method; they should at least be the default settings");
            if (settings == null)
            {
                return;
            }

            var e = leafNode.Tag as EntityStoreSchemaFilterEntry;
            Debug.Assert(
                e != null,
                "Either the Tag property of the leaf node is null or the leaf node is not an EntityStoreSchemaFilterEntry");
            if (e != null)
            {
                switch (e.Types)
                {
                    case EntityStoreSchemaFilterObjectTypes.Table:
                        if (false == settings.UseOnlyCheckedNodes
                            || leafNode.Checked)
                        {
                            schemaFilterEntryBag.IncludedTableEntries.Add(e);
                        }
                        else
                        {
                            schemaFilterEntryBag.ExcludedTableEntries.Add(
                                new EntityStoreSchemaFilterEntry(
                                    e.Catalog, e.Schema, e.Name, e.Types, EntityStoreSchemaFilterEffect.Exclude));
                        }
                        break;
                    case EntityStoreSchemaFilterObjectTypes.View:
                        if (false == settings.UseOnlyCheckedNodes
                            || leafNode.Checked)
                        {
                            schemaFilterEntryBag.IncludedViewEntries.Add(e);
                        }
                        else
                        {
                            schemaFilterEntryBag.ExcludedViewEntries.Add(
                                new EntityStoreSchemaFilterEntry(
                                    e.Catalog, e.Schema, e.Name, e.Types, EntityStoreSchemaFilterEffect.Exclude));
                        }
                        break;
                    case EntityStoreSchemaFilterObjectTypes.Function:
                        if (false == settings.UseOnlyCheckedNodes
                            || leafNode.Checked)
                        {
                            schemaFilterEntryBag.IncludedSprocEntries.Add(e);
                        }
                        else
                        {
                            schemaFilterEntryBag.ExcludedSprocEntries.Add(
                                new EntityStoreSchemaFilterEntry(
                                    e.Catalog, e.Schema, e.Name, e.Types, EntityStoreSchemaFilterEffect.Exclude));
                        }
                        break;
                    default:
                        Debug.Fail("Unexpected filter object type");
                        break;
                }
            }
        }
 // <summary>
 //     Instantiate the mapper with a TreeView: pass in null for settings to use the default settings
 // </summary>
 internal TreeViewSchemaFilterMapper(TreeView treeView, TreeViewSchemaFilterMapperSettings settings = null)
     : this()
 {
     AddTreeView(treeView, settings);
 }