public void Navigated(string fromEndpoint, object data) { if (fromEndpoint == "main") { DataFile file = (DataFile)data; root = new ClassGroup(); Gbox.GrootGroup = root; classList.ClassDatalist = file.ClassInfos; classList.UpDate(); } }
private void Small_Loaded(object sender, RoutedEventArgs e) { DataFile file = new DataFile("subjects.xml"); Gbox = new ClassGroupBoxControl(new ClassGroup()); //Gbox.GC(new ClassGroup()); //ClassInfoList lst = file.LoadClassInfo(); //Console.WriteLine(lst.Groups); //ClassGroup gone = new ClassGroup(); //ClassGroup gtwo = new ClassGroup(); //ClassGroup group = new ClassGroup(); //foreach(ClassInfo i in lst.Groups["컴퓨터정보공학부"]) //{ // gone.AddGroup(new ClassInfoPlus(i)); //} //foreach (ClassInfo i in lst.Groups["자교"]) //{ // gtwo.AddGroup(new ClassInfoPlus(i)); //} //group.AddGroup(gone); //group.AddGroup(gtwo); //Gbox = new ClassGroupBoxControl(group); main.Children.Add(Gbox); Gbox.HorizontalAlignment = HorizontalAlignment.Stretch; Gbox.Margin = new Thickness(500, 0, 0, 0); //그룹 추가삭제 이벤트 Gbox.ChangeGroup += Gbox_ChangeGroup; //그룹 이름 수정 이벤트 Gbox.EditGroupName += Gbox_EditGroupName; //그룹 멤버 추가삭제 이벤트 Gbox.ChangeMember += Gbox_ChangeMember; ClassInfo info = new ClassInfo("객체지향패러다임", 0, new ClassTime(new ClassTimeItem(DayOfWeek.Monday, 1, 3)), "오재원", 3); DragSubject.Children.Add(new ClassInfoControl(info)); }
/// <summary> /// 새로운 db파일을 만든다. /// </summary> /// <param name="dbname">db파일의 이름</param> /// <param name="school">대상 학교</param> /// <param name="when">대상 시기</param> /// <param name="etc">기타 사항</param> /// <returns></returns> public DataFile CreateDataFile(string dbname, string school, string when, string etc = "") { string rpath = Path.Combine(FolderPath, dbname + ".xml"); if (File.Exists(rpath)) { throw new IOException("File \"" + rpath + "\" already exists."); } DataFile cur = new DataFile(rpath); cur.School = school; cur.When = when; cur.Etc = etc; cur.SaveClassInfo(new ClassInfoList(), ""); return(cur); }
private void Button_Click(object sender, RoutedEventArgs e) { DataFile file = new DataFile("subjects.xml"); var infos = file.LoadClassInfo(); ClassGroup root = new ClassGroup(); var group = new ClassGroup(); foreach (var i in infos.Groups["컴퓨터정보공학부"]) { group.AddGroup(new ClassInfoPlus(i, group)); } group.SelectCount = 1; root.AddGroup(group); BruteForceClassSelector algo = new BruteForceClassSelector(); var result = algo.Calculate(root); Debug.Write(result); }