Example #1
0
 public ProblemResourceViewModel(ProblemResource resource)
 {
     if (resource != null)
     {
         ID             = resource.ID;
         Session        = new SessionViewModel(resource.Session);
         Title          = resource.Title;
         Emotion        = resource.Emotion;
         Location       = resource.Location;
         Characteristic = resource.Characteristic;
         Influence      = resource.Influence;
         LikeScore      = resource.LikeScore;
         Tasks          = new List <ProblemResourceTaskViewModel>();
     }
 }
Example #2
0
 public ProblemResourceViewModel(ProblemResource resource, IEnumerable <ProblemResourceTask> tasks)
 {
     if (resource != null)
     {
         ID             = resource.ID;
         Session        = new SessionViewModel(resource.Session);
         Title          = resource.Title;
         Emotion        = resource.Emotion;
         Location       = resource.Location;
         Characteristic = resource.Characteristic;
         Influence      = resource.Influence;
         LikeScore      = resource.LikeScore;
         Tasks          = tasks.Select(x => new ProblemResourceTaskViewModel(x)).ToList();
     }
 }
Example #3
0
        public ProblemImageViewModel(ProblemImage image)
        {
            if (image != null)
            {
                ID      = image.ID;
                Session = new SessionViewModel(image.Session);

                if (image.ParentImage != null)
                {
                    ParentImage = new ProblemImageViewModel(image.ParentImage);
                }

                Title          = image.Title;
                Emotion        = image.Emotion;
                Location       = image.Location;
                Characteristic = image.Characteristic;
                IsMine         = image.IsMine;
                IsIDo          = image.IsIDo;
                IsForever      = image.IsForever;
                LikeScore      = image.LikeScore;
                IsHidden       = image.IsHidden;
            }
        }