private void showMessage(string MsgHeader, string MsgTopic, string MsgBody, string MsgSolution, msgType AlertType) { string errorMsgBody = "Please Contact AdministratorTel 02-xxx-xxxx"; if (MsgHeader.Equals(string.Empty) && MsgTopic.Equals(string.Empty) && MsgBody.Equals(string.Empty)) { (masterpage.FindControl("DialogHeader") as Label).Text = msgType.Message.ToString(); (masterpage.FindControl("DialogTopic") as Label).Text = "Haven't this ID"; (masterpage.FindControl("DialogMsg") as Label).Text = errorMsgBody; (masterpage.FindControl("ModalPopupExtender") as ModalPopupExtender).Show(); } else { if (AlertType.Equals(msgType.Message)) { (masterpage.FindControl("DivDialog") as HtmlGenericControl).Style["display"] = "inline"; (masterpage.FindControl("divSolution") as HtmlGenericControl).Style["display"] = "inline"; (masterpage.FindControl("DialogOkButton") as Button).Text = "OK"; (masterpage.FindControl("divCancel") as HtmlGenericControl).Style["display"] = "none"; (masterpage.FindControl("divOk") as HtmlGenericControl).Style["display"] = "inline"; (masterpage.FindControl("DialogHeader") as Label).Text = MsgHeader; (masterpage.FindControl("DialogTopic") as Label).Text = MsgTopic; (masterpage.FindControl("DialogMsg") as Label).Text = MsgBody; (masterpage.FindControl("ModalPopupExtender") as ModalPopupExtender).Show(); } else if (AlertType.Equals(msgType.Error)) { (masterpage.FindControl("DivDialog") as HtmlGenericControl).Style["display"] = "inline"; (masterpage.FindControl("divSolution") as HtmlGenericControl).Style["display"] = "inline"; (masterpage.FindControl("DialogCancelButton") as Button).Text = "OK"; (masterpage.FindControl("divCancel") as HtmlGenericControl).Style["display"] = "inline"; (masterpage.FindControl("divOk") as HtmlGenericControl).Style["display"] = "none"; (masterpage.FindControl("DialogHeader") as Label).Text = AlertType.ToString(); (masterpage.FindControl("DialogTopic") as Label).Text = MsgTopic; (masterpage.FindControl("DialogMsg") as Label).Text = MsgBody; (masterpage.FindControl("DialogSolution") as Label).Text = MsgSolution; (masterpage.FindControl("ModalPopupExtender") as ModalPopupExtender).Show(); StringBuilder mScript = new StringBuilder(string.Empty); mScript.AppendFormat("DialogError('{0}','{1}','{2}','{3}')", AlertType.ToString(), MsgTopic, MsgBody, errorMsgBody); ScriptManager.RegisterClientScriptBlock(HttpContext.Current.Handler as Page, (HttpContext.Current.Handler as Page).GetType(), "onload", mScript.ToString(), true); } } }
public bubble(string kMessage, string urlPic, string urlSticker, int Mess_Type, string kTime, msgType messageType) { InitializeComponent(); // Define this.kMessage = kMessage; this.urlPic = urlPic; this.urlSticker = urlSticker; this.Mess_Type = Mess_Type; this.kTime = kTime; this.messageType = messageType; lb_message.Text = kMessage; if (urlSticker == "") { this.Width = lb_message.Width + 20; } else { this.Width = picture_sticker.Width + 20; } lb_message.Top = 10; lb_message.Left = 10; lb_time.Text = kTime; SetHeight(); if (messageType.ToString() == "In") { // Incoming message //this.BackColor = Color.FromArgb(0, 164, 147); gradientPanel.GradientBottomLeft = gradientPanel.GradientTopLeft = Panel_Color_Bubble.LeftColor; gradientPanel.GradientBottomRight = gradientPanel.GradientTopRight = Panel_Color_Bubble.RightColor; lb_message.TextAlign = ContentAlignment.MiddleRight; } else { // Message from me //this.BackColor = Color.Gray; gradientPanel.GradientBottomLeft = gradientPanel.GradientTopLeft = gradientPanel.GradientBottomRight = gradientPanel.GradientTopRight = Color.FromArgb(241, 240, 240); lb_message.TextAlign = ContentAlignment.MiddleLeft; lb_message.ForeColor = Color.Black; } /*int isPicture = 0;*/ if (urlSticker != "") { isPicture = 1; gradientPanel.Visible = false; this.BackColor = Color.White; picture_sticker.ImageLocation = "../../Resources\\" + urlSticker; picture_sticker.Visible = true; } /*SetHeight(isPicture);*/ }
public TextBubble(string msg, msgType type) { InitializeComponent(); message.Text = msg; setHeight(); if (type.ToString() == "Out") { this.bubble.Location = new Point(457 - (bubble.Width + 20), 0); this.bubble.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(250)))), ((int)(((byte)(48)))), ((int)(((byte)(90))))); this.bubble.FillColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(36)))), ((int)(((byte)(206))))); } }
public FileBubble(string fileName, byte[] file, msgType type) { InitializeComponent(); string[] fileInfo = getFileInfo(fileName); FileName = fileInfo[0] + fileInfo[1].ToLower(); Files = file; if (type.ToString() == "Out") { this.pnlBubble.Location = new Point(457 - (pnlBubble.Width + 20), 0); } if (fileInfo[1].Equals(".JPG") || fileInfo[1].Equals(".JPEG") || fileInfo[1].Equals(".PNG") || fileInfo[1].Equals(".GIF")) { this.picture.Size = new Size(230, 130); this.picture.Location = new Point(10, 10); this.picture.Image = ChatAppUtils.ByteToImage(Files); this.fileName.Visible = false; this.fileSize.Visible = false; } else { this.fileName.Text = FileName; this.fileSize.Text = getFileSize(Files); } }