public void Add(string url, string title) { RadioInfo temp = new RadioInfo(9 + 21 * (m_Counter % 3), 10 + 3 * (m_Counter / 3)); temp.UrlStream = url; temp.WepPegeAddress = "Bass"; int lastSymbol = url.LastIndexOf('/'); temp.Title = url.Substring(lastSymbol + 1); m_Radio.Add(temp); beautifulShow(m_Radio[m_Counter]); FileWrite(); m_Counter++; }
private void FileRead() { XmlDocument doc = new XmlDocument(); doc.Load(@"RadioList.xml"); m_Radio = new List <RadioInfo>(); int index = 0; foreach (XmlNode node in doc.SelectNodes("RadioStation/Radio")) { m_Counter++; RadioInfo temp_Radio = new RadioInfo(9 + 21 * (index % 3), 10 + 3 * (index / 3)); ArrayList temp = new ArrayList(); foreach (XmlNode child in node.ChildNodes) { if (String.Compare(child.Name, "title") == 0) { temp_Radio.Title = child.InnerText; } else if (String.Compare(child.Name, "urlStream") == 0) { temp_Radio.UrlStream = child.InnerText; temp_Radio.WepPegeAddress = child.InnerText; } else if (String.Compare(child.Name, "wepPageAddress") == 0) { temp_Radio.WepPegeAddress = child.InnerText; } else if (String.Compare(child.Name, "SearchTegs") == 0) { foreach (XmlNode teg in child.ChildNodes) { temp.Add(teg.InnerText); } } } temp_Radio.m_siporator = new string[temp.Count]; for (int i = 0; i < temp.Count; i++) { temp_Radio.m_siporator[i] = (string)temp[i]; } m_Radio.Add(temp_Radio); index++; } }
private void beautifulShow(RadioInfo ri) { int left = ri.Left; int top = ri.Top; ri.Left = 30; ri.Top = 45; ri.Show(); while (left != ri.Left) { GlobalMutex.GetMutex.WaitOne(); if (left < ri.Left) { Console.MoveBufferArea(ri.Left, ri.Top, ri.Width, ri.Height, --ri.Left, ri.Top); } else { Console.MoveBufferArea(ri.Left, ri.Top, ri.Width, ri.Height, ++ri.Left, ri.Top); } GlobalMutex.GetMutex.ReleaseMutex(); Thread.Sleep(15); } while (top != ri.Top) { GlobalMutex.GetMutex.WaitOne(); if (top < ri.Top) { Console.MoveBufferArea(ri.Left, ri.Top, ri.Width, ri.Height, ri.Left, --ri.Top); } else { Console.MoveBufferArea(ri.Left, ri.Top, ri.Width, ri.Height, ri.Left, ++ri.Top); } GlobalMutex.GetMutex.ReleaseMutex(); Thread.Sleep(15); } }