private void InitConnectedServerList() { try { IConnectedServerInformation = ConnectedServerXmlOperations.ReadConnectedServerList(App.GStrProgramDataDirectory, true); if (!IConnectedServerInformation.BoolReturn) { return; } ComboBoxServerName.Items.Clear(); foreach (List <string> LListStrSingleServer in IConnectedServerInformation.ListStrConnectedServer) { ComboBoxItem LComboBoxServerItem = new ComboBoxItem(); LComboBoxServerItem.Background = Brushes.Transparent; LComboBoxServerItem.Style = (Style)App.Current.Resources["ComboBoxItemNormalStyle"]; LComboBoxServerItem.Content = LListStrSingleServer[0]; LComboBoxServerItem.DataContext = LListStrSingleServer[0]; LComboBoxServerItem.Tag = LListStrSingleServer[1]; ComboBoxServerName.Items.Add(LComboBoxServerItem); } ComboBoxServerName.SelectionChanged += ComboBoxObjectSelectionChanged; foreach (ComboBoxItem LComboBoxSingleServerItem in ComboBoxServerName.Items) { if (LComboBoxSingleServerItem.Tag.ToString() == "1") { LComboBoxSingleServerItem.IsSelected = true; break; } } } catch { } }
private void IBackgroundWorkerE_DoWork(object sender, DoWorkEventArgs e) { try { ConnectedServerInformation LConnectedServerInformationReturn = ConnectedServerXmlOperations.AddConnectedServerInformation(App.GStrProgramDataDirectory, IListConnectInfo, false); I00003OperationReturn.BoolReturn = LConnectedServerInformationReturn.BoolReturn; I00003OperationReturn.StringReturn = LConnectedServerInformationReturn.StrReturn; } catch (Exception ex) { I00003OperationReturn.BoolReturn = false; I00003OperationReturn.StringReturn = "UMP001E005" + App.GStrSpliterChar + ex.Message; } }