public static Model Create(
                bool includeAnalitycs,
                bool isPtzStatusSupported,
                bool includePtzStatus,
                bool isPtzPositionSupported,
                bool includePtzPosition,
                bool includeEvents,
                string[] messageContentFilterDialects,
                string[] topicExpressionDialects,
                bool isFixedTopicSet,
                TopicSetType topicSet,
                TopicExpressionFilter[] topicExpressionFilters,
                MessageContentFilter[] messageContentFilters
                )
            {
                var _this = new Model();

                _this.isPtzStatusSupported         = isPtzStatusSupported;
                _this.isPtzPositionSupported       = isPtzPositionSupported;
                _this.messageContentFilterDialects = messageContentFilterDialects;
                _this.topicExpressionDialects      = topicExpressionDialects;
                _this.isFixedTopicSet               = isFixedTopicSet;
                _this.topicSet                      = topicSet;
                _this.origin.includeAnalitycs       = includeAnalitycs;
                _this.origin.includePtzStatus       = includePtzStatus;
                _this.origin.includePtzPosition     = includePtzPosition;
                _this.origin.includeEvents          = includeEvents;
                _this.origin.topicExpressionFilters = topicExpressionFilters;
                _this.origin.messageContentFilters  = messageContentFilters;
                _this.RevertChanges();

                return(_this);
            }
            public static Model Create(
                string name,
                string location,
                string manufacturer,
                string model,
                string firmware,
                string hardware,
                string serial,
                string mac,
                string ip,
                OnvifVersion onvifVersion
                )
            {
                var _this = new Model();

                _this.manufacturer    = manufacturer;
                _this.model           = model;
                _this.firmware        = firmware;
                _this.hardware        = hardware;
                _this.serial          = serial;
                _this.mac             = mac;
                _this.ip              = ip;
                _this.onvifVersion    = onvifVersion;
                _this.origin.name     = name;
                _this.origin.location = location;
                _this.RevertChanges();

                return(_this);
            }
Example #3
0
            public static Model Create(
                string profName,
                string profToken,
                VideoSourceConfiguration videoSrcCfg,
                AudioSourceConfiguration audioSrcCfg,
                bool isVideoSrcCfgEnabled,
                bool isAudioSrcCfgEnabled,
                VideoSourceConfiguration[] videoSrcCfgs,
                AudioSourceConfiguration[] audioSrcCfgs
                )
            {
                var _this = new Model();

                _this.videoSrcCfgs                = videoSrcCfgs;
                _this.audioSrcCfgs                = audioSrcCfgs;
                _this.origin.profName             = profName;
                _this.origin.profToken            = profToken;
                _this.origin.videoSrcCfg          = videoSrcCfg;
                _this.origin.audioSrcCfg          = audioSrcCfg;
                _this.origin.isVideoSrcCfgEnabled = isVideoSrcCfgEnabled;
                _this.origin.isAudioSrcCfgEnabled = isAudioSrcCfgEnabled;
                _this.RevertChanges();

                return(_this);
            }
        private void Init(Model model)
        {
            OnCompleted += () => {
                disposables.Dispose();
            };
            this.DataContext = model;
            this.model       = model;

            var applyCommand = new DelegateCommand(
                () => Success(new Result.Apply(model)),
                () => true
                );

            ApplyCommand = applyCommand;

            //var closeCommand = new DelegateCommand(
            //    () => Success(new Result.Close()),
            //    () => true
            //);
            //CloseCommand = closeCommand;

            CancelCommand = new DelegateCommand(
                () => model.RevertChanges(),
                () => true
                );

            InitializeComponent();

            BindModel(model);
        }
            public static Model Create(
                Receiver receiver
                )
            {
                var _this = new Model();

                _this.origin.receiver = receiver;
                _this.RevertChanges();

                return(_this);
            }
            public static Model Create(
                AnalyticsEngineControl control
                )
            {
                var _this = new Model();

                _this.origin.control = control;
                _this.RevertChanges();

                return(_this);
            }
Example #7
0
            public static Model Create(
                VideoEncoderConfiguration vec
                )
            {
                var _this = new Model();

                _this.origin.vec = vec;
                _this.RevertChanges();

                return(_this);
            }
 void OnRevertChanges()
 {
     //valueDeviceTime.Stop();
     //valueDeviceTime.Stop();
     //valueNewTime.Stop();
     model.RevertChanges();
     disposables.Dispose();
     disposables = new CompositeDisposable();
     InitTimeZones();
     Init();
     //BindModel(model);
 }
            public static Model Create(
                User[] users,
                User selection
                )
            {
                var _this = new Model();

                _this.users            = users;
                _this.origin.selection = selection;
                _this.RevertChanges();

                return(_this);
            }
