private void ApplyFilter() { _projects.Nodes.Clear(); foreach (var projectCollection in _projectCollections) { TreeNode projectCollectionNode = new TreeNode(projectCollection.Name); var tfsProjects = projectCollection.Projects.OrderBy(i => i.Name); foreach (var project in tfsProjects) { var projectNode = new TreeNode(project.Name); var myTfsBuildDefinitions = project.BuildDefinitions.OrderBy(i => i.Name); foreach (var buildDefinition in myTfsBuildDefinitions) { var shouldBeVisible = string.IsNullOrEmpty(_filter.Text) || buildDefinition.Name.Contains(_filter.Text, StringComparison.CurrentCultureIgnoreCase); if (!shouldBeVisible) { continue; } _ciEntryPointSetting.FindAddBuildDefinition(buildDefinition, _ciEntryPoint.Name); bool exists = Settings.BuildExistsAndIsActive(_ciEntryPoint.Name, buildDefinition.Name); ThreeStateTreeNode node = new ThreeStateTreeNode(buildDefinition.Name) { Tag = buildDefinition.Id, State = exists ? CheckBoxState.Checked : CheckBoxState.Unchecked }; projectNode.Nodes.Add(node); } AddIfContainsChildren(projectCollectionNode.Nodes, projectNode); } AddIfContainsChildren(_projects.Nodes, projectCollectionNode); } RefreshCheckednessOfParentNodes(); }
protected override void btnOK_Click(object sender, EventArgs e) { base.btnOK_Click(sender, e); if (!string.IsNullOrEmpty(base.sValue)) { try { if (this.getParam()) { if (base.OrderCode == CmdParam.OrderCode.停止报警) { base.reResult = RemotingClient.StopAlarmDeal(base.ParamType, base.sValue, base.sPw, CmdParam.CommMode.未知方式, this.m_AlarmInfo, (this.m_cmd.Count > 0) ? this.m_cmd[0] : null); } else { base.reResult = RemotingClient.DownData_SimpleCmd(base.ParamType, base.sValue, base.sPw, CmdParam.CommMode.未知方式, this.m_SimpleCmd); } if (base.reResult.ResultCode != 0L) { MessageBox.Show(base.reResult.ErrorMsg); } else { if ((this._toPlatformContent.Length > 0) && (base.OrderCode == CmdParam.OrderCode.停止报警)) { SimpleCmd cmdParameter = new SimpleCmd { OrderCode = CmdParam.OrderCode.主动上报报警处理结果信息 }; RemotingClient.Car_CommandParameterInsterToDB(base.ParamType, base.sValue, base.sPw, cmdParameter, this._toPlatformContent, "上传处理结果信息"); foreach (string str in base.sValue.Split(new char[] { ',' })) { string sCarId = MainForm.myCarList.execChangeCarValue((int)base.ParamType, 1, str); ThreeStateTreeNode node = MainForm.myCarList.tvList.getNodeById(sCarId); if (node != null) { if (node.CarStatusValue.IndexOf("平台偏离路线") >= 0) { RemotingClient.ExecNoQuery(string.Format(" update GpsJtbCarPathAlarm_Platform set stopAlarmTime = dateadd(ss, " + Variable.sStopAlarmTime + ", getdate()) where CarID = '{0}' ", sCarId)); } else if (node.CarStatusValue.IndexOf("平台区域") >= 0) { RemotingClient.ExecNoQuery(string.Format(" update GpsJtbCarRegionAlarm_Platform set stopAlarmTime = dateadd(ss, " + Variable.sStopAlarmTime + ", getdate()) where CarID = '{0}' ", sCarId)); } else if (node.CarStatusValue.IndexOf("平台分路段限速") >= 0) { RemotingClient.ExecNoQuery(string.Format(" update GpsJtbCarPathSegmentAlarm_Platform set stopAlarmTime = dateadd(ss, " + Variable.sStopAlarmTime + ", getdate()) where CarID = '{0}' ", sCarId)); } } } } base.DialogResult = DialogResult.OK; } } } catch (Exception exception) { Record.execFileRecord("停止报警->确定", exception.Message); } } }
private void LoadBuildDefinitions(TreeNode node) { if (node.Tag is TeamCityProject && node.Nodes.Count == 1 && node.Nodes[0].Text == PLACEHODER_TEXT) { _service.GetBuildDefinitions((TeamCityProject)node.Tag, _userName.Text, _password.Text, buildDefinitions => { ClearProjectNodes(node.Nodes); var activeBuildDefinitionSettings = _ciEntryPointSetting.BuildDefinitionSettings.Where(bd => bd.Active); foreach (TeamCityBuildDefinition buildDefinition in buildDefinitions) { TeamCityBuildDefinition definition = buildDefinition; ThreeStateTreeNode buildDefinitionNode = new ThreeStateTreeNode(buildDefinition.Name) { Tag = buildDefinition }; var buildDefSettings = activeBuildDefinitionSettings.FirstOrDefault(bd => bd.Id == definition.Id); if (buildDefSettings != null) { buildDefinitionNode.State = buildDefSettings.Active ? CheckBoxState.Checked : CheckBoxState.Unchecked; } node.Nodes.Add(buildDefinitionNode); buildDefinitionNode.UpdateStateOfRelatedNodes(); } }); } }
private void GetProjectsComplete(TeamCityProject[] projects) { _ciEntryPointSetting.Url = _url.Text; _ciEntryPointSetting.UserName = _userName.Text; _ciEntryPointSetting.SetPassword(_password.Text); Settings.Save(); ClearProjectNodes(); var teamCityProjects = projects.OrderBy(i => i.Name); foreach (TeamCityProject project in teamCityProjects) { bool exists = Settings.BuildExistsAndIsActive(_teamCityCiEntryPoint.Name, project.Name); ThreeStateTreeNode node = new ThreeStateTreeNode(project.Name) { Tag = project, State = exists ? CheckBoxState.Checked : CheckBoxState.Unchecked }; node.State = CheckBoxState.Indeterminate; node.Nodes.Add(PLACEHODER_TEXT); _projects.Nodes.Add(node); LoadBuildDefinitions(node); } }
private void initControlUi() { if (((MainForm.myCarList.tvList.SelectedNode != null) && (MainForm.myCarList.tvList.SelectedNode.Tag != null)) && "AREA".Equals(MainForm.myCarList.tvList.SelectedNode.Tag.ToString(), StringComparison.OrdinalIgnoreCase)) { this.Text = "详细信息"; this.tcAttribute.TabPages.RemoveByKey("tpBasic"); this.tcAttribute.TabPages.RemoveByKey("tpTerminal"); this.tcAttribute.TabPages.RemoveByKey("tpOther"); this.tcAttribute.TabPages.RemoveByKey("tpRemark"); ThreeStateTreeNode selectedNode = MainForm.myCarList.tvList.SelectedNode as ThreeStateTreeNode; string carId = selectedNode.CarId; DataRow[] rowArray = MainForm.myCarList.AreaList.Select("areacode='" + carId + "'"); if ((rowArray != null) && (rowArray.Length > 0)) { foreach (Control control in this.tcAttribute.TabPages["tpRegion"].Controls) { if ((control is TextBox) && MainForm.myCarList.AreaList.Columns.Contains(control.Tag.ToString())) { control.Text = (rowArray[0][control.Tag.ToString()] != null) ? rowArray[0][control.Tag.ToString()].ToString() : " "; } } } } else { this.tcAttribute.TabPages.RemoveByKey("tpRegion"); this.initControl(); } }
public void getTrackPointQueryInfo() { string[] separator = new string[] { "::" }; object obj2 = null; try { obj2 = MainForm.myMap.getTrackPointQueryInfo(this.sBatchNameOrder); if ((obj2 != null) && !string.IsNullOrEmpty(obj2.ToString())) { string[] strArray2 = obj2.ToString().Split(separator, StringSplitOptions.RemoveEmptyEntries); string str2 = ""; string str3 = ""; foreach (string str4 in strArray2) { int index = str4.IndexOf('|'); if (index != -1) { str2 = str4.Substring(index + 1); str3 = str4.Substring(0, index); if (MainForm.htBatchName[str3] != null) { string[] strArray3 = MainForm.htBatchName[str3].ToString().Split(new char[] { '|' }); string filterExpression = string.Format("OrderId='{0}' and CarId='{1}' and ReceTime='{2}'", strArray3[0], str3, strArray3[1]); DataRow[] rowArray = base.m_dtLogData.Select(filterExpression); if (rowArray.Length > 0) { //DataRow row; /// DataTable table = new DataTable(); DataRow row = table.NewRow(); /// object obj3 = row["Describe"]; (row = rowArray[0])["Describe"] = string.Concat(new object[] { obj3, ";位置信息[", str2, "];" }); MainForm.htBatchName.Remove(str3); ThreeStateTreeNode node = MainForm.myCarList.tvList.getNodeById(str3); if (node != null) { node.Address = str2; } } } } } if (MainForm.htBatchName.Count == 0) { this.execStopPlayTrackLine(); this.tBatchNameRemoveEventHandler(); MainForm.htBatchName = null; } } } catch (Exception exception) { Record.execFileRecord("批量点名->获取地理位置信息", exception.Message); } }
private void cboxCloseOwner_CheckedChanged(object sender, EventArgs e) { ThreeStateTreeNode node = MainForm.myCarList.tvList.getNodeById(this.m_sCarId); if (node != null) { node.bShowNoticeForm = !this.cboxCloseOwner.Checked; } }
public void Set(ThreeStateTreeNode myNode, DataRow dr) { string str; try { string str1 = string.Concat("Attach_", myNode.CarId); string str2 = string.Concat("Attach_", dr["OrderID"].ToString(), "_", dr["CarID"].ToString()); if (dr.Table.ExtendedProperties.ContainsKey(str1)) { str = dr.Table.ExtendedProperties[str1].ToString(); } else { str = (dr.Table.ExtendedProperties.ContainsKey(str2) ? dr.Table.ExtendedProperties[str2].ToString() : ""); } string str3 = str; if (str3.Length > 0) { AttachData attachDatum = new AttachData(str3); string str4 = attachDatum.ParseAttachData("1", ""); if (str4.Trim().Length <= 0) { str4 = attachDatum.ParseAttachData("01", ""); if (str4.Trim().Length > 0) { myNode.DynamicAttr["oil"] = string.Concat(str4, "L"); } } else { myNode.DynamicAttr["oil"] = string.Concat(str4, "L"); } str4 = attachDatum.ParseAttachData("D1", "1"); if (str4.Trim().Length <= 0 || !str4.Equals("1")) { str4 = attachDatum.ParseAttachData("D1", "0"); if (str4.Trim().Length <= 0 || !str4.Equals("1")) { myNode.DynamicAttr["罐子状态"] = "停转"; } else { myNode.DynamicAttr["罐子状态"] = "卸料"; } } else { myNode.DynamicAttr["罐子状态"] = "搅拌"; } } } catch (Exception exception) { Record.execFileRecord(string.Concat("附加报文解析异常:", exception.ToString())); } }
private void treeKeywords_AfterCheckStateChanged(object sender, TreeViewEventArgs e) { ThreeStateTreeNode n = e.Node as ThreeStateTreeNode; if (n != null) { model.SetKeyword(n.Text, n.CheckState); } }
private void LoadProjectList() { _ciEntryPointSetting.BuildDefinitionSettings.ForEach(buildDefinition => { var travisCiBuildDefinition = TravisCiBuildDefinition.FromIdString(buildDefinition.Id); ThreeStateTreeNode node = new ThreeStateTreeNode(travisCiBuildDefinition.OwnerName + "/" + travisCiBuildDefinition.ProjectName) { Tag = buildDefinition, State = CheckBoxState.Checked }; _projects.Nodes.Add(node); }); }
public void setShowInfo(DataGridViewRow drNotice) { this.lblGpsTimeValue.Text = drNotice.Cells["ReceTime"].Value.ToString(); this.lblCarNumValue.Text = drNotice.Cells["CarNum"].Value.ToString(); this.txtDescribe.Text = drNotice.Cells["Describe"].Value.ToString(); this.m_sCarId = drNotice.Cells["CarId"].Value.ToString(); ThreeStateTreeNode node = MainForm.myCarList.tvList.getNodeById(this.m_sCarId); if (node != null) { this.cboxCloseOwner.Checked = !node.bShowNoticeForm; } this.gbRepeat.Enabled = this.btnSend.Enabled = drNotice.Cells["ReceTime"].Value.ToString().Equals("43521", StringComparison.OrdinalIgnoreCase); }
private void btnStopReport_Click(object sender, EventArgs e) { ThreeStateTreeNode myNode = MainForm.myCarList.tvList.getNodeById(this.sCarID); if (myNode != null) { MainForm.myCarList.tvList.SetSelectedNodes(myNode); ThreeStateTreeNode node2 = MainForm.myCarList.tvTrackCar.getNodeById(this.sCarID); if (node2 != null) { MainForm.myCarList.tvTrackCar.SetSelectedNodes(node2); } int platalarmType = -1; if (this.lblAlermTypeValue.Text.IndexOf("平台偏离路线") >= 0) { platalarmType = 0; itmStopReport report2 = new itmStopReport(CmdParam.OrderCode.停止报警, platalarmType) { Text = "停止报警" }; report2.ShowDialog(); } else if (this.lblAlermTypeValue.Text.IndexOf("平台区域") >= 0) { platalarmType = 1; itmStopReport report4 = new itmStopReport(CmdParam.OrderCode.停止报警, platalarmType) { Text = "停止报警" }; report4.ShowDialog(); } else if (this.lblAlermTypeValue.Text.IndexOf("平台分路段限速") >= 0) { platalarmType = 2; itmStopReport report6 = new itmStopReport(CmdParam.OrderCode.停止报警, platalarmType) { Text = "停止报警" }; report6.ShowDialog(); } else { itmStopReport report8 = new itmStopReport(CmdParam.OrderCode.停止报警) { Text = "停止报警" }; report8.ShowDialog(); } } }
private void GetProjectComplete(TravisCiBuildDefinition buildDefinition) { _ciEntryPointSetting.Url = "http://travis-ci.org/"; Settings.Save(); bool exists = Settings.BuildExistsAndIsActive(_travisCiEntryPoint.Name, buildDefinition.Id); ThreeStateTreeNode node = new ThreeStateTreeNode(buildDefinition.OwnerName + "/" + buildDefinition.ProjectName) { Tag = buildDefinition, State = exists ? CheckBoxState.Checked : CheckBoxState.Unchecked }; _projects.Nodes.Add(node); }
private string getAreaCarList() { string text = this.txtCarName.Text; int num = 0; StringBuilder builder = new StringBuilder(); int num2 = 0; if (htCurrentCarList != null) { htCurrentCarList.Clear(); } else { htCurrentCarList = new Hashtable(); } try { int count = MainForm.myCarList.tvList.hasAreaPath.Count; foreach (string str2 in this.tvAreaList.hasAreaPath.Keys) { ThreeStateTreeNode node = this.tvAreaList.getAreaById(str2); if ((node != null) && node.Checked) { foreach (ThreeStateTreeNode node2 in MainForm.myCarList.tvList.getAreaById(str2).Nodes) { if ((node2.Tag.Equals("CAR") && (string.IsNullOrEmpty(text) || node2.Text.Contains(text))) && !htCurrentCarList.ContainsKey(node2.Name)) { if (num >= this.iCntPerPage) { builder.Append("'@'"); num = 0; } num++; string[] strArray = new string[] { node2.CarId, node2.CarNum, node2.CarAreaName }; htCurrentCarList.Add(node2.Name, strArray); builder.Append(node2.SimNum + "|" + node2.Name + ";"); } } this.pbDownLoad.Value = num2++; } } } catch (Exception exception) { Record.execFileRecord("日期查车->获取勾选中的所有车辆", exception.Message); } return(builder.ToString()); }
private bool AddBuildDefinition(TeamCityBuildDefinition buildDefinition, ThreeStateTreeNode parentProjectNode, IEnumerable <BuildDefinitionSetting> activeBuildDefinitionSettings) { ThreeStateTreeNode buildDefinitionNode = new ThreeStateTreeNode(buildDefinition.Name) { Tag = buildDefinition }; var buildDefSettings = activeBuildDefinitionSettings.FirstOrDefault(bd => bd.Id == buildDefinition.Id); if (buildDefSettings != null) { buildDefinitionNode.State = buildDefSettings.Active ? CheckBoxState.Checked : CheckBoxState.Unchecked; } parentProjectNode.Nodes.Add(buildDefinitionNode); buildDefinitionNode.UpdateStateOfRelatedNodes(); return(buildDefinitionNode.Checked); }
private void getTreeNodeIsChecked(ThreeStateTreeNode tn, ref DataTable dt) { foreach (ThreeStateTreeNode node in tn.Nodes) { if ((node.Tag != null) && node.Tag.Equals("CAR")) { if (node.Checked) { dt.Rows.Add(new object[] { node.CarNum, node.SimNum }); } } else { this.getTreeNodeIsChecked(node, ref dt); } } }
private void btnAddKeyword_Click(object sender, EventArgs e) { InputBox i = new InputBox("New tag", "Please enter the name of the new tag:", ""); if (i.ShowDialog(this.FindForm()) == DialogResult.OK) { string name = i.Input.Trim(); if (name != "") { // find the parent node ThreeStateTreeNode parent = this.treeKeywords.SelectedNode as ThreeStateTreeNode; if (parent != null && parent.Parent != null) { parent = parent.Parent as ThreeStateTreeNode; } if (parent == null) { // finde the default group as parent foreach (ThreeStateTreeNode n in this.treeKeywords.Nodes) { if (n.Text == GroupedTagList.DEFAULT_GROUP) { parent = n; break; } } if (parent == null) { // create the default group parent = new ThreeStateTreeNode(GroupedTagList.DEFAULT_GROUP); parent.HasCheckBox = false; this.treeKeywords.Nodes.Add(parent); } } ThreeStateTreeNode newnode = new ThreeStateTreeNode(name, true); newnode.ShowPlusMinus = false; parent.Nodes.Add(newnode); parent.Expand(); model.SetKeyword(name, CheckState.Checked); model.SetNewKeyword(name, parent.Text); } } }
private void tvAreaList_AfterCheck(object sender, TreeViewEventArgs e) { ThreeStateTreeNode node = (ThreeStateTreeNode)e.Node; if (node.Checked) { node.CheckState = TriState.Checked; } else { node.CheckState = TriState.Unchecked; } foreach (ThreeStateTreeNode node2 in node.Nodes) { this.tvAreaList.SetNodeTriState(node2); } this.tvAreaList.RecursiveSetNodeTriState((ThreeStateTreeNode)e.Node); }
private void getTreeNodeIsChecked(ThreeStateTreeNode tn, ref DataTable dt) { foreach (ThreeStateTreeNode node in tn.Nodes) { if ((node.Tag != null) && node.Tag.Equals("CAR")) { if (node.Checked) { string str = (node.AccOn == "0") ? "关" : "开"; object[] values = new object[14]; values[0] = node.CarNum; values[1] = node.SimNum; values[2] = (node.CarAreaName == node.WordCompany) ? node.CarAreaName : (node.WordCompany + "-" + node.CarAreaName); values[3] = node.Longitude; values[4] = node.Latitude; values[5] = node.ALLDiff; values[6] = node.ReceTime; values[7] = node.GpsTime; values[9] = node.Speed; values[10] = str; values[11] = node.DriverName; values[12] = node.CarId; values[13] = node.AreaType; dt.Rows.Add(values); if (!string.IsNullOrEmpty(node.Longitude)) { if (!this.bRefresh) { this.iCurrentCnt++; worker.ReportProgress(this.iCurrentCnt / this.iNodeCnt, node.SimNum + "|" + node.Longitude + "," + node.Latitude); } else { MainForm.myMap.execExcuteTrackPointQuerty(this.sQueryTypeValue, node.SimNum, node.Longitude, node.Latitude); } } } } else { this.getTreeNodeIsChecked(node, ref dt); } } }
private void btnRealTimeReport_Click(object sender, EventArgs e) { ThreeStateTreeNode myNode = MainForm.myCarList.tvList.getNodeById(this.sCarID); if (myNode != null) { MainForm.myCarList.tvList.SetSelectedNodes(myNode); ThreeStateTreeNode node2 = MainForm.myCarList.tvTrackCar.getNodeById(this.sCarID); if (node2 != null) { MainForm.myCarList.tvTrackCar.SetSelectedNodes(node2); } itmRealTimeReport report2 = new itmRealTimeReport(CmdParam.OrderCode.实时监控) { Text = "实时监控" }; report2.ShowDialog(); } }
private void GetProjectComplete(TravisCiBuildDefinition buildDefinition) { _ciEntryPointSetting.Url = _travisUrl.Text; if (!string.IsNullOrEmpty(_travisApiAccessToken.Text)) { _ciEntryPointSetting.SetPassword(_travisApiAccessToken.Text); } Settings.Save(); bool exists = Settings.BuildExistsAndIsActive(_travisCiEntryPoint.Name, buildDefinition.Id); ThreeStateTreeNode node = new ThreeStateTreeNode(buildDefinition.OwnerName + "/" + buildDefinition.ProjectName) { Tag = buildDefinition, State = exists ? CheckBoxState.Checked : CheckBoxState.Unchecked }; _projects.Nodes.Add(node); }
private void NewLogStopAlarm(DataRow myRow, string sCarId) { bool bAccOn = false; if ("1".Equals(myRow["AccOn"].ToString())) { bAccOn = true; } ThreeStateTreeNode node = MainForm.myCarList.tvList.getNodeById(sCarId); if (node != null) { string strB = myRow["ReceTime"].ToString(); if (node.LastAlarmSetTime.CompareTo(strB) <= 0) { this.stopAlarm(sCarId, bAccOn); node.LastAlarmStopTime = strB; } } }
private void ApplyFilter() { _projects.Nodes.Clear(); foreach (HudsonBuildDefinition project in _buildDefinitions) { var shouldBeVisible = string.IsNullOrEmpty(_filter.Text) || project.Name.Contains(_filter.Text, StringComparison.CurrentCultureIgnoreCase); if (!shouldBeVisible) { continue; } bool exists = Settings.BuildExistsAndIsActive(_hudsonCiEntryPoint.Name, project.Name); ThreeStateTreeNode node = new ThreeStateTreeNode(project.Name) { Tag = project, State = exists ? CheckBoxState.Checked : CheckBoxState.Unchecked }; _projects.Nodes.Add(node); } }
//view private void btnAddKeyword_Click(object sender, EventArgs e) { InputBox i = new InputBox("New tag", "Please enter the name of the new tag:", ""); if (i.ShowDialog() == DialogResult.OK) { if (i.Input.Trim() != "") { ThreeStateTreeNode parent = this.treeKeywords.SelectedNode as ThreeStateTreeNode; if (parent != null && parent.Parent != null) { parent = parent.Parent as ThreeStateTreeNode; } if (parent == null) { foreach (ThreeStateTreeNode n in this.treeKeywords.Nodes) { if (n.Text == GroupedTagList.DEFAULT_GROUP) { parent = n; break; } } if (parent == null) { parent = new ThreeStateTreeNode(GroupedTagList.DEFAULT_GROUP); parent.HasCheckBox = false; this.treeKeywords.Nodes.Add(parent); } } ThreeStateTreeNode newnode = new ThreeStateTreeNode(i.Input.Trim(), true); newnode.ShowPlusMinus = false; parent.Nodes.Add(newnode); parent.Expand(); this.updateKeywords.Checked = true; } } }
private void GetProjectsComplete(BuildBotBuildDefinition[] buildDefinitions) { _ciEntryPointSetting.Url = _url.Text; _ciEntryPointSetting.UserName = _userName.Text; _ciEntryPointSetting.SetPassword(_password.Text); Settings.Save(); _projects.Nodes.Clear(); var BuildBotBuildDefinitions = buildDefinitions.OrderBy(i => i.Name); foreach (BuildBotBuildDefinition project in BuildBotBuildDefinitions) { bool exists = Settings.BuildExistsAndIsActive(_BuildBotCiEntryPoint.Name, project.Name); ThreeStateTreeNode node = new ThreeStateTreeNode(project.Name) { Tag = project, State = exists ? CheckBoxState.Checked : CheckBoxState.Unchecked }; _projects.Nodes.Add(node); } }
private void initTreeView(ThreeStateTreeNode rootNode, ThreeStateTreeNode newNode) { foreach (ThreeStateTreeNode node2 in newNode.Nodes) { if (node2.Tag.Equals("AREA")) { ThreeStateTreeNode node = new ThreeStateTreeNode { Name = node2.Name, Text = node2.AreaName, CarNum = node2.CarNum, SimNum = node2.SimNum, Tag = "AREA" }; rootNode.Nodes.Add(node); this.tvAreaList.hasAreaPath.Add(node2.Name, node); if (node2.Nodes.Count > 0) { this.initTreeView(node, node2); } } } }
private ThreeStateTreeNode newNode(string name) { ThreeStateTreeNode node = new ThreeStateTreeNode(name); if (model.KeywordsChecked.Contains(name)) { node.CheckState = CheckState.Checked; } else if (model.KeywordsUnchecked.Contains(name)) { node.CheckState = CheckState.Unchecked; } else { node.CheckState = CheckState.Indeterminate; } node.Bold = model.KeywordsBold.Contains(name); node.ShowPlusMinus = false; return(node); }
private bool AddSubProjectsAndBuildDefinitions(TeamCityProject project, List <BuildDefinitionSetting> activeBuildDefinitionSettings, TreeNodeCollection treeNodeCollection) { ThreeStateTreeNode node = new ThreeStateTreeNode(project.Name); bool allChildrenChecked = true; foreach (var buildDefinition in project.BuildDefinitions) { var isChecked = AddBuildDefinition(buildDefinition, node, activeBuildDefinitionSettings); allChildrenChecked = allChildrenChecked && isChecked; } foreach (var subProject in project.SubProjects) { var isChecked = AddSubProjectsAndBuildDefinitions(subProject, activeBuildDefinitionSettings, node.Nodes); allChildrenChecked = allChildrenChecked && isChecked; } node.Checked = allChildrenChecked; treeNodeCollection.Add(node); return(node.Checked); }
private void initTreeView() { this.tvAreaList.Nodes.Clear(); this.tvAreaList.hasAreaPath.Clear(); foreach (ThreeStateTreeNode node2 in MainForm.myCarList.tvList.Nodes) { if (node2.Tag.Equals("AREA")) { ThreeStateTreeNode node = new ThreeStateTreeNode { Name = node2.Name, Text = node2.AreaName, CarNum = node2.CarNum, SimNum = node2.SimNum, Tag = "AREA" }; this.tvAreaList.Nodes.Add(node); this.tvAreaList.hasAreaPath.Add(node2.Name, node); if (node2.Nodes.Count > 0) { this.initTreeView(node, node2); } } } }
private void FillKeywordTree() { this.treeKeywords.Nodes.Clear(); ThreeStateTreeNode defaultNode = null; List <string> neededKeywords = new List <string>(); foreach (string s in model.KeywordsChecked) { neededKeywords.Add(s); } foreach (string s in model.KeywordsUnchecked) { neededKeywords.Add(s); } // alle keywords aus den settings in den baum schreiben foreach (string g in Settings.Default.GroupedKeywords.GetGroups()) { ThreeStateTreeNode n = new ThreeStateTreeNode(g); n.HasCheckBox = false; foreach (string v in Settings.Default.GroupedKeywords.GetValues(g)) { n.Nodes.Add(newNode(v)); if (neededKeywords.Contains(v)) { neededKeywords.Remove(v); } } this.treeKeywords.Nodes.Add(n); if (keywordTreeHelper.ExpandNode(n.Text)) { n.Expand(); } if (g == GroupedTagList.DEFAULT_GROUP) { defaultNode = n; } } // keywords die im file sind, aber nicht in den settings in die default grouo schreiben if (neededKeywords.Count != 0) { if (defaultNode == null) { defaultNode = new ThreeStateTreeNode(GroupedTagList.DEFAULT_GROUP); defaultNode.HasCheckBox = false; this.treeKeywords.Nodes.Add(defaultNode); } foreach (string s in neededKeywords) { defaultNode.Nodes.Add(newNode(s)); } if (keywordTreeHelper.ExpandNode(defaultNode.Text)) { defaultNode.Expand(); } } this.treeKeywords.UpdateSelectAllCheckBox(); if (this.treeKeywords.Nodes.Count > 0) { this.treeKeywords.Nodes[0].EnsureVisible(); } if (Settings.Default.CollapseIptcKeywordGroupsOnStartup) { treeKeywords.CollapseAll(); } }