コード例 #1
0
 /// <summary>
 /// 初始化服务
 /// </summary>
 /// <param name="setting"></param>
 public void InitService(ZSTSettings setting)
 {
     if (!_Services.ContainsKey(typeof(ZSTSettings)))
     {
         ZSTService s = new ZSTService(setting as ZSTSettings);
         s.OnReadCard += new EventHandler <OpenCardEventArgs>(s_OnReadCard);
         s.OnPaying   += new EventHandler <OpenCardEventArgs>(s_OnPaying);
         s.OnPaidOk   += new EventHandler <OpenCardEventArgs>(s_OnPaidOk);
         s.OnPaidFail += new EventHandler <OpenCardEventArgs>(s_OnPaidFail);
         s.OnError    += new EventHandler <OpenCardEventArgs>(s_OnError);
         s.Init();
         _Services[typeof(ZSTSettings)] = s;
     }
     else
     {
         ZSTService s = _Services[typeof(ZSTSettings)] as ZSTService;
         s.Setting = setting as ZSTSettings;
     }
 }
コード例 #2
0
 public ZSTService(ZSTSettings setting)
 {
     Setting = setting;
 }