示例#1
0
        private void conn()
        {
            string configtext = System.IO.File.ReadAllText(@"config.json");

            Console.WriteLine("Content of the file: {0}", configtext);

            JObject config = JObject.Parse(configtext);

            string languageoption = (string)config["Language"];

            ConnectionClass.config = new configFile((string)config["IpAdress"], (int)config["port"], languageoption);

            if (languageoption != "Romanian")
            {
                string configlanguagepath = @"languages/" + languageoption + ".json";
                string jsonlanguageconfig = System.IO.File.ReadAllText(configlanguagepath);

                languageSupporter supporter = new languageSupporter(jsonlanguageconfig);
                ConnectionClass.languagesupporter = supporter;
            }


            ClientTCP client = new ClientTCP((string)config["IpAdress"], (int)config["port"], 10000);

            ConnectionClass.ClientTCP = client;
            Console.WriteLine(config["IpAdress"]);

            Thread th = new Thread(new ParameterizedThreadStart(ReapetUntilConnected));

            th.Start(client);

            client.OnResponse       += Client_OnResponse;
            client.OnConnectionLost += Client_OnConnectionLost;
        }
示例#2
0
        private void ReloadLanguageSettings(string language)
        {
            string            path     = @"languages/" + language + ".json";
            string            jsontext = File.ReadAllText(path);
            languageSupporter ls       = new languageSupporter(jsontext);

            ConnectionClass.languagesupporter = ls;
            ReloadLanguage();
        }