Exemplo n.º 1
0
 /// <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;
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
        private void OpenDefaultAVGS()
        {
            myStory = storyReader.GetWholeStory();

            EnabledGroupBoxes(true);
            tsTextStatus.ForeColor = Color.Green;
            tsTextStatus.Text = "�Ѽ���Ĭ��AVGS";
            RefreshIndex();
            tbLength.Text = myStory.LineNumber.ToString();
        }
Exemplo n.º 4
0
        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();
        }
Exemplo n.º 5
0
        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();
        }