/// <summary> /// 构造函数。 /// </summary> /// <param name="service"></param> /// <param name="info"></param> /// <param name="auto"></param> public SyncDataWindow(ICoreService service, UserInfo info, bool auto) : base(service) { this.userInfo = info; this.auto = auto; InitializeComponent(); }
/// <summary> /// 构造函数。 /// </summary> /// <param name="sci"></param> /// <param name="userInfo"></param> /// <param name="ports"></param> public HostListenService(StartClassInfo sci,UserInfo userInfo, PortSettings ports) { this.sci = sci; this.userInfo = userInfo; this.ports = ports; this.udpSocket = new UDPSocket(this.ports.ClientCallback); this.udpSocket.Changed += this.RaiseChanged; this.udpSocket.DataArrival += new SocketDataArrivalEventHandler<Msg>(delegate(Msg sender) { try { Thread thread = new Thread(new ThreadStart(delegate() { this.ReceiveClientData(sender); })); thread.IsBackground = true; thread.Start(); } catch (Exception e) { UtilTools.OnExceptionRecord(e, typeof(UDPSocket)); } }); this.workUpTcpService = new WorkUpTcpService(this.ports.FileUpTransfer); this.workUpTcpService.Changed += this.RaiseChanged; this.workUpTcpService.DataArrival += new SocketDataArrivalEventHandler<FileMSG>(delegate(FileMSG sender) { this.ReceiveClientData(sender as UploadFileMSG); }); }
/// <summary> /// 构造函数。 /// </summary> /// <param name="service"></param> /// <param name="classID"></param> /// <param name="catalogID"></param> public ModifyWorkWindow(ICoreService service, string classID, string catalogID) : base(service) { this.classID = classID; this.catalogID = catalogID; this.userInfo = this.CoreService["userinfo"] as UserInfo; this.pluginService = new LoadingPluginService(service, this); this.InitializeComponent(); }
/// <summary> /// 构造函数。 /// </summary> private HostNetService(ICoreService service, StartClassInfo sci) { this.info = service["userinfo"] as UserInfo; this.ports = service["portsettings"] as PortSettings; this.hostAddress = service["hostaddress"] as HostAddress; //主机广播。 this.hostBroadcast = new HostBroadcastService(info); this.hostBroadcast.Changed += this.OnRaiseChanged; //主机侦听。 this.hostListenService = new HostListenService(this.sci = sci, this.info, this.ports); this.hostListenService.Changed += this.OnRaiseChanged; this.hostListenService.UpdateControls += this.OnUpdateControls; }
/// <summary> /// /// </summary> /// <param name="cfg"></param> /// <param name="info"></param> public void Init(PluginCfg cfg, UserInfo info) { this.cfg = cfg; this.info = info; }
/// <summary> /// /// </summary> /// <param name="cfg"></param> /// <param name="info"></param> public void Init(PluginCfg cfg, UserInfo info) { }
/// <summary> /// 构造函数。 /// </summary> /// <param name="service"></param> /// <param name="info"></param> public UCSyncSet(ICoreService service, UserInfo info) : base(service) { this.info = info; InitializeComponent(); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void StudentMainWindow_Load(object sender, EventArgs e) { this.CoreService.ForceQuit = false; //this.lbBroadcast.Text = string.Empty; this.sendTo.Create(); this.fileUploadObserver.UpdateFileUpload += this.DragFileObserver; this.listView.ListViewItemSorter = new ListViewIndexComparer(); this.listView.InsertionMark.Color = Color.Red; this.listView.AllowDrop = true; this.OnMessageEvent(MessageType.Normal, "【请勾选需要上传的作品】"); #region 用户信息。 StringBuilder info = new StringBuilder(); Student stu = this.CoreService["student"] as Student; if (stu != null) { UserInfo userInfo = new UserInfo(); userInfo.UserID = stu.StudentID; userInfo.UserCode = stu.StudentCode; userInfo.UserName = stu.StudentName; this.CoreService["userinfo"] = userInfo; info.AppendFormat("学生姓名:{0}[{1}]", stu.StudentName, stu.StudentCode); } Catalog c = this.CoreService["catalog"] as Catalog; if (c != null) { if (info.Length > 0) info.Append("\r\n"); info.AppendFormat("课程目录:{0}({1})", c.CatalogName, c.TypeName); this.OnToolTipEvent(this.lbUserinfo, string.Format("知识要点:\r\n{0}", Utilities.BuildKnowledgePointsToolTip(c.Points))); } if (info.Length > 0) info.Append("\r\n"); info.AppendFormat("教师主机:{0}", this.CoreService["host_ip"]); info.Append("\r\n"); info.AppendFormat("本机名称:{0}", Dns.GetHostName()); this.lbUserinfo.Text = info.ToString(); this.OnToolTipEvent(this.lbUserinfo, info.ToString()); #endregion this.btnUpload.Enabled = false; #region 插件初始化。 this.pluginService = new LoadingPluginService(this.CoreService, this); PluginCfgs plugins = this.CoreService["plugins"] as PluginCfgs; if (plugins != null && plugins.Count > 0) { PluginCfgs cfgs = plugins.GetPluginCfgs("main"); if (cfgs != null && cfgs.Count > 0) { this.pluginService.Load(cfgs); this.Update(); } } #endregion #region 初始化鼠标右键。 if (this.sendTo != null) { try { this.sendTo.Create(); } catch (Exception) { } } #endregion }
/// <summary> /// 构造函数。 /// </summary> /// <param name="service"></param> /// <param name="info"></param> public SyncDataWindow(ICoreService service, UserInfo info) : this(service, info, false) { }
/// <summary> /// 构造函数。 /// </summary> public HostBroadcastService(UserInfo userInfo) { this.info = userInfo; }
/// <summary> /// 构造函数。 /// </summary> /// <param name="service"></param> /// <param name="userInfo"></param> /// <param name="isPluginLoad"></param> public BoradcastAddressWindow(ICoreService service, UserInfo userInfo, bool isPluginLoad) : this(service, userInfo) { this.isPluginLoad = isPluginLoad; }
/// <summary> /// 构造函数。 /// </summary> /// <param name="service"></param> /// <param name="userInfo"></param> public BoradcastAddressWindow(ICoreService service, UserInfo userInfo) : base(service) { this.userInfo = userInfo; InitializeComponent(); }
/// <summary> /// 登录成功 /// </summary> /// <param name="userInfo"></param> private void LoginSuccess(UserInfo userInfo) { if (userInfo != null) { this.CoreService.AddForm(new BoradcastAddressWindow(this.CoreService, userInfo)); this.CoreService.Add("userinfo", userInfo); this.CoreService.ForceQuit = true; this.Close(); } }