/// <summary>
        /// Map from a ProjectGroup
        /// </summary>
        /// <param name="fromGroup">From group.</param>
        /// <returns></returns>
        public static ProjectGroupViewModel MapFrom(ProjectGroup fromGroup)
        {
            var group = new ProjectGroupViewModel();

            group.Name       = fromGroup.Name;
            group.Background = fromGroup.Background;
            group.Foreground = fromGroup.Foreground;
            group.Index      = fromGroup.Index;
            group.Expanded   = fromGroup.Expanded;
            foreach (var p in fromGroup.Projects)
            {
                group.Projects.Add(new ProjectViewModel
                {
                    Name     = p.Name,
                    Index    = p.Index,
                    Location = p.Location,
                });
            }
            return(group);
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProjectMovedEventArgs"/> class.
 /// </summary>
 /// <param name="groupViewModel">The group view model.</param>
 /// <param name="projectViewModel">The project view model.</param>
 public ProjectMovedEventArgs(ProjectGroupViewModel groupViewModel, ProjectViewModel projectViewModel)
 {
     this.ProjectViewModel      = projectViewModel;
     this.ProjectGroupViewModel = groupViewModel;
 }