public UITreeSelection(IEnumerable <ITabularNamedObject> selection) : base(selection) { Folders = this.OfType <Folder>(); Groups = this.OfType <LogicalGroup>(); Direct = new UISelectionList <ITabularNamedObject>(this.OfType <ITabularNamedObject>()); AssignCollections(); }
public UITreeSelection(IReadOnlyCollection <TreeNodeAdv> selectedNodes) { var allNodes = GetDeep(selectedNodes).ToList(); SetItems(allNodes.Select(n => n.Tag).OfType <ITabularNamedObject>() .Where(n => !(n is Folder))); _selectedNodes = selectedNodes; if (allNodes.Count == 0) { Context = Context.None; } else if (allNodes.Count == 1) { Context = GetNodeContext(allNodes[0]); } else { Context = GetNodeContexts(allNodes); } Folders = selectedNodes.Select(n => n.Tag).OfType <Folder>(); Groups = selectedNodes.Select(n => n.Tag).OfType <LogicalGroup>(); Direct = new UISelectionList <ITabularNamedObject>(selectedNodes.Select(n => n.Tag).OfType <ITabularNamedObject>()); AssignCollections(); }
private void AssignCollections() { Measures = new UISelectionList <Measure>(this.OfType <Measure>()); Hierarchies = new UISelectionList <Hierarchy>(this.OfType <Hierarchy>()); Levels = new UISelectionList <Level>(this.OfType <Level>()); Columns = new UISelectionList <Column>(this.OfType <Column>()); Cultures = new UISelectionList <Culture>(this.OfType <Culture>()); Roles = new UISelectionList <ModelRole>(this.OfType <ModelRole>()); DataSources = new UISelectionList <DataSource>(this.OfType <DataSource>()); Perspectives = new UISelectionList <Perspective>(this.OfType <Perspective>()); CalculatedColumns = new UISelectionList <CalculatedColumn>(this.OfType <CalculatedColumn>()); CalculatedTableColumns = new UISelectionList <CalculatedTableColumn>(this.OfType <CalculatedTableColumn>()); SingleColumnRelationships = new UISelectionList <SingleColumnRelationship>(this.OfType <SingleColumnRelationship>()); DataColumns = new UISelectionList <DataColumn>(this.OfType <DataColumn>()); Tables = new UISelectionList <Table>(this.OfType <Table>()); Partitions = new UISelectionList <Partition>(this.OfType <Partition>()); }
public UITreeSelection(IReadOnlyCollection <TreeNodeAdv> selectedNodes) { var allNodes = GetDeep(selectedNodes).ToList(); SetItems(allNodes.Select(n => n.Tag).OfType <ITabularNamedObject>() .Where(n => !(n is Folder)) .Select(n => (n as PartitionViewTable)?.Table ?? n)); _selectedNodes = selectedNodes; if (Count == 0) { Context = Context.None; } else if (Count == 1) { Context = GetNodeContext(allNodes[0]); } else { Context = GetNodeContexts(allNodes); } Types = GetNodeTypes(selectedNodes); Folders = selectedNodes.Select(n => n.Tag).OfType <Folder>(); Groups = selectedNodes.Select(n => n.Tag).OfType <LogicalGroup>(); Measures = new UISelectionList <Measure>(this.OfType <Measure>()); Hierarchies = new UISelectionList <Hierarchy>(this.OfType <Hierarchy>()); Levels = new UISelectionList <Level>(this.OfType <Level>()); Columns = new UISelectionList <Column>(this.OfType <Column>()); Cultures = new UISelectionList <Culture>(this.OfType <Culture>()); Roles = new UISelectionList <ModelRole>(this.OfType <ModelRole>()); DataSources = new UISelectionList <DataSource>(this.OfType <DataSource>()); Perspectives = new UISelectionList <Perspective>(this.OfType <Perspective>()); CalculatedColumns = new UISelectionList <CalculatedColumn>(this.OfType <CalculatedColumn>()); CalculatedTableColumns = new UISelectionList <CalculatedTableColumn>(this.OfType <CalculatedTableColumn>()); SingleColumnRelationships = new UISelectionList <SingleColumnRelationship>(this.OfType <SingleColumnRelationship>()); DataColumns = new UISelectionList <DataColumn>(this.OfType <DataColumn>()); Tables = new UISelectionList <Table>(this.OfType <Table>()); Partitions = new UISelectionList <Partition>(this.OfType <Partition>()); Direct = new UISelectionList <ITabularNamedObject>(selectedNodes.Select(n => n.Tag).OfType <ITabularNamedObject>()); }