Ejemplo n.º 1
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="source"></param>
 /// <param name="e"></param>
 public void ReceiveCrossPluginData(object source, CrossPluginEventArgs e)
 {
     if (e.TargetDock == this.cfg.Location && this.userControl != null)
     {
         object[] args = e.Args;
         if (args != null && args.Length > 0)
         {
             bool start = false;
             if ((args[0].ToString() == "load") && (Boolean.TryParse(args[1].ToString(), out start)))
             {
                 StartClassInfo sci = args[2] as StartClassInfo;
                 if (sci != null && start)
                 {
                     //开始上课。
                     if (sci.ClassInfo != null)
                     {
                         (this.hostNetService = this.initHostNetService(sci)).Start();
                         this.userControl.GradeID = sci.GradeID;
                         this.userControl.ClassID = sci.ClassInfo.ClassID;
                         this.userControl.CatalogID = sci.CatalogInfo.CatalogID;
                         this.userControl.Start(Program.STUDENTS);
                     }
                 }
                 else
                 {
                     //结束上课。
                     this.disposeHostNetService();
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="service"></param>
 /// <param name="panelWork"></param>
 public IssueWorkHelpers(ICoreService service, Panel panelWork)
 {
     this.panelWork = panelWork;
     this.netService = HostNetService.Instance(service);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 获取对象实例。
 /// </summary>
 public static HostNetService Instance(ICoreService service)
 {
     lock (typeof(HostNetService))
     {
         StartClassInfo sci = service["startclassinfo"] as StartClassInfo;
         if (sci == null) return null;
         HostNetService hns = cache[sci] as HostNetService;
         if (hns == null)
         {
             hns = new HostNetService(service, sci);
             if (hns != null) cache[sci] = hns;
         }
         return hns;
     }
 }