public dynamic ToSafeExpandedWireFormat(AmazonUtilities amazon)
 {
     var result = ToBaseWireFormat();
     result.images = JsonConvert.DeserializeObject<IEnumerable<Image>>(ImagesJson ?? "[]");
     result.purchase_urls = new[] { amazon.CreateAssociateLink(Asin) };
     return result;
 }
        public SynchronizerBase(Configuration config, TelemetryClient telemetryClient)
        {
            if(telemetryClient == null)
                throw new ArgumentNullException("Telemetry client cannot be null.");

            _telemetryClient = telemetryClient;
            _config = config;
            _amazonClient = new AmazonUtilities(_config.AmazonAccessKey, _config.AmazonSecretKey, _config.AmazonAssociateTag);
            _watch = new Stopwatch();
            _telemetryClient.TrackEvent("Synchronization System Initialized ...");
        }
 public void Dispose(bool disposing)
 {
     if (disposing && !_disposed)
     {
         //cleanup
         Stop();
         _amazonClient = null;
         _watch = null;
         //_telemetryClient.Flush();
         _disposed = true;
     }
 }
 public dynamic ToUnsafeExpandedWireFormat(AmazonUtilities amazon)
 {
     var result = ToSafeExpandedWireFormat(amazon);
     result.tags = Tags.Select(productTag => productTag.Tag).Select(tag => tag.ToSafeExpandedWireFormat()).ToList();
     return result;
 }