Example #1
0
        internal static string GetOpenAspectHeaderLabel(Xbrl.Table.Layout.Axis axis, Xbrl.Table.AspectNode openAspectNode, int row)
        {
            string openAspectLabel = GetLabel(openAspectNode, false);

            if (openAspectLabel == null)
            {
                // Use breakdown label if the aspect node is the only child
                var breakdown = axis.GetDefinitionBreakdown((uint)row);
                if (breakdown != null && breakdown.TreeRelationships.Count == 1)
                {
                    openAspectLabel = GetLabel(breakdown, false);
                }
            }
            if (openAspectLabel == null)
            {
                var aspect = openAspectNode.ParticipatingAspects.FirstOrDefault();
                if (aspect != null)
                {
                    openAspectLabel = GetLabel(aspect.Dimension, true);
                }
            }
            // Fallback to the id
            if (openAspectLabel == null)
            {
                openAspectLabel = openAspectNode.Id;
            }
            return(openAspectLabel);
        }
Example #2
0
        internal static string GetHeaderLabel(Xbrl.Table.Layout.Axis axis, Xbrl.Table.Layout.AxisHeader header, int row)
        {
            string label = GetLabel(header, false);

            if (label == null)
            {
                label = GetLabel(axis.GetDefinitionBreakdown((uint)row), false);
            }
            return(label);
        }
Example #3
0
        internal static string GetOpenAspectRCCode(Xbrl.Table.Layout.Axis axis, Xbrl.Table.AspectNode openAspectNode, int row)
        {
            string openAspectRC = GetRCCode(openAspectNode);

            if (openAspectRC == null)
            {
                openAspectRC = GetRCCode(axis.GetDefinitionBreakdown((uint)row));
            }
            return(openAspectRC);
        }
Example #4
0
        internal static Xbrl.Table.Layout.AxisHeader GetAxisHeader(Xbrl.Table.Layout.Axis axis, int slice)
        {
            uint i = 0;

            Xbrl.Table.Layout.AxisHeader axisHeader;
            do
            {
                ++i;
                axisHeader = axis.GetHeader((uint)slice, axis.Shape.Y - i);
            }while (axisHeader != null && axisHeader.DefinitionNode is Xbrl.Table.AspectNode);
            return(axisHeader);
        }
Example #5
0
 static internal bool HasOpenAspectNodes(Xbrl.Table.Layout.Axis axis)
 {
     return(axis.GetSlice(0).Any(header => header.DefinitionNode is Xbrl.Table.AspectNode));
 }