private void ultraListViewFilters_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { UltraListViewSubItem item; item = ultraListViewFilters.SubItemFromPoint(e.Location); if (item != null) { if (item.Key == "Scope" && !string.IsNullOrEmpty(item.Text)) { FilterObject filterObject; filterObject = (FilterObject)item.Item.Tag; if (filterObject.IsConfigurable) { if (m_FilterObjects.TryGetValue(filterObject.ObjectType, out filterObject)) { contextMenuStripType.ShowImageMargin = false; contextMenuStripType.Tag = filterObject; contextMenuStripType.Show(ultraListViewFilters.PointToScreen(e.Location)); } } } else if (item.Key == "Name" && !string.IsNullOrEmpty(item.Text)) { FilterObject filterObject; filterObject = (FilterObject)item.Item.Tag; if (filterObject.IsConfigurable) { if (m_FilterObjects.TryGetValue(filterObject.ObjectType, out filterObject)) { FilterObject dbFilter = (FilterObject)ultraListViewFilters.Items[0].Tag; bool isDirty; filterObject.MatchStringList = Forms.Form_NameMatching.Process(filterObject, dbFilter, m_ServerInfo, out isDirty); if (isDirty) { m_isDirty = true; } DisplayFilterObjects(false); } } } } } }
private void BuildFilterRules() { m_Filter.ClearRules(); foreach (KeyValuePair <RuleObjectType, FilterObject> kvp in m_FilterObjects) { FilterObject fo = (FilterObject)kvp.Value; if (fo.IsChecked) { foreach (string str in fo.MatchStringList) { m_Filter.AddRule(new Sql.DataCollectionFilter.Rule(fo.ObjectType, fo.ObjectScope, (str != null) ? str : string.Empty)); } // ExtendedStoredProcedures are handled special. // They must create a new rule. // --------------------------------------------- if (fo.ObjectType == RuleObjectType.ExtendedStoredProcedure) { m_isDirty = true; } } } }
private void CreateFilterObjects() { m_FilterObjects = new Dictionary <RuleObjectType, FilterObject>(); string matchAll = null; // Databases FilterObject filterObj = new FilterObject(RuleObjectType.Database, RuleScope.All, matchAll); m_FilterObjects.Add(RuleObjectType.Database, filterObj); //SQLsecure 3.1 (Tushar)--Fix for defect SQLSECU-1742 if (m_ServerInfo.serverType != Utility.Activity.TypeServerAzureDB) { // Extended Stored Procedures filterObj = new FilterObject(RuleObjectType.ExtendedStoredProcedure, RuleScope.System, matchAll); m_FilterObjects.Add(RuleObjectType.ExtendedStoredProcedure, filterObj); } // Tables filterObj = new FilterObject(RuleObjectType.Table, RuleScope.All, matchAll); m_FilterObjects.Add(RuleObjectType.Table, filterObj); // Stored Procedures filterObj = new FilterObject(RuleObjectType.StoredProcedure, RuleScope.All, matchAll); m_FilterObjects.Add(RuleObjectType.StoredProcedure, filterObj); // Views filterObj = new FilterObject(RuleObjectType.View, RuleScope.All, matchAll); m_FilterObjects.Add(RuleObjectType.View, filterObj); // Functions filterObj = new FilterObject(RuleObjectType.Function, RuleScope.All, matchAll); m_FilterObjects.Add(RuleObjectType.Function, filterObj); if (m_ServerInfo.version > ServerVersion.SQL2000 && m_ServerInfo.version != ServerVersion.Unsupported) { // Database Principles filterObj = new FilterObject(RuleObjectType.User, RuleScope.All, matchAll); m_FilterObjects.Add(RuleObjectType.User, filterObj); // Roles filterObj = new FilterObject(RuleObjectType.Role, RuleScope.All, matchAll); m_FilterObjects.Add(RuleObjectType.Role, filterObj); // Synonyms filterObj = new FilterObject(RuleObjectType.Synonym, RuleScope.All, matchAll); m_FilterObjects.Add(RuleObjectType.Synonym, filterObj); // Assemblies filterObj = new FilterObject(RuleObjectType.Assembly, RuleScope.All, matchAll); m_FilterObjects.Add(RuleObjectType.Assembly, filterObj); // User-defined Data Types filterObj = new FilterObject(RuleObjectType.UserDefinedDataType, RuleScope.All, matchAll); m_FilterObjects.Add(RuleObjectType.UserDefinedDataType, filterObj); // XML Schema Collections filterObj = new FilterObject(RuleObjectType.XMLSchemaCollection, RuleScope.All, matchAll); m_FilterObjects.Add(RuleObjectType.XMLSchemaCollection, filterObj); // Full Text Catalogs //Removing full text catalogs while registering azure DB if (m_ServerInfo.serverType != Utility.Activity.TypeServerAzureDB) { filterObj = new FilterObject(RuleObjectType.FullTextCatalog, RuleScope.All, matchAll); m_FilterObjects.Add(RuleObjectType.FullTextCatalog, filterObj); } //Keys filterObj = new FilterObject(RuleObjectType.Key, RuleScope.All, matchAll); m_FilterObjects.Add(RuleObjectType.Key, filterObj); //Certificates filterObj = new FilterObject(RuleObjectType.Certificate, RuleScope.All, matchAll); m_FilterObjects.Add(RuleObjectType.Certificate, filterObj); // Sequence Objects filterObj = new FilterObject(RuleObjectType.SequenceObject, RuleScope.All, matchAll); m_FilterObjects.Add(RuleObjectType.SequenceObject, filterObj); } }