Esempio n. 1
0
 public FilterableTreeViewItem(ADOTabularTable table, GetChildrenDelegate getChildren, IGlobalOptions options, IEventAggregator eventAggregator, IMetadataPane metadataPane)
 {
     _eventAggregator = eventAggregator;
     _options         = options;
     _tabularObject   = table;
     _getChildren     = getChildren;
     MetadataPane     = metadataPane;
 }
Esempio n. 2
0
        public static IEnumerable <FilterableTreeViewItem> TreeViewFolderChildren(this IADOTabularObjectReference objRef, IADOTabularObject table, IGlobalOptions options, IEventAggregator eventAggregator, IMetadataPane metadataPane)
        {
            var lst = new List <FilterableTreeViewItem>();

            var folder = objRef as IADOTabularFolderReference;

            if (folder != null)
            {
                foreach (var folderItem in folder.FolderItems)
                {
                    GetChildrenDelegate getChildren = null;
                    if (folderItem is IADOTabularFolderReference fi)
                    {
                        // if the current item is a sub-folder look for it's children
                        getChildren = fi.TreeViewFolderChildren;
                    }
                    else
                    {
                        var col = (table as ADOTabularTable).Columns.GetByPropertyRef(folderItem.InternalReference);
                        switch (col)
                        {
                        // if this item is a KPI get it's child components
                        case ADOTabularKpi k:
                            getChildren = k.TreeViewColumnChildren;
                            break;

                        // if this item is a hierarchy get it's child levels
                        case ADOTabularHierarchy h:
                            getChildren = h.TreeViewColumnChildren;
                            break;

                        default:
                            getChildren = null;
                            break;
                        }
                        ;
                    }

                    lst.Add(new TreeViewColumn(folderItem, getChildren, (table as ADOTabularTable), options, eventAggregator, metadataPane));
                }
            }
            else
            {
                var col = (table as ADOTabularTable).Columns.GetByPropertyRef(objRef.InternalReference);
                lst.Add(new TreeViewColumn(col, null, options, eventAggregator, metadataPane));
            }


            return(lst);
        }
Esempio n. 3
0
        public static List <IFilterableTreeViewItem> TreeViewTables(this ADOTabularModel model, IGlobalOptions options, IEventAggregator eventAggregator, IMetadataPane metadataPane)
        {
            var lst = new List <IFilterableTreeViewItem>();

            foreach (var t in model.Tables)
            {
                if (t.Private && !metadataPane.ShowHiddenObjects)
                {
                    continue;                                               // skip Private tables
                }
                if (t.ShowAsVariationsOnly && !metadataPane.ShowHiddenObjects)
                {
                    continue;                                                            // skip Variation tables
                }
                if (!metadataPane.ShowHiddenObjects && !t.IsVisible)
                {
                    continue;                                                  // skip hidden tables
                }
                lst.Add(new TreeViewTable(t, t.TreeViewColumns, options, eventAggregator, metadataPane));
            }
            return(lst);
        }
Esempio n. 4
0
 public TreeViewColumn(ADOTabularHierarchy hier, IGlobalOptions options, IEventAggregator eventAggregator, IMetadataPane metadataPane)
     : base(hier.Table, null, options, eventAggregator, metadataPane)
 {
     Options       = options;
     Column        = hier;
     Description   = hier.Description;
     MetadataImage = MetadataImages.Hierarchy;
 }
Esempio n. 5
0
        public TreeViewColumn(IADOTabularObjectReference reference, GetChildrenDelegate getChildren, ADOTabularTable table, IGlobalOptions options, IEventAggregator eventAggregator, IMetadataPane metadataPane)
            : base(table, getChildren, options, eventAggregator, metadataPane)
        {
            Options = options;
            IADOTabularFolderReference folder = reference as IADOTabularFolderReference;

            if (folder == null)
            {
                Column        = table.Columns.GetByPropertyRef(reference.InternalReference);
                MetadataImage = Column.GetMetadataImage();
            }
            else
            {
                _caption      = reference.Name;
                MetadataImage = MetadataImages.Folder;
            }
        }
