private void FormBatchModifyServerInfo_Shown(object sender, EventArgs e) { this.cboxMark.Items.Clear(); foreach (var mark in servers.GetMarkList()) { this.cboxMark.Items.Add(mark); } var firstCtrl = servers .GetAllServersOrderByIndex() .Where(s => s.GetCoreStates().IsSelected()) .FirstOrDefault(); if (firstCtrl == null) { return; } var first = firstCtrl.GetCoreStates().GetAllRawCoreInfo(); this.cboxInMode.SelectedIndex = first.customInbType; this.tboxInIP.Text = first.inbIp; this.tboxInPort.Text = first.inbPort.ToString(); this.cboxMark.Text = first.customMark; this.cboxAutorun.SelectedIndex = first.isAutoRun ? 0 : 1; this.cboxImport.SelectedIndex = first.isInjectImport ? 0 : 1; this.cboxIsInjectSkipCNSite.SelectedIndex = first.isInjectSkipCNSite ? 0 : 1; }
private IEnumerable <Model.Data.ServerItem> GetFilteredListByMark() { var list = servers.GetServerList(); if (preSelectedMarkFilterIndex < 0) { return(list); } switch (preSelectedMarkFilterIndex) { case 0: return(list); case 1: return(list.Where(s => string.IsNullOrEmpty(s.mark))); } var markList = servers.GetMarkList(); return(list.Where(s => s.mark == markList[preSelectedMarkFilterIndex - 2])); }
private void FormBatchModifyServerInfo_Shown(object sender, EventArgs e) { this.cboxMark.Items.Clear(); foreach (var mark in servers.GetMarkList()) { this.cboxMark.Items.Add(mark); } var first = servers.GetServerList().Where(s => s.isSelected).FirstOrDefault(); if (first == null) { return; } this.cboxInMode.SelectedIndex = first.overwriteInboundType; this.tboxInIP.Text = first.inboundIP; this.tboxInPort.Text = first.inboundPort.ToString(); this.cboxMark.Text = first.mark; this.cboxAutorun.SelectedIndex = first.isAutoRun ? 0 : 1; this.cboxImport.SelectedIndex = first.isInjectImport ? 0 : 1; this.cboxIsInjectSkipCNSite.SelectedIndex = first.isInjectSkipCNSite ? 0 : 1; }
void UpdateMarkFilterItemList(ToolStripComboBox marker) { marker.Items.Clear(); marker.Items.AddRange( servers.GetMarkList().ToArray()); }