Example #1
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);
                    }
                }
            }
        }
Example #2
0
        private void miAddFile_Click(object sender, RoutedEventArgs e)
        {
            LoadLog ll = new LoadLog();

            if (!ll.AddFiles())
            {
                MessageBox.Show("ファイル読み込みに失敗しました。", "通知");
                return;
            }
            if (ll.ContestLog == null)
            {
                return;
            }
            foreach (var ld in ll.ContestLog)
            {
                AddLog(ld);
            }

            UpdateData();
        }