コード例 #1
0
        public ActionResult Edit(Guid id)
        {
            var userAgent = _userAgentRepository.GetById(id);

            if (userAgent == null)
            {
                return(RedirectToAction("Index"));
            }

            var model = new UserAgentViewModel()
            {
                ActiveX           = userAgent.Ax,
                UserInterfaceLink = userAgent.UserInterfaceLink,
                Height            = userAgent.Height,
                Id                  = userAgent.Id,
                Identifier          = userAgent.Identifier,
                Image               = userAgent.Image,
                Name                = userAgent.Name,
                Width               = userAgent.Width,
                MatchType           = userAgent.MatchType,
                Api                 = userAgent.Api,
                Lines               = userAgent.Lines,
                Inputs              = userAgent.Inputs,
                NrOfGpos            = userAgent.NrOfGpos,
                MaxInputDb          = userAgent.InputMaxDb,
                MinInputDb          = userAgent.InputMinDb,
                Comment             = userAgent.Comment,
                InputGainStep       = userAgent.InputGainStep,
                GpoNames            = userAgent.GpoNames,
                UserInterfaceIsOpen = userAgent.UserInterfaceIsOpen,
                UseScrollbars       = userAgent.UseScrollbars
            };

            GetCodecApiValues(model);
            GetProfileViewModels(model, userAgent.Profiles);
            GetCodecPresetViewModels(model, userAgent.CodecPresets);

            return(View(model));
        }
コード例 #2
0
 public UserAgent GetById(Guid id)
 {
     return(_internalRepository.GetById(id));
 }