Ejemplo n.º 1
0
 private void SaveFileCategories(ICategory[] categories)
 {
     foreach (var category in categories)
     {
         if (category.Type == CategoryType.Attachment)
         {
             try
             {
                 var folder = new ASC.Files.Core.Folder
                 {
                     ParentFolderID = FileEngine2.GetRoot(FindProject(category.ProjectID)),
                     Title          = category.Name
                 };
                 folder = FileEngine2.SaveFolder(folder);
                 NewFileCategoriesID.Add(new FileCategoryIDWrapper {
                     inBasecamp = category.ID, inProjects = folder.ID
                 });
             }
             catch (Exception e)
             {
                 Status.LogError(string.Format(SettingsResource.FailedToSaveFileCategory, category.Name), e);
                 LogError(string.Format("file category '{0}' failed", category.Name), e);
                 NewFileCategoriesID.RemoveAll(x => x.inBasecamp == category.ID);
             }
         }
     }
 }
Ejemplo n.º 2
0
 private void SaveFileCategories(ICategory[] categories)
 {
     foreach (var category in categories)
     {
         if (category.Type == CategoryType.Attachment)
         {
             try
             {
                 var folder = new ASC.Files.Core.Folder
                 {
                     ParentFolderID = FileEngine2.GetRoot(FindProject(category.ProjectID)),
                     Title = category.Name
                 };
                 folder = FileEngine2.SaveFolder(folder);
                 NewFileCategoriesID.Add(new FileCategoryIDWrapper { inBasecamp = category.ID, inProjects = folder.ID });
             }
             catch (Exception e)
             {
                 Status.LogError(string.Format(SettingsResource.FailedToSaveFileCategory, category.Name), e);
                 LogError(string.Format("file category '{0}' failed", category.Name), e);
                 NewFileCategoriesID.RemoveAll(x => x.inBasecamp == category.ID);
             }
         }
     }
 }