Beispiel #1
0
        // called on download progress of each package/file
        public void downloadProgressCallback(Uri packageSource, DownloadProgressEventArgs eventArgs)
        {
            float        percentageDownloadedAcurate = ((float)eventArgs.BytesReceived / eventArgs.TotalBytesToReceive) * 100;
            ProgressCtrl progressCtrl = m_packageSourceList[packageSource];
            string       packageName  = progressCtrl.Name;

            progressCtrl.LoadingTextCtrl.Text  = "Downloaded " + percentageDownloadedAcurate.ToString("##0") + "%";
            progressCtrl.ProgressBarCtrl.Value = eventArgs.ProgressPercentage;
        }
Beispiel #2
0
        // called when download of each package/file starts
        public void downloadStartCallback(Uri packageSource)
        {
            //dynamicaly generate a progress control for each file we download and add it to UI
            ProgressCtrl progressCtrl = new ProgressCtrl();
            string       packageName  = packageSource.ToString();

            if (packageName.Length > 50)
            {
                packageName = ".." + packageName.Substring(packageName.Length - 50);
            }
            progressCtrl.Name = packageName;
            progressCtrl.Blink.AutoReverse = true;
            progressCtrl.Blink.Begin();
            DownloadListStackCtrl.Children.Add(progressCtrl);
            m_packageSourceList.Add(packageSource, progressCtrl);
        }