/// <summary>
    /// Run the code example.
    /// </summary>
    /// <param name="user">The Dfa user object running the code example.
    /// </param>
    public override void Run(DfaUser user) {
      // Create CreativeRemoteService instance.
      ContentCategoryRemoteService service = (ContentCategoryRemoteService) user.GetService(
          DfaService.v1_20.ContentCategoryRemoteService);

      String searchString = _T("INSERT_SEARCH_STRING_CRITERIA_HERE");

      // Create content category search criteria structure.
      ContentCategorySearchCriteria searchCriteria = new ContentCategorySearchCriteria();
      searchCriteria.pageSize = 10;
      searchCriteria.searchString = searchString;

      try {
        // Get content category record set.
        ContentCategoryRecordSet contentCategoryRecordSet =
            service.getContentCategories(searchCriteria);

        // Display content category names, ids and descriptions.
        if (contentCategoryRecordSet != null && contentCategoryRecordSet.records != null) {
          foreach (ContentCategory contentCategory in contentCategoryRecordSet.records) {
            Console.WriteLine("Content category with name \"{0}\" and id \"{1}\" was found.",
                contentCategory.name, contentCategory.id);
          }
        } else {
          Console.WriteLine("No content categories found for your search criteria.");
        }
      } catch (Exception ex) {
        Console.WriteLine("Failed to get content categories. Exception says \"{0}\"",
            ex.Message);
      }
    }
Пример #2
0
 public ContentCategoryRecordSet getContentCategories(ContentCategorySearchCriteria searchCriteria) {
   object[] results = this.Invoke("getContentCategories", new object[] {searchCriteria});
   return ((ContentCategoryRecordSet) (results[0]));
 }