Exemple #1
0
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    public static void ShowMsg(Page pg, TypeMsg Type, string pMsg)
    {
        string            VG = "vgShowMsg";
        ValidationSummary vs = pg.Master.FindControl("ContentPlaceHolder2").FindControl("vsShowMsg") as ValidationSummary;
        CustomValidator   cv = pg.Master.FindControl("ContentPlaceHolder2").FindControl("cvShowMsg") as CustomValidator;

        vs.ValidationGroup = VG;
        cv.ValidationGroup = VG;
        cv.ErrorMessage    = pMsg;

        if (Type == TypeMsg.Info)
        {
            vs.CssClass = "MsgInfo"; /****/ vs.ForeColor = ColorTranslator.FromHtml("#00529B");
        }
        else if (Type == TypeMsg.Success)
        {
            vs.CssClass = "MsgSuccess "; /****/ vs.ForeColor = ColorTranslator.FromHtml("#4F8A10");
        }
        else if (Type == TypeMsg.Warning)
        {
            vs.CssClass = "MsgWarning"; /****/ vs.ForeColor = ColorTranslator.FromHtml("#9F6000");
        }
        else if (Type == TypeMsg.Error)
        {
            vs.CssClass = "MsgError"; /****/ vs.ForeColor = ColorTranslator.FromHtml("#D8000C");
        }
        else if (Type == TypeMsg.Validation)
        {
            vs.CssClass = "MsgValidation"; /****/ vs.ForeColor = ColorTranslator.FromHtml("#D63301");
        }


        pg.Validate(VG);
    }
Exemple #2
0
 public void SendMsg(UserChat username, string msg, TypeMsg typeMsg, int userId)
 {
     foreach (var el in users)
     {
         el.operationContext.GetCallbackChannel <ICallback>().MsgCallback(username, msg, typeMsg);
     }
 }
Exemple #3
0
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    public static void ShowMsg(Page pg, ValidationSummary vs, CustomValidator cv, TypeMsg Type, string VG, string pMsg)
    {
        vs.ValidationGroup = VG;
        cv.ErrorMessage    = pMsg;
        cv.ValidationGroup = VG;

        if (Type == TypeMsg.Info)
        {
            vs.CssClass = "MsgInfo"; /****/ vs.ForeColor = ColorTranslator.FromHtml("#00529B");
        }
        else if (Type == TypeMsg.Success)
        {
            vs.CssClass = "MsgSuccess "; /****/ vs.ForeColor = ColorTranslator.FromHtml("#4F8A10");
        }
        else if (Type == TypeMsg.Warning)
        {
            vs.CssClass = "MsgWarning"; /****/ vs.ForeColor = ColorTranslator.FromHtml("#9F6000");
        }
        else if (Type == TypeMsg.Error)
        {
            vs.CssClass = "MsgError"; /****/ vs.ForeColor = ColorTranslator.FromHtml("#D8000C");
        }
        else if (Type == TypeMsg.Validation)
        {
            vs.CssClass = "MsgValidation"; /****/ vs.ForeColor = ColorTranslator.FromHtml("#D63301");
        }


        pg.Validate(VG);
    }
