public IProgressMonitor ImportResourcesAsync(ResourceFolder parent, IEnumerable <string> pathes, List <ResourceItem> resourceItems, System.Action <IProgressMonitor> continueAction = null)
        {
            MessageDialogProgressMonitor monitor     = Services.ProgressMonitors.GetMessageDialogProgreeMonitor();
            CancellationTokenSource      tokenSource = new CancellationTokenSource();
            CancellationToken            token       = tokenSource.Token;
            Task task = Task.Factory.StartNew((System.Action)(() =>
            {
                IEnumerable <ResourceItem> collection = (IEnumerable <ResourceItem>) this.ImportResources(parent, pathes, (IProgressMonitor)monitor, token, (HashSet <string>)null);
                if (resourceItems == null || collection == null)
                {
                    return;
                }
                resourceItems.AddRange(collection);
            }), token);

            monitor.CancelRequested += (MonitorHandler)(m => tokenSource.Cancel());
            task.ContinueWith((System.Action <Task>)(a =>
            {
                Services.ProjectOperations.CurrentSelectedSolution.Save(Services.ProgressMonitors.Default);
                if (continueAction != null)
                {
                    continueAction((IProgressMonitor)monitor);
                }
                int num = (int)GLib.Timeout.Add(0U, (TimeoutHandler)(() =>
                {
                    monitor.Dispose();
                    if (monitor != null && monitor.Errors.Count == 0 && monitor.Warnings.Count == 0)
                    {
                        monitor.CloseDialogs();
                    }
                    return(false);
                }));
            }));
            return((IProgressMonitor)monitor);
        }
        public List <ResourceItem> MessgeDialogImprotResource(ResourceFolder parent, IEnumerable <string> pathes)
        {
            MessageDialogProgressMonitor dialogProgreeMonitor = Services.ProgressMonitors.GetMessageDialogProgreeMonitor();
            ImportResourceResult         dic = FileOptionHelp.CopyToDic(parent, pathes, (IProgressMonitor)dialogProgreeMonitor, CancellationToken.None, (IEnumerable <string>)null);

            dialogProgreeMonitor.Dispose();
            if (dialogProgreeMonitor != null && dialogProgreeMonitor.Errors.Count == 0 && dialogProgreeMonitor.Warnings.Count == 0)
            {
                dialogProgreeMonitor.CloseDialogs();
            }
            IEnumerable <ResourceItem> addItems = dic.AddResourcePanelItems.Union <ResourceItem>((IEnumerable <ResourceItem>)dic.ImportResources);

            Services.EventsService.GetEvent <AddResourcesEvent>().Publish(new AddResourcesArgs(parent, addItems, true));
            return(dic.ImportResources);
        }