public MessageSerializable.Message GetSmtpConfig() { SMTPConfig config = (SMTPConfig)xml.LoadConfig().Data[0]; MessageSerializable.Message msg = new MessageSerializable.Message(); msg.Data[0] = config; return msg; }
public static void DEBUGTestFunction() { if (!Properties.Settings.Default.DebugMode) return; MessageSerializable.Message msg = new MessageSerializable.Message(); msg.AppName = "Client"; msg.Invoke = "Tâche demandée"; msg.Data[0] = "William"; msg.Data[1] = 666; Composant_Serveur.EntreePlateforme.Check(msg); Debug("Ajout du joueur : "+msg.Statut.ToString()); }
public MessageSerializable.Message LoadConfig() { if (type == CONFIG_TYPE.SQL_Server_Config) { string cnx = ""; //ReversibleEncryption.DecryptFile(SQLSERVER_CONFIG_PATH); XmlDocument doc = new XmlDocument(); doc.Load(SQLSERVER_CONFIG_PATH); string provider = doc.DocumentElement.SelectSingleNode("/Config/Provider").InnerText; string dataSource = doc.DocumentElement.SelectSingleNode("/Config/DataSource").InnerText; string initCatalog = doc.DocumentElement.SelectSingleNode("/Config/InitialCatalog").InnerText; string user = doc.DocumentElement.SelectSingleNode("/Config/User").InnerText; string password = doc.DocumentElement.SelectSingleNode("/Config/Password").InnerText; //ReversibleEncryption.EncryptFile(SQLSERVER_CONFIG_PATH); cnx = "Provider=" + provider + ";Data Source=" + dataSource + ";User ID=" + user + ";Password="******";Initial Catalog=" + initCatalog + ""; MessageSerializable.Message msg = new MessageSerializable.Message(); msg.Data[0] = cnx; return msg; } else if (type == CONFIG_TYPE.SMTP_Config) { //ReversibleEncryption.DecryptFile(SMTP_CONFIG_PATH); XmlDocument doc = new XmlDocument(); doc.Load(SMTP_CONFIG_PATH); string address = doc.DocumentElement.SelectSingleNode("/Config/Address").InnerText; string username = doc.DocumentElement.SelectSingleNode("/Config/Username").InnerText; string password = doc.DocumentElement.SelectSingleNode("/Config/Password").InnerText; string host = doc.DocumentElement.SelectSingleNode("/Config/Host").InnerText; string port = doc.DocumentElement.SelectSingleNode("/Config/Port").InnerText; string enableSSL = doc.DocumentElement.SelectSingleNode("/Config/EnableSSL").InnerText; //ReversibleEncryption.EncryptFile(SMTP_CONFIG_PATH); SMTPConfig smtp = new SMTPConfig(address, username, password, host, Convert.ToInt32(port), bool.Parse(enableSSL)); MessageSerializable.Message msg = new MessageSerializable.Message(); msg.Data[0] = smtp; return msg; } else return null; }
public Fenetre_Questionnaire_Orientation() { InitializeComponent(); this.Title = "Questionnaire Jeu"; reponseButtons = new System.Windows.Controls.RadioButton[4]; reponseButtons[0] = this.Question1Button; reponseButtons[1] = this.Question2Button; reponseButtons[2] = this.Question3Button; reponseButtons[3] = this.Question4Button; CT_Get_Questionnaire CT = new CT_Get_Questionnaire(); MessageSerializable.Message msg = new MessageSerializable.Message(); msg.Data[0] = CT_Get_Questionnaire.QuestionnaireType.Orientation; this.questionnaire = (QuestionOrientation[])CT.Exec(msg).Data[0]; if (this.questionnaire == null) return; this.maxIndex = this.questionnaire.Length - 1; this.reponses = new ReponseOrientation[this.questionnaire.Length]; this.QuestionProgressBar.Minimum = 1; this.QuestionProgressBar.Maximum = this.maxIndex + 1; this.UpdateQuestion(); }
private int DoCorrection() { int points = 0; if (this.helped) points = 2; foreach(ReponseJeu rep in this.reponses) { Projet_Client.Composant_de_communication.MessageManager.Debug("CORRECTION : " + rep.ReponseText + " correct: " + rep.IsCorrect ); if (rep.IsCorrect) points += rep.Points; } MessageBox.Show("Félicitation " + Properties.Settings.Default.PlayerName + " tu as " + points + " points !"); MessageSerializable.Message msg = new MessageSerializable.Message(); msg.Data[0] = Properties.Settings.Default.PlayerName; msg.Data[1] = points; CT_Add_PlayerScore CT = new CT_Add_PlayerScore(); CT.Exec(msg); Fenetre_Classement fq = new Fenetre_Classement(); fq.Show(); this.Close(); return points; }