Esempio n. 1
0
 /// <summary>
 /// Raises the AfterCollapse event.
 /// </summary>
 /// <param name="e"></param>
 protected virtual void OnAfterCollapse(TreeListViewEventArgs e)
 {
     if(AfterCollapse != null) AfterCollapse(this, e);
 }
Esempio n. 2
0
 /// <summary>
 /// Raises the AfterExpand event.
 /// </summary>
 /// <param name="e"></param>
 protected virtual void OnAfterExpand(TreeListViewEventArgs e)
 {
     if(AfterExpand != null) AfterExpand(this, e);
 }
Esempio n. 3
0
 internal void RaiseAfterCollapse(TreeListViewEventArgs e)
 {
     OnAfterCollapse(e);
 }
Esempio n. 4
0
 internal void RaiseAfterExpand(TreeListViewEventArgs e)
 {
     OnAfterExpand(e);
 }
 /// <summary>
 /// Raises the ItemRemoved event
 /// </summary>
 /// <param name="e"></param>
 protected virtual void OnItemRemoved(TreeListViewEventArgs e)
 {
     if(ItemRemoved != null) ItemRemoved(this, e);
 }
Esempio n. 6
0
 private void outputtree_AfterExpand(object sender, TreeListViewEventArgs e)
 {
     Controller.SetImages(outputtree, showicon.Checked, ref imageList1);
 }
Esempio n. 7
0
		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;
			}
		}
Esempio n. 8
0
        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;
        }
Esempio n. 9
0
        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;
                        }
                }
            }
        }