Exemplo n.º 1
0
        private void btLoadSetting_Click(object sender, RoutedEventArgs e)
        {
            var ld = ConfTab.SetSetting();

            if (ld == null)
            {
                return;
            }
            Work.Config = ld;
            SetNowIntersets();
            UpdateData();
        }
Exemplo n.º 2
0
        private void Window_Drop(object sender, DragEventArgs e)
        {
            string[] files = e.Data.GetData(DataFormats.FileDrop) as string[];
            if (files != null)
            {
                foreach (var f in files)
                {
                    if (f.Substring(f.Length - 7) == "set.xml")
                    {
                        ConfTab.SetSetting(f);
                        break;
                    }
                    else if (f.Substring(f.Length - 3) == "lg8" || f.Substring(f.Length - 3) == "txt" || f.Substring(f.Length - 3) == "TXT")
                    {
                        LoadLog ll = new LoadLog();
                        if (!ll.AddFile(f))
                        {
                            MessageBox.Show("ファイル読み込みに失敗しました。", "通知");
                            return;
                        }
                        if (ll.ContestLog == null)
                        {
                            return;
                        }
                        if (Work.Log == null)
                        {
                            Work.Log = new ObservableCollection <LogData>();
                        }
                        foreach (var ld in ll.ContestLog)
                        {
                            AddLog(ld);
                        }

                        UpdateData();
                    }
                    else if (f.Substring(f.Length - 8) == "work.xml")
                    {
                        LoadWork(f);
                    }
                }
            }
        }