/// <summary>
    /// Run the code example.
    /// </summary>
    /// <param name="user">The DFP user object running the code example.</param>
    public override void Run(DfpUser user) {
      // Create the CreativeWrapperService.
      CreativeWrapperService creativeWrapperService = (CreativeWrapperService) user.GetService(
          DfpService.v201302.CreativeWrapperService);

      long labelId = long.Parse(_T("INSERT_CREATIVE_WRAPPER_LABEL_ID_HERE"));

      // Create creative wrapper objects.
      CreativeWrapper creativeWrapper = new CreativeWrapper();
      creativeWrapper.labelId = labelId;
      creativeWrapper.ordering = CreativeWrapperOrdering.INNER;
      creativeWrapper.header = new CreativeWrapperHtmlSnippet();
      creativeWrapper.header.htmlSnippet = "<b>My creative wrapper header</b>";
      creativeWrapper.footer = new CreativeWrapperHtmlSnippet();
      creativeWrapper.footer.htmlSnippet = "<b>My creative wrapper footer</b>";

      try {
        // Add creative wrapper.
        CreativeWrapper[] creativeWrappers = creativeWrapperService.createCreativeWrappers(
            new CreativeWrapper[] {creativeWrapper});

        // Display results.
        foreach (CreativeWrapper wrapper in creativeWrappers) {
          Console.WriteLine("Creative wrapper with ID \'{0}\' applying to label \'{1}\' was " +
              "created.", wrapper.id, wrapper.labelId);
        }
      } catch (Exception ex) {
        Console.WriteLine("Failed to create creative wrappers. Exception says \"{0}\"", ex.Message);
      }
    }
Ejemplo n.º 2
0
 public CreativeWrapper updateCreativeWrapper(CreativeWrapper creativeWrapper)
 {
     object[] results = this.Invoke("updateCreativeWrapper", new object[] { creativeWrapper });
       return ((CreativeWrapper) (results[0]));
 }