/// <summary> /// Constructor. /// </summary> /// <param name="progressType">Progress type - e.g. downloading cabs.</param> /// <param name="product">The owning product.</param> /// <param name="currentPage">The current page being downloaded.</param> /// <param name="totalPages">Total pages to download.</param> public WinQualProgressEventArgs(WinQualProgressType progressType, StackHashProductInfo product, int currentPage, int totalPages) { m_ProgressType = progressType; m_Product = product; m_TotalPages = totalPages; m_CurrentPage = currentPage; }
/// <summary> /// Constructor. /// </summary> /// <param name="progressType">Progress type - e.g. downloading cabs.</param> /// <param name="product">The owning product.</param> public WinQualProgressEventArgs(WinQualProgressType progressType, StackHashProductInfo product) { m_ProgressType = progressType; m_Product = product; m_TotalPages = 0; m_CurrentPage = 0; }
/// <summary> /// Constructor. /// </summary> /// <param name="progressType">Progress type - e.g. downloading cabs.</param> /// <param name="product">The owning product.</param> /// <param name="file">The owning file.</param> /// <param name="theEvent">The owning event.</param> /// <param name="cab">The cab being downloaded.</param> /// <param name="currentPage">The current page being downloaded.</param> /// <param name="totalPages">Total pages to download.</param> public WinQualProgressEventArgs(WinQualProgressType progressType, StackHashProductInfo product, StackHashFile file, StackHashEvent theEvent, StackHashCab cab, int currentPage, int totalPages) { m_ProgressType = progressType; m_Product = product; m_File = file; m_Event = theEvent; m_Cab = cab; m_TotalPages = totalPages; m_CurrentPage = currentPage; }
/// <summary> /// WinQual product wrapper class /// </summary> /// <param name="productInfo">StackHashProductInfo</param> public DisplayProduct(StackHashProductInfo productInfo) { if (productInfo == null) { throw new ArgumentNullException("productInfo"); } if (productInfo.Product == null) { throw new ArgumentNullException("productInfo", "productInfo.Product is null"); } _productInfo = productInfo; UpdateNameAndVersion(); UpdateDisplayFilter(); }
private void onProgress(WinQualProgressType progressType, StackHashProduct product) { EventHandler <WinQualProgressEventArgs> handler = Progress; StackHashProductInfo productInfo = null; if (product != null) { productInfo = new StackHashProductInfo(product, !isExcludedProduct(product.Id), m_ErrorIndex.GetLastSyncTimeLocal(product.Id).ToUniversalTime(), new StackHashProductSyncData(), new DateTime(0, DateTimeKind.Utc), new DateTime(0, DateTimeKind.Utc)); } handler(this, new WinQualProgressEventArgs(progressType, productInfo)); }
/// <summary> /// Reports event page progress for the sync. /// </summary> /// <param name="progressType">The type of progress being reported.</param> /// <param name="product">The product being reported on.</param> /// <param name="file">The file being reported on.</param> /// <param name="theEvent">The event being reported on.</param> /// <param name="cab">The cab being reported on.</param> /// <param name="currentPage">The current page being downloaded.</param> /// <param name="totalPages">Total pages to download.</param> /// <param name="lastProductSyncStarted">Time the product sync started.</param> /// <param name="lastProductSyncCompleted">Time the product sync completed.</param> /// <param name="lastSuccessfulStarted">Time the product sync was started and successfully completed.</param> private void onProgress(WinQualProgressType progressType, StackHashProduct product, StackHashFile file, StackHashEvent theEvent, StackHashCab cab, int currentPage, int totalPages, DateTime lastProductSyncStarted, DateTime lastProductSyncCompleted, DateTime lastSuccessfulStarted) { EventHandler <WinQualProgressEventArgs> handler = Progress; if (handler != null) { StackHashProductInfo productInfo = null; if (product != null) { productInfo = new StackHashProductInfo((StackHashProduct)product.Clone(), !isExcludedProduct(product.Id), lastSuccessfulStarted.ToUniversalTime(), new StackHashProductSyncData(), lastProductSyncCompleted.ToUniversalTime(), lastProductSyncStarted.ToUniversalTime()); } handler(this, new WinQualProgressEventArgs(progressType, productInfo, file, theEvent, cab, currentPage, totalPages)); } }
/// <summary> /// Updates the display product from a StackHashProductInfo object /// </summary> /// <param name="productInfo">StackHashProductInfo</param> public void UpdateProduct(StackHashProductInfo productInfo) { if (productInfo == null) { throw new ArgumentNullException("productInfo"); } if (productInfo.Product == null) { throw new ArgumentNullException("productInfo", "productInfo.Product is null"); } if (productInfo.Product.Id != _productInfo.Product.Id) { throw new InvalidOperationException("Cannot update from a product with a different ID"); } // save the new product StackHashProductInfo oldProductInfo = _productInfo; _productInfo = productInfo; // check for updates if (oldProductInfo.LastSynchronizeTime != _productInfo.LastSynchronizeTime) { RaisePropertyChanged("LastSynchronizeTime"); } if (oldProductInfo.SynchronizeEnabled != _productInfo.SynchronizeEnabled) { RaisePropertyChanged("SynchronizeEnabled"); } if (oldProductInfo.LastSynchronizeCompletedTime != _productInfo.LastSynchronizeCompletedTime) { RaisePropertyChanged("LastSynchronizeCompletedTime"); } if (oldProductInfo.LastSynchronizeStartedTime != _productInfo.LastSynchronizeStartedTime) { RaisePropertyChanged("LastSynchronizeStartedTime"); } if (oldProductInfo.Product.DateCreatedLocal != _productInfo.Product.DateCreatedLocal) { RaisePropertyChanged("DateCreatedLocal"); } if (oldProductInfo.Product.DateModifiedLocal != _productInfo.Product.DateModifiedLocal) { RaisePropertyChanged("DateModifiedLocal"); } if (oldProductInfo.Product.Name != _productInfo.Product.Name) { RaisePropertyChanged("Name"); } if (oldProductInfo.Product.TotalEvents != _productInfo.Product.TotalEvents) { RaisePropertyChanged("TotalEvents"); } if (oldProductInfo.Product.TotalResponses != _productInfo.Product.TotalResponses) { RaisePropertyChanged("TotalResponses"); } if (oldProductInfo.Product.Version != _productInfo.Product.Version) { RaisePropertyChanged("Version"); } if (oldProductInfo.Product.TotalStoredEvents != _productInfo.Product.TotalStoredEvents) { RaisePropertyChanged("TotalStoredEvents"); } UpdateNameAndVersion(); UpdateDisplayFilter(); }