private void backgroundWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            try
            {
                UpdateProgress(1);
                int total = 10;
                int index = 0;

                AsposeComponentsManager comManager = new AsposeComponentsManager(this);
                foreach (AsposeComponent component in AsposeComponents.list.Values)
                {
                    if (component.is_selected())
                    {
                        GlobalData.SelectedComponent = component.get_name();

                        if (AsposeComponentsManager.libraryAlreadyExists(component.get_downloadFileName()))
                        {
                            component.set_downloaded(true);
                        }
                        else
                        {
                            AsposeComponentsManager.addToDownloadList(component, component.get_downloadUrl(), component.get_downloadFileName());
                        }
                    }

                    decimal percentage = ((decimal)(index + 1) / (decimal)total) * 100;
                    UpdateProgress(Convert.ToInt32(percentage));

                    index++;
                }

                UpdateProgress(100);
                UpdateText("All operations completed");
            }
            catch (Exception) { }
        }
Ejemplo n.º 2
0
 public static string getLocalRepositoryPath(AsposeComponent component)
 {
     return(AsposeComponentsManager.getAsposeHomePath() + "gitrepos" + "/" + component.get_name());
 }