Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace timer
- {
- class Program
- {
- static Planner planner;
- static void Main(string[] args)
- {
- planner = Planner.Initializations();
- planner.AddNews();
- Console.ReadLine();
- }
- }
- }
- class Planner
- {
- protected Planner() { }
- private static Planner _planner;
- private List<System.Windows.Forms.Timer> _timer = new List<System.Windows.Forms.Timer>();
- private Thread thread;
- //private ConsoleColor _color = ConsoleColor.Magenta;
- public static Planner Initializations()
- {
- if (_planner != null)
- return _planner;
- else
- {
- _planner = new Planner();
- return _planner;
- }
- }
- public void Run()
- {
- }
- public void Cloce()
- {
- }
- public void ShowList()
- {
- }
- public void AddNews(/*DateTime time, string link, params int[] array*/)
- {
- int _second = /*(int)((long)time.Ticks - (long)DateTime.Now.Ticks) / 100000;*/ 5000;
- var timer = new System.Windows.Forms.Timer();
- timer.Tick += Timer_Tick;
- timer.Interval = _second;
- timer.Enabled = true;
- Application.DoEvents();
- timer.Start();
- _timer.Add(timer);
- }
- private void Timer_Tick(object sender, EventArgs e)
- {
- Console.Beep();
- Console.WriteLine("hello world");
- }
- public void DeleteNews(int index)
- {
- }
- public void ReplaceTime(int index, DateTime _news)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement