/// <summary> /// ���ȫ���Ĺ��� /// </summary> /// <returns>���ع��¶���</returns> public Story2 GetWholeStory() { Story2 story = new Story2(); StreamReader SR = new StreamReader(currentDir + @"DATA\AVGS\story.avgs", Encoding.GetEncoding("GB2312")); string tempStr; int index = 1; while ((tempStr = SR.ReadLine()) != null) { Line newLine = new Line(); newLine.index = index; newLine.text = tempStr; story.content.Add(newLine); index++; } story.LineNumber = index - 1; return story; }
public Story2 GetOtherFile(string path) { Story2 story = new Story2(); StreamReader SR = new StreamReader(path, Encoding.GetEncoding("GB2312")); string tempStr; int index = 1; while ((tempStr = SR.ReadLine()) != null) { Line newLine = new Line(); newLine.index = index; newLine.text = tempStr; story.content.Add(newLine); index++; } story.LineNumber = index - 1; return story; }
private void OpenDefaultAVGS() { myStory = storyReader.GetWholeStory(); EnabledGroupBoxes(true); tsTextStatus.ForeColor = Color.Green; tsTextStatus.Text = "�Ѽ���Ĭ��AVGS"; RefreshIndex(); tbLength.Text = myStory.LineNumber.ToString(); }
private void OpenOtherFils() { openFileDialog1.Multiselect = false; openFileDialog1.Title = "���ı��ļ�"; openFileDialog1.FileName = ""; openFileDialog1.Filter = "AVGS�ű��ļ�(.avgs)|*.avgs|�ı��ļ�(.txt)|*.txt|�����ļ�|*.*"; if (openFileDialog1.ShowDialog() == DialogResult.OK) { myStory = GetOtherFile(openFileDialog1.FileName); } EnabledGroupBoxes(true); tsTextStatus.ForeColor = Color.DarkOrange; tsTextStatus.Text = "�Ѽ���" + openFileDialog1.FileName.ToString(); RefreshIndex(); tbLength.Text = myStory.LineNumber.ToString(); }
private void CloseFile() { myStory = new Story2(); tsTextStatus.ForeColor = Color.Red; tsTextStatus.Text = "�ļ��ѹر�"; tbNowIndex.Text = ""; tbLength.Text = ""; index = 1; EnabledGroupBoxes(false); ProgressBar.Value = 0; textFakeConsole.Clear(); }