Exemplo n.º 1
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="source"></param>
 /// <param name="e"></param>
 public void ReceiveCrossPluginData(object source, CrossPluginEventArgs e)
 {
     if (e != null && e.TargetDock == this.cfg.Location)
     {
         object[] args = e.Args;
         if (args != null && args.Length > 0)
         {
             switch (args[0].ToString())
             {
                 case "reload":
                     bool result = false;
                     if (Boolean.TryParse(args[1].ToString(), out result))
                     {
                         if (result)
                         {
                             this.userControl.LoadData();
                         }
                     }
                     break;
             }
         }
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="e"></param>
 protected void OnCrossPluginSend(CrossPluginEventArgs e)
 {
     CrossPluginHandler handler = this.CrossPluginSendEvent;
     if (handler != null && e != null)
         handler(this, e);
 }
Exemplo n.º 3
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="source"></param>
 /// <param name="e"></param>
 public void ReceiveCrossPluginData(object source, CrossPluginEventArgs e)
 {
     try
     {
         if ((e.TargetDock == this.cfg.Location) &&
             (e.Args != null && e.Args.Length > 1))
         {
             if (e.Args[0].ToString() == "syncdata" && this.userControl != null)
             {
                 this.userControl.Enabled = bool.Parse(e.Args[1].ToString());
             }
         }
     }
     catch (Exception) { }
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="source"></param>
 /// <param name="e"></param>
 public void ReceiveCrossPluginData(object source, CrossPluginEventArgs e)
 {
 }
Exemplo n.º 5
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="source"></param>
 /// <param name="e"></param>
 public void ReceiveCrossPluginData(object source, CrossPluginEventArgs e)
 {
     if (this.cfg != null && this.cfg.Location == e.TargetDock && e.Args != null && e.Args.Length > 1)
     {
         object[] args = e.Args;
         if (args[0].ToString() == "msg" && this.userControl != null)
         {
             string strMsg = args[1].ToString();
             if (!string.IsNullOrEmpty(strMsg))
             {
                 this.userControl.ThreadSafeMethod(new MethodInvoker(delegate()
                 {
                     this.userControl.ShowMessage(strMsg);
                 }));
             }
         }
     }
 }
Exemplo n.º 6
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();
                 }
             }
         }
     }
 }
 /// <summary>
 /// 跨插件发送数据。
 /// </summary>
 /// <param name="source"></param>
 /// <param name="e"></param>
 public void SendCrossPluginData(object source, CrossPluginEventArgs e)
 {
     if (this.bootstrapPlugins != null && e != null)
     {
         if (source == null)
         {
             source = this;
         }
         this.bootstrapPlugins.SendCrossPluginData(source, e);
     }
 }