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

              int width = int.Parse(_T("INSERT_WIDTH_HERE"));
              int height = int.Parse(_T("INSERT_HEIGHT_HERE"));

              SizeSearchCriteria criteria = new SizeSearchCriteria();
              criteria.width = width;
              criteria.height = height;

              try {
            // Get size.
            SizeRecordSet sizeRecords = service.getSizes(criteria);

            if (sizeRecords.records != null) {
              foreach (Size size in sizeRecords.records) {
            // Display size id.
            Console.WriteLine("Size id for \"{0}\" width and \"{1}\" height is \"{2}\".",
                size.width, size.height, size.id);
              }
            }
              } catch (Exception e) {
            Console.WriteLine("Failed to retrieve size. Exception says \"{0}\"", e.Message);
              }
        }
示例#2
0
 public SizeRecordSet getSizes(SizeSearchCriteria searchCriteria) {
   object[] results = this.Invoke("getSizes", new object[] {searchCriteria});
   return ((SizeRecordSet) (results[0]));
 }