| | |
| | | Control.SendWriteCommand(curtain, d); |
| | | }; |
| | | |
| | | DateTime delayTime = DateTime.MinValue; |
| | | |
| | | btnMinusSignIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | delayTime = DateTime.MinValue; |
| | | curtain.percent--; |
| | | controlBar.Progress = curtain.percent; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add("percent", curtain.percent.ToString()); |
| | | Control.SendWriteCommand(curtain, d); |
| | | //Control.Send(CommandType_A.write, curtain); |
| | | }; |
| | | |
| | | btnPlusSgnIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | delayTime = DateTime.MinValue; |
| | | curtain.percent++; |
| | | controlBar.Progress = curtain.percent; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | |
| | | Control.SendWriteCommand(curtain, d); |
| | | }; |
| | | |
| | | curtainSeekBar.OnProgressChangedEvent = (sender, e) => |
| | | //curtainSeekBar.OnProgressChangedEvent = (sender, e) => |
| | | //{ |
| | | // controlBar.Progress = curtainSeekBar.Progress; |
| | | // new System.Threading.Thread(() => |
| | | // { |
| | | // if (controlBar.Progress == 0 || controlBar.Progress == 100 || (DateTime.Now - curtain.refreshTime).TotalMilliseconds > 300) |
| | | // { |
| | | // curtain.percent = e; |
| | | // curtain.refreshTime = DateTime.Now; |
| | | // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | // d.Add("percent", curtain.percent.ToString()); |
| | | // Control.SendWriteCommand(curtain, d); |
| | | // } |
| | | // }) |
| | | // { IsBackground = true }.Start(); |
| | | //}; |
| | | curtainSeekBar.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | | controlBar.Progress = curtainSeekBar.Progress; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | if ((DateTime.Now - delayTime).TotalMilliseconds > 300) |
| | | { |
| | | delayTime = DateTime.Now; |
| | | curtain.percent = e; |
| | | curtain.refreshTime = DateTime.Now; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add("percent", curtain.percent.ToString()); |
| | | Control.SendWriteCommand(curtain, d); |
| | | } |
| | | curtain.percent = e; |
| | | curtain.refreshTime = DateTime.Now; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add("percent", curtain.percent.ToString()); |
| | | Control.SendWriteCommand(curtain, d); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | |
| | | controlBar.OnProgressChangedEvent = (sender, e) => |
| | | //controlBar.OnProgressChangedEvent = (sender, e) => |
| | | //{ |
| | | // curtainSeekBar.Progress = controlBar.Progress; |
| | | // new System.Threading.Thread(() => |
| | | // { |
| | | // if (controlBar.Progress == 0 || controlBar.Progress == 100 || (DateTime.Now - curtain.refreshTime).TotalMilliseconds > 300) |
| | | // { |
| | | // curtain.percent = e; |
| | | // curtain.refreshTime = DateTime.Now; |
| | | // System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | // d.Add("percent", curtain.percent.ToString()); |
| | | // Control.SendWriteCommand(curtain, d); |
| | | // } |
| | | // }) |
| | | // { IsBackground = true }.Start(); |
| | | //}; |
| | | |
| | | controlBar.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | | curtainSeekBar.Progress = controlBar.Progress; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | MainPage.Log(delayTime.ToLongTimeString()); |
| | | if ((DateTime.Now - delayTime).TotalMilliseconds > 300) |
| | | { |
| | | delayTime = DateTime.Now; |
| | | curtain.percent = e; |
| | | curtain.refreshTime = DateTime.Now; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add("percent", curtain.percent.ToString()); |
| | | Control.SendWriteCommand(curtain, d); |
| | | } |
| | | curtain.percent = e; |
| | | curtain.refreshTime = DateTime.Now; |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add("percent", curtain.percent.ToString()); |
| | | Control.SendWriteCommand(curtain, d); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |