Example #1
0
File: Editor.cs Project: 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);
 }
Example #2
0
File: Form1.cs Project: 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();
     }
 }
Example #3
0
File: Form1.cs Project: 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;
            }
        }
Example #4
0
File: Editor.cs Project: 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);
        }