/* * public void addChild(VirtualTreeRow row) * { * Children.Add(row); * row.Parent = this; * } */ /* * private bool containsItem(String nodevalue) * { * foreach(VirtualTreeRow row in Children) * { * if (row.NodeValue == nodevalue) * { * return true; * } * } * return false; * } */ private void addData(String nodename, String nodevalue, VirtualGridHeaderColumn headercolumn, VirtualGridRow baserow) { if ((!String.IsNullOrEmpty(nodevalue)) && (!children.ContainsKey(nodevalue))) { VirtualTreeRow tr = new VirtualTreeRow(Grid, headercolumn.ColumnName, nodevalue); tr.HeaderColumn = headercolumn; //TODO in constructor tr.Parent = this; tr.BaseRow = baserow; Children.Add(nodevalue, tr); } }
// private void addRow(VirtualGridRow row) // { // if (!Rows.Contains(row)) // { // //String val = row.getData(this.HeaderColumn); // //if (dt.Equals( // //Rows.Add(row); // } // } private static void clearCache(VirtualTreeRow row, bool recursiv) { row.clearRows(); row.clearChildren(); if (recursiv) { if (row.Children != null) { foreach (KeyValuePair <String, VirtualTreeRow> kp in row.Children) { VirtualTreeRow rw = kp.Value; clearCache(rw, recursiv); } } } }
//DL rempixbuf // protected bool renderImage(VirtualTreeRow row, VirtualTreeRow childrow) // { //// if ((row.Cells[0].CustomOption != null) && (row.Cells[0].CustomOption.Equals("nopic"))) //// { //// return false; //// } // if (childrow.BaseRow != null) // { // VirtualGridCell cell = childrow.BaseRow.getCell(row.HeaderColumn); // if (cell != null) // { // if (cell.CustomOption.Equals("nopic",StringComparison.OrdinalIgnoreCase)) // { // return false; // } // } // } // // if (row.HeaderColumn.CustomOption.Equals("pixbuf", StringComparison.OrdinalIgnoreCase)) // { // return true; // } // return false; // } protected void addData(Gtk.TreeStore store, Gtk.TreeIter iter, VirtualTreeRow row, bool withiter) { //Console.WriteLine("->" + row.NodeValue); //store.AppendValues(row.Data); foreach (KeyValuePair<String,VirtualTreeRow> kp in row.Children) { //GroupedChildRows grp = kp.Value; VirtualTreeRow childrow = kp.Value; Gtk.TreeIter it; bool wi = withiter; if (! withiter) { //DL rempixbuf // if (renderImage(row, childrow)) // { // it = store.AppendValues(childrow.DataWithImage); // // wi = true; // } //else { it = store.AppendValues(childrow.Data); wi = true; } } else { // if (renderImage(row, childrow)) // { // it = store.AppendValues(iter, childrow.DataWithImage); // } // else // { // // } it = store.AppendValues(iter, childrow.Data); } addData(store,it,childrow,wi); } //foreach //add the data into a row if (row.HeaderColumn.ChildColumn == null) { //startStopWatch("AppendValues"); if ((row.Rows != null) && (row.Rows.Count > 1)) //TODO Count > 1 check .. or option ?? { //foreach (VirtualGridRow vr in row.Rows) int idx = 0; if (SkipFirstChildrow) { idx = 1; } for (int i=idx;i<row.Rows.Count;i++) { VirtualGridRow vr = row.Rows[i]; //DL rempixbuf // bool tmp = LoadPixBuf; // if (!PixBufInRow) // { // LoadPixBuf = false; // } store.AppendValues(iter,vr.Datas); //DL rempixbuf //LoadPixBuf = tmp; } } //stopStopWatch("AppendValues"); } }
/* public void addChild(VirtualTreeRow row) { Children.Add(row); row.Parent = this; } */ /* private bool containsItem(String nodevalue) { foreach(VirtualTreeRow row in Children) { if (row.NodeValue == nodevalue) { return true; } } return false; } */ private void addData(String nodename, String nodevalue, VirtualGridHeaderColumn headercolumn,VirtualGridRow baserow) { if ((!String.IsNullOrEmpty(nodevalue)) && (!children.ContainsKey(nodevalue))) { VirtualTreeRow tr = new VirtualTreeRow(Grid, headercolumn.ColumnName, nodevalue); tr.HeaderColumn = headercolumn; //TODO in constructor tr.Parent = this; tr.BaseRow = baserow; Children.Add(nodevalue,tr); } }
// private void addRow(VirtualGridRow row) // { // if (!Rows.Contains(row)) // { // //String val = row.getData(this.HeaderColumn); // //if (dt.Equals( // //Rows.Add(row); // } // } private static void clearCache(VirtualTreeRow row, bool recursiv) { row.clearRows(); row.clearChildren(); if (recursiv) { if (row.Children != null) { foreach (KeyValuePair<String, VirtualTreeRow> kp in row.Children) { VirtualTreeRow rw = kp.Value; clearCache(rw,recursiv); } } } }
// public VirtualGridRow GetSelectedGridRow() // { // TreePosition tp = Tree.SelectedRow; // // foreach (VirtualGridRow row in Rows) // { // TreeNavigator tn = DataStore.GetNavigatorAt (tp); // //DataStore. // //VirtualGridRow rw = (VirtualGridRow)GetValue(tn,""); // //tn.GetValue( // } // return null; // } public void addData(TreeNavigator navigator, VirtualTreeRow row) { if (navigator == null) { throw new ArgumentNullException("navigator"); } if (row == null) { throw new ArgumentNullException("row"); } //add children if ((row.Children != null) && (row.Children.Count > 0)) { TreeNavigator current = navigator; int idx = 0; foreach (KeyValuePair<String,VirtualTreeRow> kp in row.Children) { if (idx > 0) { current.InsertAfter(); } setData(current,kp.Value.Data); if (kp.Value.Children.Count > 0) { addData(current.AddChild(),kp.Value); current.MoveToParent(); } else { if (kp.Value.Rows.Count > 0) { addData(current.AddChild(),kp.Value); current.MoveToParent(); } } idx++; } } //if no children available add the assigned rows if ((row.Children == null) || (row.Children.Count < 1)) { int idx = 0; foreach (VirtualGridRow rw in row.Rows) { if (idx > 0) { navigator.InsertAfter(); } setData(navigator,rw.Datas); idx++; } } }