Example #10
0
            public static Model Create(
                Receiver[] active,
                AnalyticsEngineInput[] vacs
                )
            {
                var _this = new Model();

                _this.origin.active = active;
                _this.origin.vacs   = vacs;
                _this.RevertChanges();

                return(_this);
            }
            public static Model Create(
                Dictionary <AnalyticsEngineControl, AnalyticsState> controlstates,
                AnalyticsEngineControl selection
                )
            {
                var _this = new Model();

                _this.controlstates    = controlstates;
                _this.origin.selection = selection;
                _this.RevertChanges();

                return(_this);
            }
            public static Model Create(
                Receiver[] receivers,
                Receiver selection
                )
            {
                var _this = new Model();

                _this.origin.receivers = receivers;
                _this.origin.selection = selection;
                _this.RevertChanges();

                return(_this);
            }
Example #13
0
            public static Model Create(
                Action1 action,
                SupportedActions supportedActions
                )
            {
                var _this = new Model();

                _this.origin.action           = action;
                _this.origin.supportedActions = supportedActions;
                _this.RevertChanges();

                return(_this);
            }
            public static Model Create(
                Receiver[] receivers,
                AnalyticsEngineInput[] inputs
                )
            {
                var _this = new Model();

                _this.origin.receivers = receivers;
                _this.origin.inputs    = inputs;
                _this.RevertChanges();

                return(_this);
            }
        void Init(Model model)
        {
            OnCompleted += () => {
                disposables.Dispose();
            };
            this.model       = model;
            this.DataContext = model;

            var applyCmd = new DelegateCommand(
                () => Success(new Result.Apply(model)),
                () => {
                //if (context.model != null) {
                //    return context.model.isModified;
                //}
                return(true);
            }
                );

            ApplyCommand = applyCmd;

            var revertCmd = new DelegateCommand(
                () => {
                if (model != null)
                {
                    model.RevertChanges();
                }
            },
                () => {
                //if (context.model != null) {
                //    return !context.model.isModified;
                //}
                return(true);
            }
                );

            InitializeComponent();

            this.container = activityContext.container;
            this.videoInfo = container.Resolve <IVideoInfo>();
            this.session   = (IImagingAsync)activityContext.container.Resolve <INvtSession>();

            BindFocusMoveData();
            BindImagingData();
            Localization();

            var vInfo = container.Resolve <IVideoInfo>();

            VideoStartup(model.profToken);
        }
            public static Model Create(
                ActionTrigger trigger,
                Action1[] actions,
                TopicSetType topicSet
                )
            {
                var _this = new Model();

                _this.origin.trigger  = trigger;
                _this.origin.actions  = actions;
                _this.origin.topicSet = topicSet;
                _this.RevertChanges();

                return(_this);
            }
            public static Model Create(
                string name,
                string password,
                UserLevel level
                )
            {
                var _this = new Model();

                _this.name            = name;
                _this.origin.password = password;
                _this.origin.level    = level;
                _this.RevertChanges();

                return(_this);
            }
            public static Model Create(
                string name,
                string token,
                string vacToken
                )
            {
                var _this = new Model();

                _this.origin.name     = name;
                _this.origin.token    = token;
                _this.origin.vacToken = vacToken;
                _this.RevertChanges();

                return(_this);
            }
            public static Model Create(
                Item[] items,
                Item selection,
                Flags flags
                )
            {
                var _this = new Model();

                _this.items            = items;
                _this.flags            = flags;
                _this.origin.selection = selection;
                _this.RevertChanges();

                return(_this);
            }
            public static Model Create(
                string profToken,
                VideoResolution resolution,
                int maxFrameRate,
                int minFrameRate,
                double frameRate,
                int maxEncodingInterval,
                int minEncodingInterval,
                int encodingInterval,
                int maxQuality,
                int minQuality,
                float quality,
                int maxBitrate,
                int minBitrate,
                double bitrate,
                int maxGovLength,
                int minGovLength,
                int govLength,
                VideoEncoding encoder,
                VideoEncoderConfigurationOptions encoderOptions
                )
            {
                var _this = new Model();

                _this.profToken               = profToken;
                _this.maxFrameRate            = maxFrameRate;
                _this.minFrameRate            = minFrameRate;
                _this.maxEncodingInterval     = maxEncodingInterval;
                _this.minEncodingInterval     = minEncodingInterval;
                _this.maxQuality              = maxQuality;
                _this.minQuality              = minQuality;
                _this.maxBitrate              = maxBitrate;
                _this.minBitrate              = minBitrate;
                _this.maxGovLength            = maxGovLength;
                _this.minGovLength            = minGovLength;
                _this.encoderOptions          = encoderOptions;
                _this.origin.resolution       = resolution;
                _this.origin.frameRate        = frameRate;
                _this.origin.encodingInterval = encodingInterval;
                _this.origin.quality          = quality;
                _this.origin.bitrate          = bitrate;
                _this.origin.govLength        = govLength;
                _this.origin.encoder          = encoder;
                _this.RevertChanges();

                return(_this);
            }
        private void Init(Model model)
        {
            OnCompleted     += disposables.Dispose;
            this.DataContext = model;
            container        = activityContext.container;

            encResolutions = new List <EncoderResolutionPair>();
            var applyCmd = new DelegateCommand(
                () => {
                model.encoder    = EncoderResolution.Encoder;
                model.resolution = EncoderResolution.Resolution;
                Success(new Result.Apply(model));
            },
                () => true
                );

            ApplyCommand = applyCmd;

            var revertCmd = new DelegateCommand(
                () => {
                if (model != null)
                {
                    model.RevertChanges();
                    EncoderResolution = encResolutions.Find(
                        x => ((x.Encoder == model.encoder) && (x.Resolution.ToString() == model.resolution.ToString()))
                        );
                }
            },
                () => true
                );

            RevertCommand = revertCmd;


            InitializeComponent();

            //numericTemp.ValueMin = 0;
            //numericTemp.IntValue = 100;
            //numericTemp.ValueMax = 110;

            //numericTemp.Value = 100;


            BindData(model);
            VideoStartup(model);
        }
            public static Model Create(
                bool isEnable,
                AnalyticsEngineInput input,
                Receiver receiver,
                Receiver[] receivers
                )
            {
                var _this = new Model();

                _this.receivers       = receivers;
                _this.origin.isEnable = isEnable;
                _this.origin.input    = input;
                _this.origin.receiver = receiver;
                _this.RevertChanges();

                return(_this);
            }
        private void Init(Model model)
        {
            this.DataContext = model;
            this.model       = model;

            OnCompleted += new Action(() => {
                //free resources
            });

            var applyCmd = new DelegateCommand(
                () => {
                try {
                    if (!model.dhcp)
                    {
                        model.useNtpFromDhcp  = false;
                        model.useDnsFromDhcp  = false;
                        model.useHostFromDhcp = false;
                    }
                    GetProtocolData();
                    Success(new Result.Apply(model));
                } catch (Exception err) {
                    Success(new Result.ValidationFailed(model, new Exception("some fields contains invalid values", err)));
                }
            },
                () => true
                );

            ApplyCommand = applyCmd;

            var cancelCmd = new DelegateCommand(
                () => {
                model.RevertChanges();
                FillProtocolsData(model);
            },
                () => true
                );

            CancelCommand = cancelCmd;

            InitializeComponent();

            Localization();
            BindData(model);
        }
            public static Model Create(
                bool useHostFromDhcp,
                string host,
                string ip,
                string subnet,
                string dns,
                string gateway,
                bool dhcp,
                string ntpServers,
                bool useNtpFromDhcp,
                string dnsServer,
                bool useDnsFromDhcp,
                bool zeroConfSupported,
                bool zeroConfEnabled,
                string zeroConfIp,
                NetworkProtocol[] netProtocols,
                bool discoveryModeSupported,
                DiscoveryMode discoveryMode
                )
            {
                var _this = new Model();

                _this.zeroConfSupported      = zeroConfSupported;
                _this.zeroConfIp             = zeroConfIp;
                _this.discoveryModeSupported = discoveryModeSupported;
                _this.origin.useHostFromDhcp = useHostFromDhcp;
                _this.origin.host            = host;
                _this.origin.ip              = ip;
                _this.origin.subnet          = subnet;
                _this.origin.dns             = dns;
                _this.origin.gateway         = gateway;
                _this.origin.dhcp            = dhcp;
                _this.origin.ntpServers      = ntpServers;
                _this.origin.useNtpFromDhcp  = useNtpFromDhcp;
                _this.origin.dnsServer       = dnsServer;
                _this.origin.useDnsFromDhcp  = useDnsFromDhcp;
                _this.origin.zeroConfEnabled = zeroConfEnabled;
                _this.origin.netProtocols    = netProtocols;
                _this.origin.discoveryMode   = discoveryMode;
                _this.RevertChanges();

                return(_this);
            }
            public static Model Create(
                string profToken,
                string sourceToken,
                ImagingOptions20 options,
                ImagingSettings20 settings,
                MoveOptions20 moveOptions
                )
            {
                var _this = new Model();

                _this.profToken       = profToken;
                _this.sourceToken     = sourceToken;
                _this.options         = options;
                _this.moveOptions     = moveOptions;
                _this.origin.settings = settings;
                _this.RevertChanges();

                return(_this);
            }
		private void Init(Model model) {
			this.DataContext = model;
			this.model = model;

			OnCompleted += new Action(() => {
				//free resources
			});

			var applyCmd = new DelegateCommand(
				() => {
					try {
						if (!model.dhcp) {
							model.useNtpFromDhcp = false;
							model.useDnsFromDhcp = false;
							model.useHostFromDhcp = false;
						}
						GetProtocolData();
						Success(new Result.Apply(model));
					} catch (Exception err) {
						Success(new Result.ValidationFailed(model, new Exception("some fields contains invalid values", err)));
					}

				},
				() => true
			);
			ApplyCommand = applyCmd;

			var cancelCmd = new DelegateCommand(
				() => {
					model.RevertChanges();
					FillProtocolsData(model);
				},
				() => true
			);
			CancelCommand = cancelCmd;

			InitializeComponent();

			Localization();
			BindData(model);
		}
