RevitLookup.Snoop.Forms.Objects.AddObjectsToTree C# (CSharp) Method

AddObjectsToTree() protected method

protected AddObjectsToTree ( IEnumerable objs ) : void
objs IEnumerable
return void
        protected void AddObjectsToTree( IEnumerable objs )
        {
            m_tvObjs.Sorted = true;

              // initialize the tree control
              foreach( Object tmpObj in objs )
              {
            // hook this up to the correct spot in the tree based on the object's type
            TreeNode parentNode = GetExistingNodeForType( tmpObj.GetType() );
            if( parentNode == null )
            {
              parentNode = new TreeNode( tmpObj.GetType().Name );
              m_tvObjs.Nodes.Add( parentNode );

              // record that we've seen this one
              m_treeTypeNodes.Add( parentNode );
              m_types.Add( tmpObj.GetType() );
            }

            // add the new node for this element
            TreeNode tmpNode = new TreeNode( Snoop.Utils.ObjToLabelStr( tmpObj ) );
            tmpNode.Tag = tmpObj;
            parentNode.Nodes.Add( tmpNode );
              }
        }