Exemple #1
0
        public AudioSettingsViewModel(PropertyAudioViewModel property, TrackableViewModel parent) : base(property, parent)
        {
            AudioSources.AddRange(AudioHelper.GetAudioSources());


            UpdateAudioSourcesCommand = new Prism.Commands.DelegateCommand(UpdateSources);
        }
        public ActionResult Edit(int id)
        {
            Trackable trackable = _trackablesServices.GetTrackable(id);

            TrackableViewModel trackableViewModel = Mapper.Map <Trackable, TrackableViewModel>(trackable);

            return(View(trackableViewModel));
        }
        public ViewResult Create()
        {
            Trackable trackable = new Trackable()
            {
                Name = String.Empty,
            };

            TrackableViewModel trackableViewModel = Mapper.Map <Trackable, TrackableViewModel>(trackable);

            return(View(trackableViewModel));
        }
Exemple #4
0
 public PropertyWindowViewModel(PropertyBaseViewModel property, TrackableViewModel parent) : base(parent)
 {
     this.parent   = parent;
     this.Property = property ?? throw new ArgumentNullException(nameof(property));
     this.Property.PropertyChanged += (sender, args) =>
     {
         if (args.PropertyName == nameof(IsChanged))
         {
             RaisePropertyChanged(() => IsChanged);
         }
     };
 }
        public ActionResult Edit(TrackableViewModel trackableViewModel)
        {
            if (ModelState.IsValid)
            {
                Trackable trackable = Mapper.Map <TrackableViewModel, Trackable>(trackableViewModel);

                _trackablesServices.UpdateTrackable(trackable);

                return(RedirectToAction("Index"));
            }
            else
            {
                return(View(trackableViewModel));
            }
        }
Exemple #6
0
        public AdvancedSettingsViewModel(AdvancedSettingsModel model, TrackableViewModel parent) : base(parent)
        {
            _model         = model;
            videoVeiwModel = ((StreamViewModel)parent).VideoViewModel;

            var encoders = EncoderHelper.GetVideoEncoders();

            VideoEncoders.AddRange(encoders);

            var encoder = encoders.FirstOrDefault(e => e.Id == _model.EncoderId) ?? encoders.FirstOrDefault();

            this.VideoEncoder = encoder;

            AdjustResolutionCommand = new DelegateCommand(AdjustVideoResolution);
        }
        public VideoSettingsViewModel(PropertyVideoViewModel property, TrackableViewModel parent) : base(property, parent)
        {
            this.parent.PropertyChanged += (sender, args) =>
            {
                if (args.PropertyName == nameof(IsChanged))
                {
                    RaisePropertyChanged(() => IsChanged);
                }
            };

            UpdateVideoSourcesCommand = new Prism.Commands.DelegateCommand(UpdateSources);

            //Displays.AddRange(ScreenHelper.GetDisplayItems());


            ScreenCaptures.AddRange(ScreenHelper.SupportedCaptures);

            var propVideoViewModel = ((PropertyVideoViewModel)this.Property);
            
            var streamModel = propVideoViewModel.Parent.MediaStreamer;

            var videoModel = streamModel.PropertyVideo;

            var captType = videoModel.CaptType;

            propVideoViewModel.CaptureType = ScreenCaptures.FirstOrDefault(c => c.CaptType == captType) ?? ScreenCaptures.FirstOrDefault();


            Displays.AddRange(ScreenHelper.GetVideoSources());

            var deviceId = videoModel.DeviceId;      

            if (string.IsNullOrEmpty(deviceId))
            {// если девайс не задан то берем первый попавшийся
                propVideoViewModel.Display = Displays.FirstOrDefault();
            }
            else
            {// если девайс есть в конфиге, то используем его даже если его нет в списке 
                // чтобы пользователь поменял его вручную
                propVideoViewModel.Display = Displays.FirstOrDefault(d => d.DeviceId == deviceId);
            }

           // ((PropertyVideoViewModel)this.Property).Display = Displays.FirstOrDefault(d => d.DeviceId == deviceId) ?? Displays.FirstOrDefault();

        }
        public MessageBoxViewModel(string message, string title, MessageBoxButton button, MessageBoxImage image, TrackableViewModel parent = null) : base(parent)
        {
            this.parentViewModel  = parent;
            this.messageBoxButton = button;

            if (iconDict.ContainsKey(image))
            {
                base.captionImage = iconDict[image];
            }
            else
            {
                base.captionImage = iconDict[MessageBoxImage.Error];
            }

            if (messageBoxButton == MessageBoxButton.OK)
            {
                OkButtonText = "OK";
            }
            else if (messageBoxButton == MessageBoxButton.OKCancel)
            {
                OkButtonText     = "OK";
                CancelButtonText = "Cancel";
            }
            else if (messageBoxButton == MessageBoxButton.YesNo)
            {
                OkButtonText     = "Yes";
                CancelButtonText = "No";
            }
            else
            {
                // not supported...
            }

            this.OkCommand = new DelegateCommand <Window>(OnExecuteOkCommand);

            this.DialogText = message;
            this.Title      = title;
        }
 public MessageBoxViewModel(string message, string title, TrackableViewModel parent = null) : this(message, title, MessageBoxButton.OK, MessageBoxImage.None, parent)
 {
 }
 public MessageBoxViewModel(TrackableViewModel parent = null) : this("", "", MessageBoxButton.OK, MessageBoxImage.None, parent)
 {
 }
Exemple #11
0
 public BorderSettingsViewModel(PropertyBorderViewModel property, TrackableViewModel parent) : base(property, parent)
 {
 }
Exemple #12
0
 public NetworkSettingsViewModel(PropertyNetworkViewModel property, TrackableViewModel parent) : base(property, parent)
 {
     UnicastProtocols.AddRange(NetworkHelper.GetUnicastProtocolTypes());
     Networks.AddRange(NetworkHelper.GetNetworkInfos());
 }
Exemple #13
0
 public CursorSettingsViewModel(PropertyCursorViewModel property, TrackableViewModel parent) : base(property, parent)
 {
 }
Exemple #14
0
 public QualitySettingsViewModel(PropertyQualityViewModel property, TrackableViewModel parent) : base(property, parent)
 {
     Presets.AddRange(QualityPresetsHelper.GetQualityPresetViewModels());
 }