/// <summary> /// 插入文件消息(本地) /// </summary> /// <param name="path"></param> public void SetLocalFileMes(string path, bool showtime) { this.fmes = new FileMes(user.IP); fmes.SetInfo(path); fmes.Anchor = AnchorStyles.Top | AnchorStyles.Right; SetLocation_File(); this.Height = fmes.Location.Y + fmes.Height + 10; this.Controls.Remove(this.label1); this.Controls.Add(fmes); this.lb_nowTime.Visible = showtime; }
/// <summary> /// 插入文件消息(网络) /// </summary> /// <param name="path"></param> public void SetNetFileMes(Transmission.NetFileData data, bool showtime, bool ispubmes) { fmes = new FileMes(user.IP); fmes.SetInfo(data); fmes.Anchor = AnchorStyles.Top | AnchorStyles.Left; SetLocation_File(); this.Height = fmes.Location.Y + fmes.Height + 10; this.Controls.Remove(this.label1); this.Controls.Add(fmes); this.lb_nowTime.Visible = showtime; fmes.FileDownLoadOver += (end, filename) => { string mes = string.Format("{0}接收了文件\"{1}\"", KeyData.StaticInfo.MyUser.Name, filename); if (ispubmes) { Transmitters.Sender.SendEventMessageToAll(mes); } else { Transmitters.Sender.SendEventMessage(end, mes); } }; }