Beispiel #1
0
        public static Hierarchy <LayoutItem> CreateAxisNode3(Table table, string axis)
        {
            var nodes          = table.LayoutRoot.Where(i => String.Equals(i.Item.Axis, axis, StringComparison.InvariantCultureIgnoreCase)).OrderBy(i => i.Order).ToList();
            var axislayoutitem = new LayoutItem();

            axislayoutitem.Category   = LayoutItemCategory.BreakDown;
            axislayoutitem.ID         = String.Format("Axis {0}", axis);
            axislayoutitem.Axis       = axis;
            axislayoutitem.IsAbstract = true;
            var axisnode = new Hierarchy <LayoutItem>(axislayoutitem);

            axisnode.AddChildren(nodes);
            var nodestoremove = new List <Hierarchy <LayoutItem> >();

            axisnode.All().ForEach(i => {
                i.Item.SetTyped();
                if (i.Item.Category == LayoutItemCategory.Filter)
                {
                    var parent = i.Parent;
                    if (parent != null)
                    {
                        parent.Item.Role     = i.Item.Role;
                        parent.Item.RoleAxis = i.Item.RoleAxis;
                        nodestoremove.Add(i);
                    }
                }
            });
            foreach (var n in nodestoremove)
            {
                n.Parent.Remove(n);
            }
            return(axisnode);
        }
Beispiel #2
0
        public static Hierarchy <LayoutItem> GetExtensions3(Hierarchy <LayoutItem> axisnode, Table table)
        {
            if (table.ID.Contains("09.04"))
            {
            }
            var extensions = new Hierarchy <LayoutItem>(table.GetRootExtension());
            //Getting the layout nodes
            var nodes = axisnode.All().Where(i => i.Item.IsLayout).ToList();

            //ensuring typed
            foreach (var node in nodes)
            {
                node.Item.SetTyped();
            }

            //Getting typed nodes
            var typednodes = nodes.Where(i => i.Item.Dimensions.Count == 1 && i.Item.Dimensions.FirstOrDefault().IsTyped).ToList();
            //Getting non typed ndoes
            var nontypednodes = nodes.Except(typednodes);


            //Set the aspect nodes
            var aspectnodes = axisnode.Where(i => i.Item.Category == LayoutItemCategory.Aspect).ToList();

            foreach (var aspectnode in aspectnodes)
            {
                aspectnode.Item.Category = LayoutItemCategory.Dynamic;
            }
            var leafs = axisnode.GetLeafs();

            foreach (var leaf in leafs)
            {
                SetDimensions(leaf);
            }
            extensions.AddChildren(leafs);
            //Fixing the labels
            if (table.ID.Contains("eba_tC_67.00.w"))
            {
            }
            FixLabels(extensions);

            return(extensions);
        }