Exemplo n.º 1
0
Arquivo: Editor.cs Projeto: zoi/YAMP
 private void LoadChannels(string FileName)
 {
     chRead = new ChannelReader(FileName);
     channelList.Items.Clear();
     foreach (string i in chRead.Names)
         channelList.Items.Add(i);
     urlList.Items.Clear();
     foreach (string i in chRead.Links)
         urlList.Items.Add(i);
 }
Exemplo n.º 2
0
Arquivo: Form1.cs Projeto: zoi/YAMP
 private void button2_Click(object sender, EventArgs e)
 {
     Editor e1 = new Editor(strFile);
     if (e1.ShowDialog() == DialogResult.OK)
     {
         chRead = null;
         chRead = new ChannelReader(strFile);
         loadChannelList();
     }
 }
Exemplo n.º 3
0
Arquivo: Form1.cs Projeto: zoi/YAMP
        private Boolean InitStreams(Boolean choose)
        {
            if (choose)
            {
                OpenFileDialog openF = new OpenFileDialog();
                openF.Filter = "Splain Stream File|*.splain";
                if (openF.ShowDialog() == DialogResult.OK)
                {
                    strFile = openF.FileName;
                }
            }

            chRead = new ChannelReader(strFile);
            if (chRead.Size <= 0)
            {
                return false;
            }
            else
            {
                return true;
            }
        }
Exemplo n.º 4
0
Arquivo: Editor.cs Projeto: zoi/YAMP
        private void saveButton_Click(object sender, EventArgs e)
        {
            if((urlBox.Text.Length>8)&&(channelBox.Text.Length>0))
            {
                if (edit_index > 0)
                {

                    channelList.Items[edit_index] = channelBox.Text;
                    urlList.Items[edit_index] = urlBox.Text;
                    SaveAllChannels();
                }
                else
                {
                    StreamWriter SWriter = File.AppendText(chRead.StreamFile);
                    SWriter.WriteLine(channelBox.Text);
                    SWriter.WriteLine(urlBox.Text);
                    //SWriter.WriteLine();
                    SWriter.Close();
                }
            }
            MessageBox.Show("Channels Saved");
            chRead = null;
            LoadChannels(file);
        }