Example #27
0
            public static Model Create(
                long timestamp,
                DateTime?localDateTime,
                DateTime?utcDateTime,
                bool useDateTimeFromNtp,
                string timeZone,
                bool daylightSavings
                )
            {
                var _this = new Model();

                _this.timestamp              = timestamp;
                _this.localDateTime          = localDateTime;
                _this.utcDateTime            = utcDateTime;
                _this.useDateTimeFromNtp     = useDateTimeFromNtp;
                _this.origin.timeZone        = timeZone;
                _this.origin.daylightSavings = daylightSavings;
                _this.RevertChanges();

                return(_this);
            }
            public static Model Create(
                VideoEncoderConfiguration videoEncCfg,
                AudioEncoderConfiguration audioEncCfg,
                VideoAnalyticsConfiguration analyticsCfg,
                PTZConfiguration ptzCfg,
                MetadataConfiguration metaCfg,
                bool isVideoEncCfgEnabled,
                bool isAudioEncCfgEnabled,
                bool isAnalyticsCfgEnabled,
                bool isPtzCfgEnabled,
                bool isMetaCfgEnabled,
                VideoEncoderConfiguration[] videoEncCfgs,
                AudioEncoderConfiguration[] audioEncCfgs,
                PTZConfiguration[] ptzCfgs,
                VideoAnalyticsConfiguration[] analyticsCfgs,
                MetadataConfiguration[] metaCfgs
                )
            {
                var _this = new Model();

                _this.videoEncCfgs                 = videoEncCfgs;
                _this.audioEncCfgs                 = audioEncCfgs;
                _this.ptzCfgs                      = ptzCfgs;
                _this.analyticsCfgs                = analyticsCfgs;
                _this.metaCfgs                     = metaCfgs;
                _this.origin.videoEncCfg           = videoEncCfg;
                _this.origin.audioEncCfg           = audioEncCfg;
                _this.origin.analyticsCfg          = analyticsCfg;
                _this.origin.ptzCfg                = ptzCfg;
                _this.origin.metaCfg               = metaCfg;
                _this.origin.isVideoEncCfgEnabled  = isVideoEncCfgEnabled;
                _this.origin.isAudioEncCfgEnabled  = isAudioEncCfgEnabled;
                _this.origin.isAnalyticsCfgEnabled = isAnalyticsCfgEnabled;
                _this.origin.isPtzCfgEnabled       = isPtzCfgEnabled;
                _this.origin.isMetaCfgEnabled      = isMetaCfgEnabled;
                _this.RevertChanges();

                return(_this);
            }
		private void Init(Model model) {
			OnCompleted += () => {
				disposables.Dispose();
			};
			this.DataContext = model;
			this.model = model;

			var applyCommand = new DelegateCommand(
				() =>Success(new Result.Apply(model)),
				() => true
			);
			ApplyCommand = applyCommand;

			//var closeCommand = new DelegateCommand(
			//    () => Success(new Result.Close()),
			//    () => true
			//);
			//CloseCommand = closeCommand;

			CancelCommand = new DelegateCommand(
				() => model.RevertChanges(),
				() => true
			);

			InitializeComponent();

			BindModel(model);
		}