예제 #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;
            }
        }
예제 #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);
     }
 }