Beispiel #1
0
 /// <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;
 }
Beispiel #2
0
 /// <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;
 }
Beispiel #3
0
        private void onProgress(WinQualProgressType progressType)
        {
            EventHandler <WinQualProgressEventArgs> handler = Progress;

            if (handler != null)
            {
                handler(this, new WinQualProgressEventArgs(progressType, null));
            }
        }
Beispiel #4
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;
 }
Beispiel #5
0
        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));
        }
Beispiel #6
0
        /// <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));
            }
        }
Beispiel #7
0
 /// <summary>
 /// Reports progress for the sync.
 /// </summary>
 /// <param name="progressType">The type of progress being reported.</param>
 /// <param name="product">The product being reported on.</param>
 private void onProgress(WinQualProgressType progressType, StackHashProduct product)
 {
     onProgress(progressType, product, null, null, null, 0, 0, new DateTime(0), new DateTime(0), new DateTime(0));
 }