private void ShowAddAllowTypeDialog() { IEnumerable <Type> typesInTree; if (string.IsNullOrEmpty(mProps.SelectedDatabase)) { typesInTree = this.mLoadedTypes; } else { HashSet <String> visibleTypes = new HashSet <string>(mProps.CollectionTypeMappings[mProps.SelectedDatabase].Select(x => x.CollectionType).Where(x => x != null)); typesInTree = mLoadedTypes.Where(x => visibleTypes.Contains(x.ToString()) || //backwards compatibility (x.AssemblyQualifiedName != null && visibleTypes.Contains(x.AssemblyQualifiedName))); } TreeNode[] nodes = ConnectionDialog.MakeTree(typesInTree); using (var selector = new SingleTypeSelector(nodes)) { selector.Name = "Select Type to allow Save"; DialogResult result = selector.ShowDialog(); if (result == DialogResult.OK) { this.lbSaveAllowedTypes.Items.Add(selector.SelectedType.ToString()); } } }
private void ShowAddAllowTypeDialog() { IEnumerable<Type> typesInTree; if (string.IsNullOrEmpty(mProps.SelectedDatabase)) { typesInTree = this.mLoadedTypes; } else { HashSet<String> visibleTypes = new HashSet<string>(mProps.CollectionTypeMappings[mProps.SelectedDatabase].Select(x => x.CollectionType).Where(x => x != null)); typesInTree = mLoadedTypes.Where(x => visibleTypes.Contains(x.ToString()) || //backwards compatibility (x.AssemblyQualifiedName != null && visibleTypes.Contains(x.AssemblyQualifiedName))); } TreeNode[] nodes = ConnectionDialog.MakeTree(typesInTree); using (var selector = new SingleTypeSelector(nodes)) { selector.Name = "Select Type to allow Save"; DialogResult result = selector.ShowDialog(); if (result == DialogResult.OK) { this.lbSaveAllowedTypes.Items.Add(selector.SelectedType.ToString()); } } }