hasLink() публичный Метод

Determins if a Resource currently has a link.
public hasLink ( string name ) : bool
name string Link to check
Результат bool
Пример #1
0
 /// <summary>
 /// Fetches a link from the API as a Collection.
 /// </summary>
 /// <param name="resource">Resource object which contains links.</param>
 /// <param name="linkName">Link name to return.</param>
 /// <exception cref="NotFoundException"/>
 /// <returns>Collection from Resource</returns>
 public Collection fetchLinkAsCollection(Resource resource, string linkName)
 {
     if (resource.hasLink(linkName))
     {
         gdapi.WebRequest rRequestor = new gdapi.WebRequest(this);
         rRequestor.setType("GET");
         rRequestor.setUrl(resource.getLink(linkName));
         return(getCollectionByRequest(rRequestor));
     }
     else
     {
         return(null);
     }
 }
Пример #2
0
 /// <summary>
 /// Fetches a link from the API as a Resource.
 /// </summary>
 /// <param name="resource">Resource object which contains links.</param>
 /// <param name="linkName">Link name to return.</param>
 /// <exception cref="NotFoundException"/>
 /// <returns>Resource from Resource</returns>
 public Resource fetchLinkAsResource(Resource resource, string linkName)
 {
     if (resource.hasLink(linkName))
     {
         gdapi.WebRequest rRequestor = new gdapi.WebRequest(this);
         rRequestor.setType("GET");
         rRequestor.setUrl(resource.getLink(linkName));
         return getResourceByRequest(rRequestor);
     }
     else
     {
         return null;
     }
 }