public IAsyncResult BeginGetMediaSlots(GetMediaSlotsRequest GetMediaSlotsRequest, AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetMediaSlots", new object[1] { (object) GetMediaSlotsRequest }, callback, asyncState); }
public IList<mediaSlotItem> GetMediaSlots(sessionType session, int? adspaceId, int? width, int? height, int? format, int items, int page, out int total) { GetMediaSlotsRequest GetMediaSlotsRequest = new GetMediaSlotsRequest(); DateTime utcNow = DateTime.UtcNow; GetMediaSlotsRequest.nonce = Signature.GetNonce(); GetMediaSlotsRequest.connectId = session.connectId; GetMediaSlotsRequest.signature = Signature.SoapSignature(utcNow, session.secretKey, "publisherservice", "getmediaslots", GetMediaSlotsRequest.nonce); GetMediaSlotsRequest.timestamp = Signature.GetZDateTime(utcNow); GetMediaSlotsRequest.items = items; GetMediaSlotsRequest.itemsSpecified = true; GetMediaSlotsRequest.page = page; GetMediaSlotsRequest.adspaceIdSpecified = true; if (adspaceId.HasValue) { GetMediaSlotsRequest.adspaceId = adspaceId.Value; GetMediaSlotsRequest.adspaceIdSpecified = true; } GetMediaSlotsRequest.size = new sizeType(); if (height.HasValue) { GetMediaSlotsRequest.size.height = height.Value; GetMediaSlotsRequest.size.heightSpecified = true; } if (width.HasValue) { GetMediaSlotsRequest.size.width = width.Value; GetMediaSlotsRequest.size.widthSpecified = true; } if (format.HasValue) { GetMediaSlotsRequest.size.format = new subStringIdentifierType(); GetMediaSlotsRequest.size.format.id = format.Value; } GetMediaSlotsResponse mediaSlots = this.publisherService.GetMediaSlots(GetMediaSlotsRequest); if (mediaSlots == null) { total = 0; return (IList<mediaSlotItem>) null; } else if (mediaSlots.mediaSlotItems == null) { total = 0; return (IList<mediaSlotItem>) null; } else { total = (int) mediaSlots.total; return (IList<mediaSlotItem>) Enumerable.ToList<mediaSlotItem>((IEnumerable<mediaSlotItem>) mediaSlots.mediaSlotItems); } }