Пример #1
0
        // Get configuration object
        public object GetConfiguration()
        {
            StardotConfiguration config = new StardotConfiguration();

            config.source        = serverBox.Text;
            config.login         = loginBox.Text;
            config.password      = passwordBox.Text;
            config.frameInterval = frameIntervals[rateCombo.SelectedIndex];

            return((object)config);
        }
Пример #2
0
        // Set configuration
        public void SetConfiguration(object config)
        {
            StardotConfiguration cfg = (StardotConfiguration)config;

            if (cfg != null)
            {
                serverBox.Text          = cfg.source;
                loginBox.Text           = cfg.login;
                passwordBox.Text        = cfg.password;
                rateCombo.SelectedIndex = Array.IndexOf(frameIntervals, cfg.frameInterval);
            }
        }
Пример #3
0
        // Save configuration
        public void SaveConfiguration(XmlTextWriter writer, object config)
        {
            StardotConfiguration cfg = (StardotConfiguration)config;

            if (cfg != null)
            {
                writer.WriteAttributeString("source", cfg.source);
                writer.WriteAttributeString("login", cfg.login);
                writer.WriteAttributeString("password", cfg.password);
                writer.WriteAttributeString("interval", cfg.frameInterval.ToString());
            }
        }
Пример #4
0
        // Load configuration
        public object LoadConfiguration(XmlTextReader reader)
        {
            StardotConfiguration config = new StardotConfiguration();

            try
            {
                config.source        = reader.GetAttribute("source");
                config.login         = reader.GetAttribute("login");
                config.password      = reader.GetAttribute("password");
                config.frameInterval = int.Parse(reader.GetAttribute("interval"));
            }
            catch (Exception)
            {
            }
            return((object)config);
        }
Пример #5
0
        // Load configuration
        public object LoadConfiguration(XmlTextReader reader)
        {
            StardotConfiguration config = new StardotConfiguration();

            try
            {
                config.source	= reader.GetAttribute("source");
                config.login	= reader.GetAttribute("login");
                config.password	= reader.GetAttribute("password");
                config.frameInterval = int.Parse(reader.GetAttribute("interval"));
                config.camera	= short.Parse(reader.GetAttribute("camera"));
            }
            catch (Exception)
            {
            }
            return (object) config;
        }
Пример #6
0
        // Create video source object
        public IVideoSource CreateVideoSource(object config)
        {
            StardotConfiguration cfg = (StardotConfiguration)config;

            if (cfg != null)
            {
                StardotNetCam source = new StardotNetCam();

                source.VideoSource   = cfg.source;
                source.Login         = cfg.login;
                source.Password      = cfg.password;
                source.FrameInterval = cfg.frameInterval;

                return((IVideoSource)source);
            }
            return(null);
        }
Пример #7
0
        // Get configuration object
        public object GetConfiguration()
        {
            StardotConfiguration config = new StardotConfiguration();

            config.source	= serverBox.Text;
            config.login	= loginBox.Text;
            config.password	= passwordBox.Text;
            config.frameInterval = frameIntervals[rateCombo.SelectedIndex];
            config.camera	= (short) cameraCombo.SelectedIndex;

            return (object) config;
        }