Esempio n. 1
0
 public override bool ItemExpandable(NSOutlineView outlineView, NSObject item)
 {
     if (item != null)
     {
         ScopeNodeBase passedNode = item as ScopeNodeBase; // cast to appropriate type of node
         if (passedNode != null)
         {
             return(passedNode.NumberOfChildren() != 0);
         }
         else
         {
             return(false);
         }
     }
     else
     {
         // if null, it's asking about the root element
         return(true);
     }
 }
Esempio n. 2
0
 public override nint GetChildrenCount(NSOutlineView outlineView, NSObject item)
 {
     // if null, it's asking about the root element
     if (item == null)
     {
         return(1);
     }
     else
     {
         ScopeNodeBase passedNode = item as ScopeNodeBase;
         if (passedNode != null)
         {
             return(passedNode.NumberOfChildren());
         }
         else
         {
             return(0);
         }
     }
 }