示例#1
0
        public CameraPage()
        {
            InitializeComponent();
            try { gameUpdate.Text = SharedInformation.myNumber; } catch { gameUpdate.Text += "erreur 0"; }
            try { nbrLiving = SharedInformation.ListOfPlayers.Count; gameUpdate.Text += nbrLiving; } catch { gameUpdate.Text += "erreur counting"; }



            timing();
            message.Focus(FocusState.Keyboard);
            _navigationHelper                    = new NavigationHelper(this);
            controlBar.HideButtonClicked        += OnHideButtonClicked;
            controlBar.ToggleFlashButtonClicked += OnToggleFlashButtonClicked;
            controlBar.SettingsButtonClicked    += OnSettingsButtonClicked;
            this.Loaded        += BasicPage_Loaded;
            this.LayoutUpdated += BasicPage_LayoutUpdated;

            _videoEngine = VideoEngine.Instance;

            _settings = App.Settings;

            NavigationCacheMode = NavigationCacheMode.Required;

            ortcClient  = new RealtimeFramework.Messaging.OrtcClient();
            ortcExample = new OrtcExample();

            ortcExample.Channel             = SharedInformation.savedRoom.name;
            ortcExample.AuthenticationToken = SharedInformation.savedRoom.password;

            if (ortcExample.Channel.Equals(SharedInformation.savedRoom.name))
            {
                message.DataContext = ortcExample;
                ortcExample.DoConnectDisconnect();
            }
        }
示例#2
0
        public CameraPage()
        {
            InitializeComponent();

            _navigationHelper = new NavigationHelper(this);

            controlBar.HideButtonClicked             += OnHideButtonClicked;
            controlBar.ToggleEffectButtonClicked     += OnToggleEffectButtonClickedAsync;
            controlBar.ToggleFlashButtonClicked      += OnToggleFlashButtonClicked;
            controlBar.SettingsButtonClicked         += OnSettingsButtonClicked;
            effectSettingsControl.ColorButtonClicked += OnColorPickerButtonClicked;
            effectSettingsControl.SliderValueChanged += OnSliderValueChanged;

            _videoEngine = VideoEngine.Instance;

            _settings = App.Settings;

            NavigationCacheMode = NavigationCacheMode.Required;

            try
            {
                _lockedSound          = new MediaElement();
                _lockedSound.Source   = new Uri(this.BaseUri, "Assets/tos_keypress1.mp3");
                _lockedSound.AutoPlay = false;
                LayoutGrid.Children.Add(_lockedSound);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex);
            }
        }
示例#3
0
        public GameTest()
        {
            InitializeComponent();
            timing();

            _navigationHelper = new NavigationHelper(this);

            _videoEngine = VideoEngine.Instance;

            _settings = App.Settings;

            NavigationCacheMode = NavigationCacheMode.Required;
        }
示例#4
0
        public void Show()
        {
            if (modeSelectorListBox.Items.Count == 0)
            {
                foreach (string enumAsString in Enum.GetNames(typeof(Mode)).ToList())
                {
                    modeSelectorListBox.Items.Add(enumAsString);
                }

                if (modeSelectorListBox.Items.Count > 0)
                {
                    modeSelectorListBox.SelectedIndex =
                        modeSelectorListBox.Items.IndexOf(_settings.Mode.ToString());
                }
            }

            if (AreCameraSettingsVisible)
            {
                VideoEngine videoEngine = VideoEngine.Instance;

                if (videoEngine.IsIsoSupported)
                {
                    isoGrid.Visibility = Visibility.Visible;

                    if (isoSelectorListBox.Items.Count == 0)
                    {
                        IReadOnlyList <IsoSpeedPreset> supportedIsoSpeedPresets =
                            _settings.SupportedIsoSpeedPresets;

                        if (supportedIsoSpeedPresets != null)
                        {
                            foreach (IsoSpeedPreset element in supportedIsoSpeedPresets)
                            {
                                isoSelectorListBox.Items.Add(element.ToString());
                            }

                            isoSelectorListBox.SelectedIndex =
                                isoSelectorListBox.Items.IndexOf(_settings.IsoSpeedPreset.ToString());
                        }
                    }
                }
                else
                {
                    isoGrid.Visibility = Visibility.Collapsed;
                }

                if (videoEngine.IsExposureSupported)
                {
                    exposureGrid.Visibility = Visibility.Visible;
                    exposureSlider.Minimum  = videoEngine.ExposureMinStep;
                    exposureSlider.Maximum  = videoEngine.ExposureMaxStep;
                    _exposureStep           = _settings.Exposure;

                    if (_exposureStep < videoEngine.ExposureMinStep || _exposureStep > videoEngine.ExposureMaxStep)
                    {
                        _exposureStep = VideoEngine.ExposureAutoValue;
                    }

                    exposureSlider.Value = _exposureStep;
                    OnExposureChanged();
                }
                else
                {
                    exposureGrid.Visibility = Visibility.Collapsed;
                }
            }
            else
            {
                isoGrid.Visibility      = Visibility.Collapsed;
                exposureGrid.Visibility = Visibility.Collapsed;
            }

            Visibility = Visibility.Visible;

#if WINDOWS_PHONE_APP
            HardwareButtons.BackPressed += OnBackPressed;
#endif

            if (VisibilityChanged != null)
            {
                VisibilityChanged(this, Visibility.Visible);
            }
        }