private int DoImport(ImportBackend imp)
    {
        if (collection == null)
        {
            return(0);
        }

        this.importer = imp;
        AllowFinish   = false;

        total = importer.Prepare();

        if (total > 0)
        {
            UpdateProgressBar(1, total);
        }

        collection.Clear();
        collection.Capacity = total;

        while (total > 0 && this.Step())
        {
            System.DateTime start_time = System.DateTime.Now;
            System.TimeSpan span       = start_time - start_time;

            while (Application.EventsPending() && span.TotalMilliseconds < 100)
            {
                span = System.DateTime.Now - start_time;
                Application.RunIteration();
            }
        }

        return(total);
    }
        public void FindMissing()
        {
            int i;

            missing.Clear();

            for (i = 0; i < source.Count; i++)
            {
                IBrowsableItem item = source [i];
                string         path = item.DefaultVersionUri.LocalPath;
                if (!File.Exists(path) || (new FileInfo(path).Length == 0))
                {
                    missing.Add(item);
                }
            }
        }