示例#1
0
 public bool OptionFix(TimeElement te)
 {
     if (tt.CheckOverlap(te) == true)
     {
         return(false);
     }
     tt.Add(te);
     return(true);
 }
示例#2
0
        /// <summary>
        /// 선택한 과목을 테이블 뷰어에 추가한다.
        /// </summary>
        private void lvSearch_DoubleClick(object sender, EventArgs e)
        {
            if (lvSearch.SelectedItems.Count != 0)
            {
                TimeElement te = TimeParser.Get(lvSearch.SelectedItems[0].SubItems[8].Text);

                if (!tt.CheckOverlap(te))
                {
                    lvSearchAdd.Items.Add((ListViewItem)lvSearch.SelectedItems[0].Clone());
                    te.index = lvSearch.SelectedItems[0].SubItems[0].Text;
                    tt.Add(te);
                    view_table.Add(te);
                    Save();
                    DrawTimeTable(false);
                }
                else
                {
                    MessageBox.Show("이미 겹치는 항목이 존재합니다.", Version.Name, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
示例#3
0
 private void Iterate(int iter)
 {
     if (escape)
     {
         return;
     }
     if (subject_group.Count == iter)
     {
         StringBuilder builder = new StringBuilder();
         foreach (string s in stack)
         {
             builder.Append(s + '|');
         }
         result.Add(builder.ToString());
         if (result.Count >= maxPannelCount)
         {
             escape = true;
         }
         return;
     }
     for (int i = 0; i < subject_group[iter].Count; i++)
     {
         if (AccessTable.CheckOverlap(subject_group[iter][i]))
         {
             continue;
         }
         stack.Push(subject_group[iter][i].index);
         AccessTable.Add(subject_group[iter][i]);
         Iterate(iter + 1);
         stack.Pop();
         AccessTable.Del(subject_group[iter][i]);
         if (escape)
         {
             return;
         }
     }
 }