/// <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 CreativeFieldRemoteService instance.
              CreativeFieldRemoteService service = (CreativeFieldRemoteService) user.GetService(
              DfaService.v1_20.CreativeFieldRemoteService);

              String searchString = _T("INSERT_SEARCH_STRING_CRITERIA_HERE");

              // Set up creative field search criteria structure.
              CreativeFieldSearchCriteria creativeFieldSearchCriteria = new CreativeFieldSearchCriteria();
              creativeFieldSearchCriteria.pageSize = 10;
              creativeFieldSearchCriteria.searchString = searchString;

              try {
            // Get creative fields for the selected criteria.
            CreativeFieldRecordSet creativeFields =
            service.getCreativeFields(creativeFieldSearchCriteria);

            // Display creative field names, ids, advertiser ids, and number of values.
            if (creativeFields != null && creativeFields.records != null) {
              foreach (CreativeField creativeField in creativeFields.records) {
            Console.WriteLine("Creative field with name \"{0}\", id \"{1}\", Advertiser id " +
                "\"{2}\", and containing \"{3}\" values was found.", creativeField.name,
                creativeField.id, creativeField.advertiserId, creativeField.totalNumberOfValues);
              }
            } else {
              Console.WriteLine("No creative fields found for your search criteria");
            }
              } catch (Exception e) {
            Console.WriteLine("Failed to retrieve creative fields. Exception says \"{0}\"",
            e.Message);
              }
        }
示例#2
0
 public CreativeFieldRecordSet getCreativeFields(CreativeFieldSearchCriteria creativeFieldSearchCriteria) {
   object[] results = this.Invoke("getCreativeFields", new object[] {creativeFieldSearchCriteria});
   return ((CreativeFieldRecordSet) (results[0]));
 }