/// <summary> /// Raises the ItemRemoved event /// </summary> /// <param name="e"></param> protected virtual void OnItemRemoved(TreeListViewEventArgs e) { if (ItemRemoved != null) { ItemRemoved(this, e); } }
private void groupGridP4ObjectTreeListView_BeforeExpand(object Sender, TreeListViewEventArgs args) { TreeListViewItem tlvi = args.Node; tlvi.ChildNodes.Clear(); P4.Group group = Scm.GetGroup(tlvi.Name); if (group.UserNames != null) { foreach (string user in group.UserNames) { TreeListViewItem groupMemeber = new TreeListViewItem(); groupMemeber.Name = user; groupMemeber.Text = user; groupMemeber.ImageIndex = 1; tlvi.ChildNodes.Add(groupMemeber); } } if (group.SubGroups != null) { foreach (string subGroup in group.SubGroups) { P4.Group groupSpec = new P4.Group(subGroup); TreeListViewItem groupMemeber = new TreeListViewItem(); groupMemeber.Tag = groupSpec; groupMemeber.Name = subGroup; groupMemeber.Text = subGroup; groupMemeber.ImageIndex = 0; groupMemeber.ChildNodes.Add(new TreeListViewItem()); groupMemeber.Collapse(); tlvi.ChildNodes.Add(groupMemeber); } } }
private void tlvwBreakpoints_ItemChecked(object sender, TreeListViewEventArgs e) { Breakpoint bp = e.Item.Tag as Breakpoint; if (bp != null) { bp.Enabled = e.Item.Checked; } }
private void treeListView1_AfterCollapse(object sender, TreeListViewEventArgs e) { long DBIID = Apq.Convert.ChangeType <long>(e.Item.SubItems[e.Item.ListView.Columns.Count].Text); DataRow[] drs = dsDBC.DBI.Select("DBIID = " + DBIID); if (drs.Length > 0) { drs[0]["_Expanded"] = false; } }
private void _treeView_AfterCollapse(object sender, TreeListViewEventArgs e) { if (e.Item.ImageIndex != 1 && e.Item.ImageIndex != 2) { if (e.Item.IsExpanded) { e.Item.ImageIndex = 3; } else { e.Item.ImageIndex = 0; } } }
void m_tlvList_AfterExpand(object sender, TreeListViewEventArgs e) { if (e.Item.Tag is Device) { Device device = e.Item.Tag as Device; if (e.Item.Items.Count == 1 && e.Item.Items[0].Tag == null && device.Children.Count > 0) { e.Item.Items.Clear(); foreach (Device deviceChildren in device.Children) { TreeListViewItem tlvi = new TreeListViewItem(); FillDeviceListItem(tlvi, deviceChildren); e.Item.Items.Add(tlvi); } } } }
private void treeListView1_AfterCheck(object sender, TreeListViewEventArgs e) { if (e.Action == TreeListViewAction.ByMouse || e.Action == TreeListViewAction.ByKeyboard) { IEntityData entityData; if (treeListView1.SelectedItems.Count <= 0) { return; } TreeListViewItem tlvi = treeListView1.SelectedItems[0]; entityData = tlvi.Tag as IEntityData; if (entityData == null) { return; } List <AssetsData> lstAD = treeListView1.GetLstLeafData(); if (AfterCheck != null) { AfterCheck(lstAD, tlvi.Checked); } } }
/// <summary> /// Raises the ItemRemoved event /// </summary> /// <param name="e"></param> protected virtual void OnItemRemoved(TreeListViewEventArgs e) { if(ItemRemoved != null) ItemRemoved(this, e); }
private void outputtree_AfterCollapse(object sender, TreeListViewEventArgs e) { Controller.SetImages(outputtree, showicon.Checked, ref imageList1); }
internal void CollapseInternal() { if(IsInATreeListView) if(ListView.InvokeRequired) throw(new Exception("Invoke Required")); TreeListViewItem selItem = null; if(TreeListView != null) selItem = TreeListView.FocusedItem; // The item was expanded -> raise an event if(Visible && _isexpanded && ListView != null) { TreeListViewCancelEventArgs e = new TreeListViewCancelEventArgs( this, TreeListViewAction.Collapse); ListView.RaiseBeforeCollapse(e); if(e.Cancel) return; } // Collapse if(this.Visible) foreach(TreeListViewItem item in Items) item.Hide(); // The item was expanded -> raise an event if(Visible && _isexpanded && IsInATreeListView) { this._isexpanded = false; TreeListViewEventArgs e = new TreeListViewEventArgs( this, TreeListViewAction.Collapse); ListView.RaiseAfterCollapse(e); if(AfterCollapse != null) AfterCollapse(this); } this._isexpanded = false; if(IsInATreeListView && selItem != null) { if(selItem.Visible) selItem.Focused = true; else { ListView listview = (ListView) TreeListView; listview.SelectedItems.Clear(); TreeListViewItem[] items = selItem.ParentsInHierarch; for(int i = items.Length - 1; i >= 0; i--) if(items[i].Visible) { items[i].Focused = true; break; } } } }
/// <summary> /// Raises the AfterCollapse event. /// </summary> /// <param name="e"></param> protected virtual void OnAfterCollapse(TreeListViewEventArgs e) { if(AfterCollapse != null) AfterCollapse(this, e); }
/// <summary> /// Raises the AfterExpand event. /// </summary> /// <param name="e"></param> protected virtual void OnAfterExpand(TreeListViewEventArgs e) { if(AfterExpand != null) AfterExpand(this, e); }
/// <summary> /// Expand /// </summary> public void Expand() { // The item wasn't expanded -> raise an event if(Visible && !_isexpanded && ListView != null) { TreeListViewCancelEventArgs e = new TreeListViewCancelEventArgs( this, TreeListViewAction.Expand); ListView.RaiseBeforeExpand(e); if(e.Cancel) return; } if(this.Visible) { Items.ReadWriteLock.AcquireReaderLock(-1); for(int i = Items.Count - 1 ; i >= 0 ;i--) { TreeListViewItem item = this.Items[i]; if(!item.Visible) { ListView LView = this.ListView; LView.Items.Insert( this.Index + 1, item); item.SetIndentation(); } if(item.IsExpanded) item.Expand(); } Items.ReadWriteLock.ReleaseReaderLock(); } // The item wasn't expanded -> raise an event if(Visible && !_isexpanded && ListView != null) { this._isexpanded = true; TreeListViewEventArgs e = new TreeListViewEventArgs( this, TreeListViewAction.Expand); ListView.RaiseAfterExpand(e); if(AfterExpand != null) AfterExpand(this); } this._isexpanded = true; }
internal void CollapseInternal() { if (IsInATreeListView) { if (ListView.InvokeRequired) { throw (new Exception("Invoke Required")); } } TreeListViewItem selItem = null; if (TreeListView != null) { selItem = TreeListView.FocusedItem; } // The item was expanded -> raise an event if (Visible && _isexpanded && ListView != null) { TreeListViewCancelEventArgs e = new TreeListViewCancelEventArgs( this, TreeListViewAction.Collapse); ListView.RaiseBeforeCollapse(e); if (e.Cancel) { return; } } // Collapse if (this.Visible) { foreach (TreeListViewItem item in Items) { item.Hide(); } } // The item was expanded -> raise an event if (Visible && _isexpanded && IsInATreeListView) { this._isexpanded = false; TreeListViewEventArgs e = new TreeListViewEventArgs( this, TreeListViewAction.Collapse); ListView.RaiseAfterCollapse(e); if (AfterCollapse != null) { AfterCollapse(this); } } this._isexpanded = false; if (IsInATreeListView && selItem != null) { if (selItem.Visible) { selItem.Focused = true; } else { ListView listview = (ListView)TreeListView; listview.SelectedItems.Clear(); TreeListViewItem[] items = selItem.ParentsInHierarch; for (int i = items.Length - 1; i >= 0; i--) { if (items[i].Visible) { items[i].Focused = true; break; } } } } }
internal void ExpandInternal() { if(IsInATreeListView) if (ListView.InvokeRequired) throw(new Exception("Invoke Required")); TreeListViewItem selItem = null; if(TreeListView != null) selItem = TreeListView.FocusedItem; // Must set ListView.checkDirection to CheckDirection.None. // Forbid recursively checking. CheckDirection oldDirection = CheckDirection.All; if(ListView != null) { oldDirection = ListView._checkDirection; ListView._checkDirection = CheckDirection.None; } // The item wasn't expanded -> raise an event if(Visible && !_isexpanded && ListView != null) { TreeListViewCancelEventArgs e = new TreeListViewCancelEventArgs( this, TreeListViewAction.Expand); ListView.RaiseBeforeExpand(e); if(e.Cancel) return; } if(Visible) for(int i = Items.Count - 1 ; i >= 0 ;i--) { TreeListViewItem item = this.Items[i]; if(!item.Visible) { ListView LView = this.ListView; LView.Items.Insert( this.Index + 1, item); item.SetIndentation(); } if(item.IsExpanded) item.Expand(); } // The item wasn't expanded -> raise an event if(Visible && !_isexpanded && IsInATreeListView) { this._isexpanded = true; TreeListViewEventArgs e = new TreeListViewEventArgs( this, TreeListViewAction.Expand); ListView.RaiseAfterExpand(e); if (AfterExpand != null) AfterExpand(this); } this._isexpanded = true; // Reset ListView.checkDirection if(IsInATreeListView) ListView._checkDirection = oldDirection; if(TreeListView != null && selItem != null) if(selItem.Visible) selItem.Focused = true; }
internal void RaiseAfterCollapse(TreeListViewEventArgs e) { if(AfterCollapse != null) AfterCollapse(this, e); }
private void fixesLV_BeforeExpand(object Sender, TreeListViewEventArgs args) { P4.Changelist changeToExpand = args.Node.Tag as P4.Changelist; args.Node.ChildNodes.Clear(); if ((changeToExpand.Files == null || changeToExpand.Files.Count == 0) && (changeToExpand.Jobs == null || changeToExpand.Jobs.Count == 0)) { return; } foreach (P4.FileMetaData file in changeToExpand.Files) { IList <object> fields = new List <object>(); fields.Add(file.DepotPath + "#" + file.HeadRev.ToString()); P4FileTreeListViewItem childItem = new P4FileTreeListViewItem(args.Node, file, fields); childItem.Tag = file; if (!(changeToExpand.Pending)) { childItem.LeftImageIndices.Clear(); childItem.RightImageIndices.Clear(); if (file.Action == P4.FileAction.Add || file.Action == P4.FileAction.AddInto || file.Action == P4.FileAction.Added) { childItem.CenterImageIndices.Clear(); childItem.CenterImageIndices.Add(17); //add icon } if (file.Action == P4.FileAction.None) { childItem.CenterImageIndices.Clear(); childItem.CenterImageIndices.Add(18); //archive icon } if (file.Action == P4.FileAction.Branch || file.Action == P4.FileAction.BranchFrom || file.Action == P4.FileAction.BranchInto) { childItem.CenterImageIndices.Clear(); childItem.CenterImageIndices.Add(19); //branch icon } if (file.Action == P4.FileAction.Delete || file.Action == P4.FileAction.DeleteFrom || file.Action == P4.FileAction.DeleteInto) { childItem.CenterImageIndices.Clear(); childItem.CenterImageIndices.Add(20); //delete icon } if (file.Action == P4.FileAction.Edit || file.Action == P4.FileAction.EditFrom || file.Action == P4.FileAction.EditIgnored || file.Action == P4.FileAction.EditInto) { childItem.CenterImageIndices.Clear(); childItem.CenterImageIndices.Add(21); //edit icon } if (file.Action == P4.FileAction.Integrate || file.Action == P4.FileAction.CopyFrom || file.Action == P4.FileAction.CopyInto || file.Action == P4.FileAction.MergeFrom || file.Action == P4.FileAction.MergeInto) { childItem.CenterImageIndices.Clear(); childItem.CenterImageIndices.Add(22); //integrate icon } if (file.Action == P4.FileAction.MoveAdd) { childItem.CenterImageIndices.Clear(); childItem.CenterImageIndices.Add(23); //moveadd icon } if (file.Action == P4.FileAction.MoveDelete) { childItem.CenterImageIndices.Clear(); childItem.CenterImageIndices.Add(24); //movedelete icon } if (file.Action == P4.FileAction.Purge) { childItem.CenterImageIndices.Clear(); childItem.CenterImageIndices.Add(25); //purge icon } } args.Node.ChildNodes.Add(childItem); } if (changeToExpand.Jobs != null) { foreach (KeyValuePair <string, string> job in changeToExpand.Jobs) { IList <object> fields = new List <object>(); fields.Add(job.Key); P4FileTreeListViewItem childItem = new P4FileTreeListViewItem(args.Node, null, fields); childItem.CenterImageIndices.Clear(); childItem.LeftImageIndices.Clear(); childItem.RightImageIndices.Clear(); childItem.CenterImageIndices.Add(16); //job icon args.Node.ChildNodes.Add(childItem); } } }
internal void RaiseAfterExpand(TreeListViewEventArgs e) { if(AfterExpand != null) AfterExpand(this, e); }
internal void RaiseAfterCollapse(TreeListViewEventArgs e) { OnAfterCollapse(e); }
internal void ExpandInternal() { if (IsInATreeListView) { if (ListView.InvokeRequired) { throw (new Exception("Invoke Required")); } } TreeListViewItem selItem = null; if (TreeListView != null) { selItem = TreeListView.FocusedItem; } // Must set ListView.checkDirection to CheckDirection.None. // Forbid recursively checking. CheckDirection oldDirection = CheckDirection.All; if (ListView != null) { oldDirection = ListView._checkDirection; ListView._checkDirection = CheckDirection.None; } // The item wasn't expanded -> raise an event if (Visible && !_isexpanded && ListView != null) { TreeListViewCancelEventArgs e = new TreeListViewCancelEventArgs( this, TreeListViewAction.Expand); ListView.RaiseBeforeExpand(e); if (e.Cancel) { return; } } if (Visible) { for (int i = Items.Count - 1; i >= 0; i--) { TreeListViewItem item = this.Items[i]; if (!item.Visible) { ListView LView = this.ListView; LView.Items.Insert( this.Index + 1, item); item.SetIndentation(); } if (item.IsExpanded) { item.Expand(); } } } // The item wasn't expanded -> raise an event if (Visible && !_isexpanded && IsInATreeListView) { this._isexpanded = true; TreeListViewEventArgs e = new TreeListViewEventArgs( this, TreeListViewAction.Expand); ListView.RaiseAfterExpand(e); if (AfterExpand != null) { AfterExpand(this); } } this._isexpanded = true; // Reset ListView.checkDirection if (IsInATreeListView) { ListView._checkDirection = oldDirection; } if (TreeListView != null && selItem != null) { if (selItem.Visible) { selItem.Focused = true; } } }
internal void RaiseAfterExpand(TreeListViewEventArgs e) { OnAfterExpand(e); }
private void treeListView1_AfterExpand(object sender, TreeListViewEventArgs e) { }
/// <summary> /// Collapse /// </summary> public void Collapse() { // The item was expanded -> raise an event if(Visible && _isexpanded && ListView != null) { TreeListViewCancelEventArgs e = new TreeListViewCancelEventArgs( this, TreeListViewAction.Collapse); ListView.RaiseBeforeCollapse(e); if(e.Cancel) return; } // Collapse Items.ReadWriteLock.AcquireReaderLock(-1); if(this.Visible) foreach(TreeListViewItem item in Items) item.Hide(); Items.ReadWriteLock.ReleaseReaderLock(); // The item was expanded -> raise an event if(Visible && _isexpanded && ListView != null) { this._isexpanded = false; TreeListViewEventArgs e = new TreeListViewEventArgs( this, TreeListViewAction.Collapse); ListView.RaiseAfterCollapse(e); if(AfterCollapse != null) AfterCollapse(this); } this._isexpanded = false; }