Exemplo n.º 1
0
        public void CalcCellBandMap(MyTreeListBand Band)
        {
            Source = new BandMapCell[Band.Width, Band.GetDepth()];
            for (int i = 0; i < Band.Width; i++)
            {
                if (Band.Columns[i] != null)
                {
                    Source[i, 0] = new BandMapCell(Band.Columns[i], true, true);
                }
            }
            foreach (MyTreeListBand Child in Band.Children)
            {
                FillCellSource(Child, Child.Position, 0);
            }
            int EmptyLevelCount = 0;

            for (int i = LevelCount - 1; i >= 0; i--)
            {
                bool EmptyLevel = true;
                for (int j = 0; j < ColCount; j++)
                {
                    if (Source[j, i] != null)
                    {
                        EmptyLevel = false;
                        break;
                    }
                }
                if (EmptyLevel)
                {
                    EmptyLevelCount++;
                }
                else
                {
                    break;
                }
            }
            if (EmptyLevelCount > 0)
            {
                int NewLevelCount = LevelCount - EmptyLevelCount;
                BandMapCell[,] Temp = new BandMapCell[ColCount, NewLevelCount];
                for (int i = 0; i < ColCount; i++)
                {
                    for (int j = 0; j < NewLevelCount; j++)
                    {
                        Temp[i, j] = Source[i, j];
                    }
                }
                Source = Temp;
            }
        }
Exemplo n.º 2
0
 public void CalcBandMap(MyTreeListBand Band)
 {
     Source = new BandMapCell[Band.Width, Band.GetDepth()];
     for (int i = 0; i < Band.Width; i++)
     {
         if (Band.Columns[i] != null)
         {
             Source[i, 0] = new BandMapCell(Band.Columns[i], true, true);
         }
     }
     foreach (MyTreeListBand Child in Band.Children)
     {
         FillSource(Child, Child.Position, 0);
     }
 }
Exemplo n.º 3
0
        protected void FillSource(MyTreeListBand Band, int Offset, int Level)
        {
            object CellObj = (Band.BandColumn == null) ? (object)Band : (object)Band.BandColumn;

            for (int i = 0; i < Band.Width; i++)
            {
                Source[Offset + i, Level] = new BandMapCell(CellObj, i == 0, i == (Band.Width - 1));
                if (Band.Columns[i] != null)
                {
                    Source[Offset + i, Level + 1] = new BandMapCell(Band.Columns[i], true, true);
                }
            }
            foreach (MyTreeListBand Child in Band.Children)
            {
                FillSource(Child, Offset + Child.Position, Level + 1);
            }
        }
Exemplo n.º 4
0
        private void FillCellSource(MyTreeListBand Band, int Offset, int Level)
        {
            int NewLevel = (Band.BandColumn == null) ? Level : Level + 1;

            for (int i = 0; i < Band.Width; i++)
            {
                if (Band.BandColumn != null)
                {
                    Source[Offset + i, Level] = new BandMapCell(Band.BandColumn, i == 0, i == (Band.Width - 1));
                }
                if (Band.Columns[i] != null)
                {
                    Source[Offset + i, NewLevel] = new BandMapCell(Band.Columns[i], true, true);
                }
            }
            foreach (MyTreeListBand Child in Band.Children)
            {
                FillCellSource(Child, Offset + Child.Position, NewLevel);
            }
        }