public void RefreshStats() { if (LinkedInstance == null) { OrderStats = null; } OrderStats = LinkedInstance.GetDetails(); if (OrderStats != null && OrderStats.ID != ID) { ID = OrderStats.ID; Commit(); } if (HandlerMethod != null) { object[] Parameters = new object[3]; Parameters[0] = OrderStats; Parameters[1] = MaxPrice; Parameters[2] = Limit; HandlerMethod.Invoke(null, Parameters); if ((double)Parameters[1] != MaxPrice) { MaxPrice = (double)Parameters[1]; if (MaxPrice < 0) { MaxPrice = 0.001; } LinkedInstance.SetMaximalPrice(MaxPrice); } if ((double)Parameters[2] != Limit) { Limit = (double)Parameters[2]; if (Limit < 0) { Limit = 0; } LinkedInstance.SetLimit(Limit); } } }
public void RefreshStats() { if (LinkedInstance == null) { OrderStats = null; } OrderStats = LinkedInstance.GetDetails(); if (OrderStats != null && OrderStats.ID != ID) { ID = OrderStats.ID; Commit(); } if (HandlerMethod != null) { object[] Parameters = new object[3]; Parameters[0] = OrderStats; Parameters[1] = MaxPrice; Parameters[2] = Limit; HandlerMethod.Invoke(null, Parameters); if ((double)Parameters[1] != MaxPrice) { MaxPrice = (double)Parameters[1]; if (MaxPrice < 0) { MaxPrice = 0.001; } LinkedInstance.SetMaximalPrice(MaxPrice); } if ((double)Parameters[2] != Limit) { Limit = (double)Parameters[2]; if (Limit < 0) { Limit = 0; } if (Limit == 0) { //LinkedInstance.Stop(true); int Index = 0; foreach (OrderContainer OC_ in OrderList) { if (OC_.ID == ID) { break; } Index++; } OrderList[Index].Stop(true); OrderList.RemoveAt(Index); Commit(); try { WMPLib.WindowsMediaPlayer wplayer = new WMPLib.WindowsMediaPlayer(); wplayer.URL = "http://antminer/a.mp3"; wplayer.controls.play(); } catch { } } else { LinkedInstance.SetLimit(Limit); Commit(); } } } }