示例#1
0
        private void LoginDialog_Load(object sender, EventArgs e)
        {
            string file = AppDomain.CurrentDomain.BaseDirectory + "logo.ico";

            InitUIResourcesByCulture();
            //this.Icon = IconService.GetIcon("Icons.16x16.Logo");
            this.Icon = IconService.GetIcon(file);
            try
            {
                Dictionary <string, string> siteDictionary = CallRemotingService.QueryServerSite();

                foreach (KeyValuePair <string, string> s in siteDictionary)
                {
                    this.cmbSite.Properties.Items.Add(s.Key);
                }
                string defaultSite = PropertyService.Get(PROPERTY_FIELDS.SITE);
                if (string.IsNullOrEmpty(defaultSite))
                {
                    this.cmbSite.SelectedIndex = 0;
                }
                else
                {
                    cmbSite.SelectedText = defaultSite;
                }
                site               = cmbSite.SelectedItem.ToString();
                cmbSite.Visible    = false;
                languageDictionary = CallRemotingService.QueryLanguageOption();

                foreach (string s in languageDictionary.Keys)
                {
                    this.cmbLanguage.Properties.Items.Add(s);
                }
                this.cmbLanguage.SelectedIndex = 0;
                //隐藏语言选择栏位。
                if (languageDictionary.Keys.Count > 0)
                {
                    this.lblLanguage.Visible = false;
                    this.cmbLanguage.Visible = false;
                }
                language = cmbLanguage.SelectedItem.ToString();
            }
            catch (Exception ex)
            {
                MessageService.ShowError(ex.Message);
            }
        }