/// <summary>
 /// Recursively expands a group in the treelistview
 /// control until it cannot expand further
 /// </summary>
 /// <param name="ienum">The successive children to check for expansion</param>
 internal void RecursiveExpand(IEnumerable ienum)
 {
     foreach (var m in from object m in ienum where TlvControl.CanExpand(m) select m)
     {
         TlvControl.Expand(m);
         RecursiveExpand(TlvControl.GetChildren(m));
     }
 }
예제 #2
0
        public static void ExpandToObject(this TreeListView tlv, object obj)
        {
            object parent = tlv.GetParent(obj);

            if (parent != null && !tlv.IsExpanded(parent))
            {
                ExpandToObject(tlv, parent);
                tlv.Expand(parent);
            }
        }
 public static void DeployBuild(Form form, TreeListView listView, ITargetDevice device)
 {
     if (form.InvokeRequired)
     {
         var d = new DeployBuildDelegate(DeployBuild);
         form.Invoke(d, new object[] { form, listView, device });
     }
     else
     {
         listView.SelectedObject = device;
         listView.Expand(device);
         listView.RefreshSelectedObjects(); // RefreshObject(device);
     }
 }
 public static void UpdateDeviceDeploymentProgress(Form form, TreeListView listView, ITargetDevice device)
 {
     if (form.InvokeRequired)
     {
         var d = new UpdateDeviceDeploymentProgressDelegate(UpdateDeviceDeploymentProgress);
         form.Invoke(d, new object[] { form, listView, device });
     }
     else
     {
         //listView.SelectedObject = device;
         device.Build.Progress++;
         listView.RefreshObject(device);
         listView.Expand(device);
     }
 }
예제 #5
0
 private void GetData(TreeListView olv)
 {
     try
     {
         pbrProgress.Visible = true;
         olv.BeginUpdate();
         olv.Items.Clear();
         olv.CanExpandGetter = delegate(object SB) { return(((StaffBranch)SB).Children.Count > 0); };
         olv.ChildrenGetter  = delegate(object SB) { return(((StaffBranch)SB).Children); };
         olv.Roots           = GetAnalysisTree();
         olv.Expand(olv.TreeModel.GetNthObject(0));
         olv.EndUpdate();
         lblRecord.Text      = "0 z " + olv.Items.Count;
         olv.Enabled         = olv.Items.Count > 0 ? true : false;
         pbrProgress.Visible = false;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
예제 #6
0
        void _activator_Emphasise(object sender, EmphasiseEventArgs args)
        {
            var rootObject = _activator.GetRootObjectOrSelf(args.Request.ObjectToEmphasise);

            // unpin first if there is somthing pinned, so we find our object!
            if (_pinFilter != null && _activator.IsRootObjectOfCollection(_collection, rootObject))
            {
                _pinFilter.UnApplyToTree();
            }

            //get the parental hierarchy
            var decendancyList = CoreChildProvider.GetDescendancyListIfAnyFor(args.Request.ObjectToEmphasise);

            if (decendancyList != null)
            {
                //for each parent in the decendandy list
                foreach (var parent in decendancyList.Parents)
                {
                    //parent isn't in our tree
                    if (Tree.IndexOf(parent) == -1)
                    {
                        return;
                    }

                    //parent is in our tree so make sure it's expanded
                    Tree.Expand(parent);
                }
            }

            //tree doesn't contain object even after expanding parents
            int index = Tree.IndexOf(args.Request.ObjectToEmphasise);

            if (index == -1)
            {
                return;
            }

            if (args.Request.ExpansionDepth > 0)
            {
                try
                {
                    Tree.BeginUpdate();
                    ExpandToDepth(args.Request.ExpansionDepth, args.Request.ObjectToEmphasise);
                }
                finally
                {
                    Tree.EndUpdate();
                }
            }

            if (args.Request.Pin && Settings.AllowPinning)
            {
                Pin(args.Request.ObjectToEmphasise, decendancyList);
            }

            //update index now pin filter is applied
            index = Tree.IndexOf(args.Request.ObjectToEmphasise);

            //select the object and ensure it's visible
            Tree.SelectedObject = args.Request.ObjectToEmphasise;
            Tree.EnsureVisible(index);


            args.Sender = Tree.FindForm();
        }
예제 #7
0
 public static void InvokeExpand(this TreeListView control, object model)
 {
     control.Invoke(() => control.Expand(model));
 }