Ejemplo n.º 1
0
        public ProfileResponse Post(UpdateProfileRequest request)
        {
            ProfileResponse response        = null;
            Profile         existingProfile = (from p in Program.Runtime.Setup.Profiles
                                               where p.Id == request.Id
                                               select p).FirstOrDefault();

            if (existingProfile != null)
            {
                existingProfile.Name             = request.Name;
                existingProfile.Description      = request.Description;
                existingProfile.CaptureFrequency = request.CaptureFrequency;
                existingProfile.OutputFrequency  = request.OutputFrequency;

                Program.Runtime.Save();

                // Re load saved changes to ensure save has worked
                response = Post(new ProfileRequest()
                {
                    Id = request.Id
                });
            }
            return(response);
        }
Ejemplo n.º 2
0
        public ProfileResponse Post(ProfileRequest request)
        {
            ProfileResponse response = null;
            Profile         profile  = (from p in Program.Runtime.Setup.Profiles
                                        where p.Id == request.Id
                                        select p).FirstOrDefault();

            if (profile != null)
            {
                response                  = new ProfileResponse();
                response.Id               = profile.Id;
                response.Name             = profile.Name;
                response.Description      = profile.Description;
                response.CaptureFrequency = profile.CaptureFrequency;
                response.OutputFrequency  = profile.OutputFrequency;

                response.LightSetupPlugins = (from p in profile.LightSetupPlugins
                                              select new SavedPlugin
                {
                    Id = p.Id,
                    Name = p.Name,
                    Description = p.ToString()
                });
                response.CapturePlugins = (from p in profile.CapturePlugins
                                           select new SavedPlugin
                {
                    Id = p.Id,
                    Name = p.Name,
                    Description = p.ToString()
                });
                response.ColourExtractionPlugins = (from p in profile.ColourExtractionPlugins
                                                    select new SavedPlugin
                {
                    Id = p.Id,
                    Name = p.Name,
                    Description = p.ToString()
                });
                response.PostProcessPlugins = (from p in profile.PostProcessPlugins
                                               select new SavedPlugin
                {
                    Id = p.Id,
                    Name = p.Name,
                    Description = p.ToString()
                });
                response.PreOutputPlugins = (from p in profile.PreOutputPlugins
                                             select new SavedPlugin
                {
                    Id = p.Id,
                    Name = p.Name,
                    Description = p.ToString()
                });
                response.OutputPlugins = (from p in profile.OutputPlugins
                                          select new SavedPlugin
                {
                    Id = p.Id,
                    Name = p.Name,
                    Description = p.ToString()
                });
            }
            return(response);
        }
Ejemplo n.º 3
0
        public ProfileResponse Post(ProfileRequest request)
        {
            ProfileResponse response = null;
            Profile profile = (from p in Program.Runtime.Setup.Profiles
                               where p.Id == request.Id
                               select p).FirstOrDefault();
            if (profile != null)
            {
                response = new ProfileResponse();
                response.Id = profile.Id;
                response.Name = profile.Name;
                response.Description = profile.Description;
                response.CaptureFrequency = profile.CaptureFrequency;
                response.OutputFrequency = profile.OutputFrequency;

                response.LightSetupPlugins = (from p in profile.LightSetupPlugins
                                                select new SavedPlugin
                                                {
                                                    Id = p.Id,
                                                    Name = p.Name,
                                                    Description = p.ToString()
                                                });
                response.CapturePlugins = (from p in profile.CapturePlugins
                                           select new SavedPlugin
                                                {
                                                    Id = p.Id,
                                                    Name = p.Name,
                                                    Description = p.ToString()
                                                });
                response.ColourExtractionPlugins = (from p in profile.ColourExtractionPlugins
                                                    select new SavedPlugin
                                                {
                                                    Id = p.Id,
                                                    Name = p.Name,
                                                    Description = p.ToString()
                                                });
                response.PostProcessPlugins = (from p in profile.PostProcessPlugins
                                               select new SavedPlugin
                                                {
                                                    Id = p.Id,
                                                    Name = p.Name,
                                                    Description = p.ToString()
                                                });
                response.PreOutputPlugins = (from p in profile.PreOutputPlugins
                                             select new SavedPlugin
                                                {
                                                    Id = p.Id,
                                                    Name = p.Name,
                                                    Description = p.ToString()
                                                });
                response.OutputPlugins = (from p in profile.OutputPlugins
                                          select new SavedPlugin
                                                {
                                                    Id = p.Id,
                                                    Name = p.Name,
                                                    Description = p.ToString()
                                                });

            }
            return response;
        }