예제 #1
0
 public override bool ItemExpandable(NSOutlineView outlineView, NSObject item)
 {
     if (item != null)
     {
         try {
             ScopeNode passedNode = item as ScopeNode;                     // cast to appropriate type of node
             if (passedNode != null)
             {
                 return(passedNode.NumberOfChildren() != 0);
             }
             else
             {
                 System.Diagnostics.Debug.WriteLine("passedNode cast failed.");
                 return(false);
             }
         } catch (Exception e) {
             System.Diagnostics.Debug.WriteLine(e);
             return(false);
         }
     }
     else
     {
         // if null, it's asking about the root element
         return(true);
     }
 }
예제 #2
0
 public override bool ItemExpandable(NSOutlineView outlineView, NSObject item)
 {
     if (item != null && (item is UsersNode || item is SolutionUsersNode || item is GroupsNode || item is TrustedCertificateNode ||
                          item is RelyingPartyNode || item is OidcClientNode || item is IdentityProvidersNode))
     {
         return(false);
     }
     if (item is ScopeNode)
     {
         ScopeNode passedNode = item as ScopeNode;                 // cast to appropriate type of node
         return(passedNode.NumberOfChildren() != 0);
     }
     return(true);
 }
예제 #3
0
 public override nint GetChildrenCount(NSOutlineView outlineView, NSObject item)
 {
     // if null, it's asking about the root element
     if (item == null)
     {
         return(1);
     }
     else
     {
         ScopeNode passedNode = item as ScopeNode;
         if (passedNode != null)
         {
             return(passedNode.NumberOfChildren());
         }
         else
         {
             System.Diagnostics.Debug.WriteLine("could not cast, there is a problem here");
             return(0);
         }
     }
 }