Example #1
0
        private void arrangeColumns()
        {
            // cleanup
            this.Columns = new ArrayList();

            foreach (Event e in events)
            {
                e.Column = null;
            }

            // there always will be at least one column because arrangeColumns is called only from Add()
            createColumn();

            foreach (Event e in events)
            {
                foreach (Column col in Columns)
                {
                    if (col.CanAdd(e))
                    {
                        col.Add(e);
                        break;
                    }
                }
                // it wasn't placed
                if (e.Column == null)
                {
                    Column col = createColumn();
                    col.Add(e);
                }
            }
        }
Example #2
0
        private void arrangeColumns()
        {
            // cleanup
            this.Columns = new List <Column>();

            foreach (Event e in events)
            {
                e.Column = null;
            }

            // there always will be at least one column because arrangeColumns is called only from Add()
            createColumn();

            foreach (Event e in events)
            {
                foreach (Column col in Columns)
                {
                    if (col.CanAdd(e))
                    {
                        col.Add(e);
                        break;
                    }
                }
                // Невозможно вставить в column(row), тогда создается новая Column(row) и добавляется бар(Event)
                if (e.Column == null)
                {
                    Column col = createColumn();
                    col.Add(e);
                }
            }
        }