Exemplo n.º 1
0
 // Token: 0x06001B93 RID: 7059 RVA: 0x0009DD34 File Offset: 0x0009BF34
 protected virtual void MapVisualsX()
 {
     for (int i = 0; i < this.visualContainer.Count; i++)
     {
         EventAreaVisual eventAreaVisual = (EventAreaVisual)this.visualContainer[i];
         eventAreaVisual.Rect.Width = 0.0;
         ExDateTime  startTime  = this.dataSource.GetStartTime(eventAreaVisual.DataIndex);
         ExDateTime  endTime    = this.dataSource.GetEndTime(eventAreaVisual.DataIndex);
         DateRange[] dateRanges = this.parentView.DateRanges;
         for (int j = 0; j < this.parentView.DayCount; j++)
         {
             if (dateRanges[j].Intersects(startTime, endTime))
             {
                 eventAreaVisual.Rect.Width += 1.0;
                 if (eventAreaVisual.Rect.Width == 1.0)
                 {
                     if (startTime < dateRanges[j].Start.Date)
                     {
                         eventAreaVisual.LeftBreak = true;
                     }
                     eventAreaVisual.Rect.X = (double)j;
                 }
                 else if (eventAreaVisual.Rect.Width > 1.0 && dateRanges[j - 1].Start.Date.IncrementDays(1) != dateRanges[j].Start.Date)
                 {
                     eventAreaVisual.SetInnerBreak((int)((double)j - eventAreaVisual.Rect.X));
                 }
             }
         }
         if (eventAreaVisual.Rect.Width != 0.0)
         {
             int num = (int)(eventAreaVisual.Rect.X + eventAreaVisual.Rect.Width - 1.0);
             if (dateRanges[num].End.Date < endTime)
             {
                 eventAreaVisual.RightBreak = true;
             }
         }
     }
 }
Exemplo n.º 2
0
 // Token: 0x06001B94 RID: 7060 RVA: 0x0009DF0C File Offset: 0x0009C10C
 private void MapVisualsY()
 {
     if (this.visualContainer.Count == 1)
     {
         EventAreaVisual eventAreaVisual = (EventAreaVisual)this.visualContainer[0];
         eventAreaVisual.Rect.Y = 0.0;
     }
     this.visualContainer.SortVisuals(this.comparer);
     this.matrix = new EventAreaVisualMapper.EventAreaMatrix(this.parentView.DayCount);
     for (int i = 0; i < this.visualContainer.Count; i++)
     {
         EventAreaVisual eventAreaVisual2 = (EventAreaVisual)this.visualContainer[i];
         int             j;
         for (j = 0; j < this.matrix.RowCount; j++)
         {
             if (this.matrix.FitsInRow(j, eventAreaVisual2.Rect))
             {
                 this.matrix.AddToRow(j, eventAreaVisual2.Rect);
                 eventAreaVisual2.Rect.Y = (double)j;
                 break;
             }
         }
         if (j == this.matrix.RowCount)
         {
             if (this.RowCount >= this.parentView.MaxEventAreaRows)
             {
                 this.parentView.RemoveItemFromView(eventAreaVisual2.DataIndex);
             }
             else
             {
                 this.matrix.AddRow();
                 this.matrix.AddToRow(this.matrix.RowCount - 1, eventAreaVisual2.Rect);
                 eventAreaVisual2.Rect.Y = (double)(this.matrix.RowCount - 1);
             }
         }
     }
 }