IndexOf() public méthode

public IndexOf ( TreeNode node ) : int
node TreeNode
Résultat int
Exemple #1
0
 void Apply( TypeAnalied type, TreeNodeCollection tnc )
 {
     if ( type.Parent == null ) {
         foreach ( TreeNode v in tnc ) {
             if ( v.Text == type.Source.Namespace ) {
                 tnc = v.Nodes;
                 break;
             }
             if ( tnc.IndexOf( v ) == tnc.Count - 1 ) {
                 tnc = tnc.Add( type.Source.Namespace ).Nodes;
                 break;
             }
         }
         if ( tnc.Count == 0 )
             tnc = tnc.Add( type.Source.Namespace ).Nodes;
     }
     TreeNode node = new TreeNode( type.Source.Name );
     tnc.Add( node );
     foreach ( VariableAnalied var_ana in type.Variables )
         Apply( var_ana, node.Nodes );
     foreach ( MethodAnalied var_ana in type.Methods )
         Apply( var_ana, node.Nodes );
     foreach ( TypeAnalied typ_ana in type.Types )
         Apply( typ_ana, node.Nodes );
 }
Exemple #2
0
 void add_nodes( TreeNodeCollection nodes, ArrayList l, int param )
 {
     foreach( object o in l ) {
         int icon = param >= 0 ? param : UMLDes.GUI.IconUtility.IconForElement( (UmlObject)o );
         TreeNode t = new TreeNode( getName(o), icon, icon );
         t.Tag = new NodeTag( o );
         if( param == 1 ) {
             int i = nodes.IndexOf( refs );
             nodes.Insert( i >= 0 ? i : nodes.Count, t );
         } else
             nodes.Add( t );
     }
 }