/// <summary> /// 添加走马灯 /// </summary> /// <param name="server">服务器</param> /// <param name="content">走马灯内容</param> /// <param name="interval">间隔时间</param> /// <returns>走马灯数据</returns> public static RevolvingData AddRevolving(Server server, string content, int interval) { List <RevolvingData> list; lock (RevolvingManager.revolvingDictionary) { if (!RevolvingManager.revolvingDictionary.TryGetValue(server, out list)) { RevolvingManager.revolvingDictionary.Add(server, list = new List <RevolvingData>()); } } RevolvingData data = new RevolvingData(content, interval); list.Add(data); return(data); }
/// <summary> /// 添加走马灯按钮点击响应 /// </summary> protected void addRevolvingButton_Click(object sender, EventArgs e) { if (this.revolvingTextBox.Text == "") { return; } int second; if (!int.TryParse(this.intervalTextBox.Text, out second) || second <= 0) { return; } RevolvingData data = RevolvingManager.AddRevolving(Session["Server"] as Server, this.revolvingTextBox.Text, second); RevolvingManager.Save(); RevolvingManager.UpdateService(); this.revolvingListBox.Items.Add(data.ToString()); }