Пример #1
0
        public List <ResourceItem> ImportResources(ResourceFolder parent, IEnumerable <string> pathes, IProgressMonitor monitor, CancellationToken token, HashSet <string> fileTypeSuffix = null)
        {
            List <ResourceItem>  resourceItemList = new List <ResourceItem>();
            ImportResourceResult dic = FileOptionHelp.CopyToDic(parent, pathes, monitor, token, (IEnumerable <string>)fileTypeSuffix);

            return(dic.AddResourcePanelItems.Union <ResourceItem>((IEnumerable <ResourceItem>)dic.ImportResources).ToList <ResourceItem>());
        }
Пример #2
0
        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);
        }