Exemple #4
0
        void ComunForm_Even_show_action(string module, TypeMsg type_msg, string msg_action)
        {
            if (type_msg == TypeMsg.error)
                MessageBox.Show(msg_action, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

            baritemModulo.Caption = module;
            baritemAccion.Caption = msg_action;

            if (type_msg == TypeMsg.error)
                baritemBoton.ImageIndex = 1;
            if (type_msg == TypeMsg.ok)
                baritemAccion.ImageIndex = 0;
        }
Exemple #5
0
        public DialogInfo(TypeMsg pType, string pMsg)
        {
            InitializeComponent();
            this.txtMsg.Document.Blocks.Add(new Paragraph(new Run(pMsg)));

            switch (pType)
            {
            case TypeMsg.Error:
                this.imgBox.Source  = Convert(Properties.Resources.errorV2);
                this.imgBox.Stretch = Stretch.Uniform;
                break;

            case TypeMsg.Info:
                this.imgBox.Source  = Convert(Properties.Resources.infoV2);
                this.imgBox.Stretch = Stretch.Uniform;
                break;
            }
        }
Exemple #6
0
        void ComunForm_Even_show_action(string module, TypeMsg type_msg, string msg_action)
        {
            if (type_msg == TypeMsg.error)
            {
                MessageBox.Show(msg_action, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            baritemModulo.Caption = module;
            baritemAccion.Caption = msg_action;

            if (type_msg == TypeMsg.error)
            {
                baritemBoton.ImageIndex = 1;
            }
            if (type_msg == TypeMsg.ok)
            {
                baritemAccion.ImageIndex = 0;
            }
        }
Exemple #7
0
        public void MsgCallback(UserChat username, string msg, TypeMsg typeMsg)
        {
            StackPanel stk = new StackPanel();

            stk.Orientation         = System.Windows.Controls.Orientation.Horizontal;
            stk.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            TextBlock txtBlk = new TextBlock();

            txtBlk.Text              = username.Name + " : ";
            txtBlk.FontWeight        = System.Windows.FontWeights.Bold;
            txtBlk.VerticalAlignment = System.Windows.VerticalAlignment.Center;

            TextBlock txtBlk2 = new TextBlock();

            txtBlk2.Text = msg;
            txtBlk2.VerticalAlignment = System.Windows.VerticalAlignment.Center;

            switch (typeMsg)
            {
            case TypeMsg.Connect:
            {
                txtBlk.Foreground  = Brushes.Green;
                txtBlk2.Foreground = Brushes.Green;

                listOnlineUsers.Add(username);
                listUsers.ItemsSource       = listOnlineUsers;
                listUsers.SelectedValuePath = "Name";
                listUsers.Items.Refresh();
                break;
            }

            case TypeMsg.Disconnect:
            {
                txtBlk.Foreground  = Brushes.Red;
                txtBlk2.Foreground = Brushes.Red;
                try
                {
                    listOnlineUsers.RemoveAt(listOnlineUsers.FindIndex(x => x == UserInLog));
                    listUsers.ItemsSource = listOnlineUsers;
                    listUsers.Items.Refresh();
                }
                catch (Exception)
                {
                }


                break;
            }

            case TypeMsg.Error:
            {
                txtBlk.Foreground  = Brushes.Red;
                txtBlk2.Foreground = Brushes.Red;
                break;
            }

            case TypeMsg.Info:
            {
                txtBlk.Foreground  = Brushes.LightBlue;
                txtBlk2.Foreground = Brushes.LightBlue;
                break;
            }

            case TypeMsg.Message:
            {
                txtBlk.Foreground  = Brushes.Black;
                txtBlk2.Foreground = Brushes.Black;
                break;
            }

            case TypeMsg.Warning:
            {
                txtBlk.Foreground  = Brushes.Yellow;
                txtBlk2.Foreground = Brushes.Yellow;
                break;
            }
            }

            stk.Children.Add(txtBlk);
            stk.Children.Add(txtBlk2);

            chat.Items.Add(stk);
            chat.ScrollIntoView(chat.Items[chat.Items.Count - 1]);
        }
 public void AddInfoMsg(TypeMsg type, String msg)
 {
     managerMV.AddInfoMsg(type, msg);
 }
 public void AddInfoMsg(TypeMsg type, String msg)
 {
     try
     {
         Messages monMsg = new Messages(type, msg);
         p_listeMessages.Insert(0, monMsg);
     }
     catch (Exception e)
     {
         MsgBox.Show("AddInfoMsg : " + e.Message + "\n  Message original = " + msg, "Erreur", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Error);
     }
 }
Exemple #10
0
 public TcpMessage(TypeMsg type, String msg, String login)
 {
     this.type  = type;
     this.msg   = msg;
     this.login = login;
 }
Exemple #11
0
 public static void Send_message(string module, TypeMsg type_msg, string msg)
 {
     Even_show_action(module, type_msg, msg);
 }
Exemple #12
0
 public static void Send_message(string module, TypeMsg type_msg, string msg)
 {
     Even_show_action(module, type_msg, msg);
 }
Exemple #13
0
 public Messages(TypeMsg a_type, String a_msg)
 {
     p_type = a_type;
     p_msg = a_msg;
     p_time = DateTime.Now;
 }