private static void CopyProjectContainerItemsFromModelToDto(ProjectItemContainerModel dto, ProjectItemContainerModel model)
 {
     //dto.Children = new List<IProjectItemModel>();
     foreach (var childModel in model.Children)
     {
         IProjectItemModel childDto = null;
         if (childModel is ProjectDirectoryModel)
         {
             childDto = FromModelToDto((ProjectDirectoryModel)childModel);
         }
         else if (childModel is ProjectFileModel)
         {
             childDto = FromModelToDto((ProjectFileModel)childModel);
         }
         dto.Children.Add(childDto);
     }
 }
Beispiel #2
0
 private static void CopyProjectContainerItemsFromModelToDto(ProjectItemContainerModel dto, ProjectItemContainerModel model)
 {
     //dto.Children = new List<IProjectItemModel>();
     foreach (var childModel in model.Children)
     {
         IProjectItemModel childDto = null;
         if (childModel is ProjectDirectoryModel)
         {
             childDto = FromModelToDto((ProjectDirectoryModel)childModel);
         }
         else if (childModel is ProjectFileModel)
         {
             childDto = FromModelToDto((ProjectFileModel)childModel);
         }
         dto.Children.Add(childDto);
     }
 }
 private static void CopyProjectContainerItemsFromDtoToModel(ProjectItemContainerModel model, ProjectItemContainerModel dto)
 {
     //CopyIProjectItemModelMembers(model, dto);
     //model.Children = new List<IProjectItemModel>();
     foreach (var childDto in dto.Children)
     {
         IProjectItemModel childModel = null;
         if (childDto is ProjectDirectoryDto)
         {
             childModel = FromDtoToModel((ProjectDirectoryDto)childDto);
         }
         else if (childDto is ProjectFileDto)
         {
             childModel = FromDtoToModel((ProjectFileDto)childDto);
         }
         model.Children.Add(childModel);
     }
 }
Beispiel #4
0
 private static void CopyProjectContainerItemsFromDtoToModel(ProjectItemContainerModel model, ProjectItemContainerModel dto)
 {
     //CopyIProjectItemModelMembers(model, dto);
     //model.Children = new List<IProjectItemModel>();
     foreach (var childDto in dto.Children)
     {
         IProjectItemModel childModel = null;
         if (childDto is ProjectDirectoryDto)
         {
             childModel = FromDtoToModel((ProjectDirectoryDto)childDto);
         }
         else if (childDto is ProjectFileDto)
         {
             childModel = FromDtoToModel((ProjectFileDto)childDto);
         }
         model.Children.Add(childModel);
     }
 }
 private static void CopyProjectContainerMembersFromViewModelToModel(ProjectItemContainerModel model, ProjectItemContainerViewModel viewModel)
 {
     model.Id = viewModel.Id;
     model.ProjectId = viewModel.ProjectId;
     model.Name = viewModel.Name;
     model.LastModified = viewModel.LastModified;
     //model.Children = new List<IProjectItemModel>();
     foreach (var childViewModel in viewModel.Children)
     {
         IProjectItemModel childModel = null;
         if (childViewModel is ProjectDirectoryViewModel)
         {
             childModel = FromViewModelToModel((ProjectDirectoryViewModel)childViewModel);
         }
         else if (childViewModel is ProjectFileViewModel)
         {
             childModel = FromViewModelToModel((ProjectFileViewModel)childViewModel);
         }
         model.Children.Add(childModel);
     }
 }
 private static void CopyProjectContainerMembersFromModelToViewModel(ProjectItemContainerViewModel viewModel, ProjectItemContainerModel model)
 {
     viewModel.Id = model.Id;
     viewModel.ProjectId = model.ProjectId;
     viewModel.Name = model.Name;
     viewModel.LastModified = model.LastModified;
     //viewModel.Children = new ObservableCollection<IProjectItemViewModel>();
     foreach (var childModel in model.Children)
     {
         IProjectItemViewModel childViewModel = null;
         if (childModel is ProjectDirectoryDto)
         {
             childViewModel = FromModelToViewModel((ProjectDirectoryDto)childModel);
         }
         else if (childModel is ProjectFileDto)
         {
             childViewModel = FromModelToViewModel((ProjectFileDto)childModel);
         }
         viewModel.InitialChildren.Add(childViewModel);
     }
 }