/// <summary> /// Deletes the Ad. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='id'> /// id of the Ad /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Ad> DeleteAdAsync(this IAds operations, long id, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.DeleteAdWithHttpMessagesAsync(id, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Return all Ads from data source. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IList <Ad> > GetAdsAsync(this IAds operations, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetAdsWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
private void SetUpOffer(IAds textAd, IAds graphAd, Agency agency) { agency.Overdue(agency.factory, new Random(Guid.NewGuid().GetHashCode())); agency.Accept(textAd); agency.Accept(graphAd); }
public override void Accept(IAds ads) { ads.getting(this); }
public abstract void Accept(IAds ads);
/// <summary> /// Create new or updated existent Ad. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='ad'> /// New or existent Ad /// </param> public static Ad PostAd(this IAds operations, Ad ad) { return(Task.Factory.StartNew(s => ((IAds)s).PostAdAsync(ad), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Return all Ads from data source. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> public static IList <Ad> GetAds(this IAds operations) { return(Task.Factory.StartNew(s => ((IAds)s).GetAdsAsync(), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Put updated Ad. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='id'> /// id of the Ad /// </param> /// <param name='ad'> /// Existent Ad /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task PutAdAsync(this IAds operations, long id, Ad ad, CancellationToken cancellationToken = default(CancellationToken)) { await operations.PutAdWithHttpMessagesAsync(id, ad, null, cancellationToken).ConfigureAwait(false); }
/// <summary> /// Put updated Ad. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='id'> /// id of the Ad /// </param> /// <param name='ad'> /// Existent Ad /// </param> public static void PutAd(this IAds operations, long id, Ad ad) { Task.Factory.StartNew(s => ((IAds)s).PutAdAsync(id, ad), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); }
public Ads() { ac = DataAccess.CreateAds(); }
/** * Set the delegate implementation. * * @param _delegate The delegate implementing platform specific functions. */ public void SetDelegate(IAds _delegate) { this._delegate = _delegate; }
/** * Constructor with delegate. * * @param _delegate The delegate implementing platform specific functions. */ public AdsBridge(IAds _delegate) : base() { this._delegate = _delegate; }
public Ads() { ac = DataAccess.CreateAds(); }