Esempio n. 6
0
        public static IEnumerable <FilterableTreeViewItem> TreeViewFolderChildren(this IADOTabularObjectReference objRef, ADOTabularTable table, IGlobalOptions options, IEventAggregator eventAggregator, IMetadataPane metadataPane)
        {
            var lst = new List <FilterableTreeViewItem>();

            var folder = objRef as IADOTabularFolderReference;

            if (folder != null)
            {
                foreach (var folderItem in folder.FolderItems)
                {
                    GetChildrenDelegate getChildren = null;
                    if (folderItem is IADOTabularFolderReference)
                    {
                        getChildren = ((IADOTabularObjectReference)folderItem).TreeViewFolderChildren;
                    }
                    lst.Add(new TreeViewColumn(folderItem, getChildren, table, options, eventAggregator, metadataPane));
                }
            }
            else
            {
                var col = table.Columns.GetByPropertyRef(objRef.InternalReference);
                lst.Add(new TreeViewColumn(col, null, options, eventAggregator, metadataPane));
            }


            return(lst);
        }
Esempio n. 7
0
        public TreeViewColumn(ADOTabularLevel level, IGlobalOptions options, IEventAggregator eventAggregator, IMetadataPane metadataPane) : base(level.Column.Table, null, options, eventAggregator, metadataPane)
        {
            Options      = options;
            Column       = level;
            Description  = level.Column.Description;
            DataTypeName = level.Column.DataTypeName;

            MetadataImage = MetadataImages.Column;
        }
Esempio n. 8
0
 public TreeViewColumn(ADOTabularColumn column, GetChildrenDelegate getChildren, IGlobalOptions options, IEventAggregator eventAggregator, IMetadataPane metadataPane) : base(column.Table, getChildren, options, eventAggregator, metadataPane)
 {
     _eventAggregator = eventAggregator;
     _sampleData      = new List <string>();
     Column           = column;
     _column          = column;
     Options          = options;
     Description      = column.Description;
     DataTypeName     = column.DataTypeName;
     MetadataImage    = column.MetadataImage;
     FormatString     = column.FormatString;
     MinValue         = column.MinValue;
     MaxValue         = column.MaxValue;
     DistinctValues   = column.DistinctValues;
 }
Esempio n. 9
0
        //public TreeViewColumn(string displayFolder, GetChildrenDelegate getChildren, IGlobalOptions options, IEventAggregator eventAggregator) : base(getChildren, options, eventAggregator)
        //{
        //    _eventAggregator = eventAggregator;
        //    _sampleData = new List<string>();
        //    //Column = column;
        //    //_column = column;
        //    Options = options;

        //    MetadataImage = MetadataImages.Folder;

        //}

        public TreeViewColumn(ADOTabularKpiComponent kpiComponent, IGlobalOptions options, IEventAggregator eventAggregator, IMetadataPane metadataPane) : base(kpiComponent.Column.Table, null, null, eventAggregator, metadataPane)
        {
            Options       = options;
            Column        = kpiComponent;
            DataTypeName  = kpiComponent.DataTypeName;
            Description   = kpiComponent.Column.Description;
            MetadataImage = MetadataImages.Measure;
        }
Esempio n. 10
0
 public TreeViewFunction(ADOTabularFunction function, GetChildrenDelegate getChildren, IGlobalOptions options, IEventAggregator eventAggregator, IMetadataPane metadataPane) : base(function, getChildren, options, eventAggregator, metadataPane)
 {
     _eventAggregator = eventAggregator;
     Function         = function;
     Options          = options;
     Description      = function.Description;
     MetadataImage    = function.MetadataImage;
 }
Esempio n. 11
0
 //private readonly ADOTabularTable _table;
 public TreeViewTable(ADOTabularTable table, GetChildrenDelegate getChildren, IGlobalOptions options, IEventAggregator eventAggregator, IMetadataPane metadataPane) : base(table, getChildren, options, eventAggregator, metadataPane)
 {
     _table = table;
 }
Esempio n. 12
0
 public TreeViewFunctionGroup(ADOTabularFunctionGroup functionGroup, GetChildrenDelegate getChildren, IGlobalOptions options, IEventAggregator eventAggregator, IMetadataPane metadataPane) : base(getChildren, options, eventAggregator, metadataPane)
 {
     _functionGroup = functionGroup;
 }
Esempio n. 13
0
        public static IEnumerable <FilterableTreeViewItem> TreeViewFunctions(this ADOTabularFunctionGroup group, IADOTabularObject tabularObject, IGlobalOptions options, IEventAggregator eventAggregator, IMetadataPane metadataPane)
        {
            var lst = new SortedList <string, FilterableTreeViewItem>();

            foreach (var f in group.Functions)
            {
                var fun = new TreeViewFunction(f, null, options, eventAggregator, metadataPane);

                var lstItem = lst.FirstOrDefault(x => x.Value.Name == fun.Name).Value;
                if (lstItem != null && lstItem.ObjectType == lstItem.ObjectType)
                {
                    // todo add this col as a child of lstItem
                    throw new NotSupportedException();
                }
                else
                {
                    lst.Add(f.Caption, fun);
                }
            }



            return(lst.Values);
        }
