public static SingalDispatcherBase GetDispatcher(MockTV tv) { var key = string.Format("{0}-{1}", tv.Brand, tv.Model); if (!Dispatchers.ContainsKey(key)) { SingalDispatcherBase dispatcher; if (tv.Brand.Equals(Haier, StringComparison.CurrentCultureIgnoreCase)) { dispatcher = new HaierDispatcher(); } else if (tv.Brand.Equals(TCL, StringComparison.CurrentCultureIgnoreCase)) { dispatcher = new TCLDispatcher(); } else { LogUtil.Log.ErrorFormat("Unsupport brand:{0}", tv.Brand); return null; } var bindStr = SignalMap.GetBind(tv.Brand, tv.Model); if (string.IsNullOrWhiteSpace(bindStr)) { LogUtil.Log.ErrorFormat("Unsupport model:{0}", tv.Model); return null; } dispatcher.BuildClient(bindStr); Dispatchers.Add(key, dispatcher); } return Dispatchers[key]; }
public void SetMockTV(MockTV tv) { TV = tv; TV.PropertyChanged += NewTVOnPropertyChanged; TVInfo.DataContext = TV; _singalDispatcher = DispatcherFactory.GetDispatcher(tv); }
/// <summary> /// 添加电视 /// </summary> /// <param name="tv">电视信息</param> public void AddTV(MockTV tv) { if (MockTVs.Any(mockTV => mockTV.Sn.Equals(tv.Sn))) { return; } MockTVs.Add(tv); }
public SignalReceiver(MockTV tv) { _tv = tv; }
public MockTVSelectedEventArgs(MockTV tv) { TV = tv; }
public TVFoundEventArgs(MockTV tv) { TV = tv; }