GetString() public static method

public static GetString ( string name ) : string
name string
return string
Exemplo n.º 1
0
        static void Main()
        {
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(UnhandledExceptionHandler);
            string culture = Consts.enLanguage;

            try
            {
                string   configFolder         = Path.Combine(Application.StartupPath, Consts.DataFolder);
                string   settingsFileFullPath = Path.Combine(configFolder, Consts.SettingsFileName);
                Settings settings             = (Settings)Utils.LoadFromFile(settingsFileFullPath, typeof(Settings));
                if (settings == null)
                {
                    settings                  = new Settings();
                    settings.RefreshTime      = Consts.DefaultRefreshTime;
                    settings.ShowMinAmount    = Consts.DefaultShowMinAmount;
                    settings.ShowOrderNO      = Consts.DefaultShowOrderNo;
                    settings.WarnHighBuyPrice = Consts.DefaultHighestBuyPrice;
                    settings.WarnLowSellPrice = Consts.DefaultLowestSellPrice;
                    settings.Language         = Consts.enLanguage;
                    Utils.SaveToFile(settings, settingsFileFullPath);
                }
                culture = settings.Language;
            }
            catch (Exception ex)
            {
            }

            if (culture == Consts.cnLanguage)
            {
                ResourceFactory.ResourceCulture       = ResourceFactory.CnCultureInfo;
                ResourceFactory.ResourceMan           = ResourceFactory.CnResourceManager;
                Thread.CurrentThread.CurrentUICulture = ResourceFactory.CnCultureInfo;
            }
            else
            {
                ResourceFactory.ResourceCulture       = ResourceFactory.EnCultureInfo;
                ResourceFactory.ResourceMan           = ResourceFactory.EnResourceManager;
                Thread.CurrentThread.CurrentUICulture = ResourceFactory.EnCultureInfo;
            }
            ResourceFactory.Culture = culture;

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            string procName  = System.Diagnostics.Process.GetCurrentProcess().ProcessName;
            string logFolder = Path.Combine(Application.StartupPath, Consts.logFolder);

            Trace.Listeners.Add(new LogTraceListener(Path.Combine(logFolder, Consts.logFileName)));
            Trace.AutoFlush = true;
            if ((System.Diagnostics.Process.GetProcessesByName(procName)).GetUpperBound(0) > 0)
            {
                MessageBox.Show(ResourceFactory.GetString("AlreadyRunning"));
                return;
            }

            Configure config = new Configure();

            config.Show();
            Application.Run();
        }
Exemplo n.º 2
0
        private bool checkField()
        {
            bool bStatus = true;

            this.lblErrorMsg.Visible = false;
            this.lblErrorMsg.Text    = "";

            do
            {
                if (this.txtKey.Text.Trim().Equals(string.Empty) || this.txtSecret.Text.Trim().Equals(string.Empty))
                {
                    this.lblErrorMsg.Text    = ResourceFactory.GetString("ConfigurationError");
                    this.lblErrorMsg.Visible = true;
                    bStatus = false;
                }
                else
                {
                    bStatus = true;
                }
            } while (false);
            return(bStatus);
        }
Exemplo n.º 3
0
 private void Init()
 {
     this.btnOk.Text = ResourceFactory.GetString("ConfigurationFinished");
     this.Text       = ResourceFactory.GetString("ConfigTitle");
 }