예제 #1
0
        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];
        }
예제 #2
0
 public void SetMockTV(MockTV tv)
 {
     TV = tv;
     TV.PropertyChanged += NewTVOnPropertyChanged;
     TVInfo.DataContext = TV;
     _singalDispatcher = DispatcherFactory.GetDispatcher(tv);
 }
예제 #3
0
        /// <summary>
        /// 添加电视
        /// </summary>
        /// <param name="tv">电视信息</param>
        public void AddTV(MockTV tv)
        {
            if (MockTVs.Any(mockTV => mockTV.Sn.Equals(tv.Sn)))
            {
                return;
            }

            MockTVs.Add(tv);
        }
예제 #4
0
 public SignalReceiver(MockTV tv)
 {
     _tv = tv;
 }
예제 #5
0
 public MockTVSelectedEventArgs(MockTV tv)
 {
     TV = tv;
 }
예제 #6
0
 public TVFoundEventArgs(MockTV tv)
 {
     TV = tv;
 }