/// <summary> /// 添加一条网络文件信息 /// </summary> /// <param name="info"></param> /// <param name="data"></param> public void AppendFileMes(Transmission.NetFileData info, UserData data, bool isPub) { MS_Label mS_Label; mS_Label = new MS_Label(false, this.master.IsPub, data, this.scrollBar1); mS_Label.Width = this.panel_sub.Width - 5; mS_Label.SetNetFileMes(info, this.showtime, isPub); this.NewMessageCount++; AddControl(mS_Label); }
/// <summary> /// 添加一条本地文件信息 /// </summary> /// <param name="path"></param> /// <param name="data"></param> public void AppendFileMes(string path, UserData data) { this.ScrollLock = true; MS_Label mS_Label; mS_Label = new MS_Label(true, this.master.IsPub, data, this.scrollBar1); mS_Label.Width = this.panel_sub.Width - 5; mS_Label.SetLocalFileMes(path, this.showtime); AddControl(mS_Label); }
/// <summary> /// 添加一条图片消息 /// </summary> /// <param name="image"></param> /// <param name="type"></param> public void AppendPicMessage(Image image, UserData data, MsType type) { bool we = type == MsType.本地消息; if (type == MsType.网络消息) { this.NewMessageCount++; } MS_Label lb = new MS_Label(we, this.master.IsPub, data, this.scrollBar1); lb.Width = this.panel_sub.Width - 5; lb.SetPicMessage(image, this.showtime); AddControl(lb); }
/// <summary> /// 添加一条会话记录 /// </summary> /// <param name="message">消息</param> /// <param name="name">用户名</param> /// <param name="headImg">头像</param> /// <param name="type">气泡类型</param> public void AppendText(string message, UserData data, MsType type) { MS_Label mS_Label; //判断消息所属 if (type == MsType.本地消息) { mS_Label = new MS_Label(true, this.master.IsPub, data, this.scrollBar1); ScrollLock = true; } else { mS_Label = new MS_Label(false, this.master.IsPub, data, this.scrollBar1); this.NewMessageCount++; } mS_Label.Width = this.panel_sub.Width - 5; mS_Label.SetText(message, this.showtime); AddControl(mS_Label); }