Esempio n. 14
0
        public static List <FilterableTreeViewItem> TreeViewFunctions(this IFunctionProvider funcProvider, IGlobalOptions options, IEventAggregator eventAggregator, IMetadataPane metadataPane)
        {
            var lst  = new List <FilterableTreeViewItem>();
            var grps = funcProvider.FunctionGroups;

            if (grps == null)
            {
                return(null);
            }
            foreach (var fg in grps)
            {
                lst.Add(new TreeViewFunctionGroup(fg, fg.TreeViewFunctions, options, eventAggregator, metadataPane));
            }
            return(lst);
        }
Esempio n. 15
0
        public static IEnumerable <FilterableTreeViewItem> TreeViewColumns(this ADOTabularTable table, IADOTabularObject table2, IGlobalOptions options, IEventAggregator eventAggregator, IMetadataPane metadataPane)
        {
            var lst = new SortedList <string, FilterableTreeViewItem>(new DuplicateKeyComparer <string>());

            foreach (var c in table.Columns)
            {
                if (!metadataPane.ShowHiddenObjects && !c.IsVisible)
                {
                    continue;                                                  // skip hidden columns
                }
                if (!c.IsInDisplayFolder)
                {
                    var col = new TreeViewColumn(c, c.TreeViewColumnChildren, options, eventAggregator, metadataPane);

                    var lstItem = lst.FirstOrDefault(x => x.Value.Name == col.Name).Value;
                    if (lstItem != null && lstItem.ObjectType == lstItem.ObjectType)
                    {
                        // todo add this col as a child of lstItem
                        throw new NotSupportedException();
                    }
                    else
                    {
                        lst.Add(col.Caption, col);
                    }
                }
            }

            foreach (IADOTabularObjectReference f in table.FolderItems)
            {
                var folder = new TreeViewColumn(f, f.TreeViewFolderChildren, table, options, eventAggregator, metadataPane);
                try
                {
                    var sortKey = folder.Caption;
                    // add spaces as prefix to force sorting folders first
                    if (options.SortFoldersFirstInMetadata)
                    {
                        sortKey = "    " + folder.Caption;
                    }
                    lst.Add(sortKey, folder);
                }
                catch (Exception ex)
                {
                    Log.Error(ex, "{class} {method} {message}", "TreeViewTable", "TreeViewColumns", ex.Message);
                }
            }
            return(lst.Values);
        }
Esempio n. 16
0
 public TreeViewColumn(ADOTabularKpi kpi, IGlobalOptions options, IEventAggregator eventAggregator, IMetadataPane metadataPane)
     : base(kpi.Table, null, options, eventAggregator, metadataPane)
 {
     Options       = options;
     Column        = kpi;
     DataTypeName  = kpi.DataTypeName;
     Description   = kpi.Description;
     MetadataImage = MetadataImages.Kpi;
 }
Esempio n. 17
0
        public static IEnumerable <FilterableTreeViewItem> TreeViewColumnChildren(this ADOTabularColumn column, IADOTabularObject table, IGlobalOptions options, IEventAggregator eventAggregator, IMetadataPane metadataPane)
        {
            var lst  = new List <FilterableTreeViewItem>();
            var hier = column as ADOTabularHierarchy;

            if (hier != null)
            {
                foreach (var lvl in hier.Levels)
                {
                    lst.Add(new TreeViewColumn(lvl, options, eventAggregator, metadataPane));
                }
            }
            var kpi = column as ADOTabularKpi;

            if (kpi != null)
            {
                foreach (var comp in kpi.Components)
                {
                    lst.Add(new TreeViewColumn(comp, options, eventAggregator, metadataPane));
                }
            }
            return(lst);
        }
Esempio n. 18
0
        public static List <FilterableTreeViewItem> TreeViewFunctions(this ADOTabularConnection conn, IGlobalOptions options, IEventAggregator eventAggregator, IMetadataPane metadataPane)
        {
            var lst = new List <FilterableTreeViewItem>();

            foreach (var fg in conn.FunctionGroups)
            {
                lst.Add(new TreeViewFunctionGroup(fg, fg.TreeViewFunctions, options, eventAggregator, metadataPane));
            }
            return(lst);
        }