private void arrangeColumns() { // cleanup this.Columns = new ArrayList(); foreach (CalendarDayEventView e in events) { e.Column = null; } // there always will be at least one column because arrangeColumns is called only from Add() createColumn(); foreach (CalendarDayEventView e in events) { foreach (BlockColumn col in Columns) { if (col.CanAdd(e)) { col.Add(e); break; } } // it wasn't placed if (e.Column == null) { BlockColumn col = createColumn(); col.Add(e); } } }
private BlockColumn createColumn() { BlockColumn col = new BlockColumn(); this.Columns.Add(col); col.Block = this; return(col); }