private void playerTimer_Elapsed(object sender, ElapsedEventArgs e) { CourseTimer ct = sender as CourseTimer; Draw(ct.GroupName, dicCurrent[ct.GroupName], dicForceRefresh[ct.GroupName], dicDS[ct.GroupName]); dicCurrent[ct.GroupName] = dicCurrent[ct.GroupName] + 1; }
//public void SendDraw(string drawObject, string sessionId, string groupName, string name) //{ // Clients.Group(groupName).HandleDraw(drawObject, sessionId, name); //} //public void SendDraw(string groupName, string x, string y, string drawtype) //{ // //Clients.Group(groupName).broadcastDraw(x, y, drawtype); // // exclude self // Clients.Others.broadcastDraw(x, y, drawtype); //} public void Play(string group, string second) { int currenttime = Convert.ToInt32(second); //Draw(group, 7070, true, new COLDataSource()); CourseTimer playerTimer = new CourseTimer(group); playerTimer.Elapsed += playerTimer_Elapsed; playerTimer.Interval = 1000; // Timer will tick every 1 seconds playerTimer.Enabled = true; // Enable the timer playerTimer.Start(); if (!dicTimer.ContainsKey(group)) { dicTimer.Add(group, playerTimer); dicCurrent.Add(group, currenttime); dicForceRefresh.Add(group, false); dicDS.Add(group, new COLDataSource()); } }