示例#1
0
        private void LoadResolutions(CameraPosition cameraPosition)
        {
            IReadOnlyList <Windows.Foundation.Size> availableResolutions;

            AvailableResolutions.Clear();

            if (cameraPosition == CameraPosition.Back)
            {
                availableResolutions = PhotoCaptureDevice.GetAvailableCaptureResolutions(CameraSensorLocation.Back);
            }
            else
            {
                availableResolutions = PhotoCaptureDevice.GetAvailableCaptureResolutions(CameraSensorLocation.Front);
            }

            if (availableResolutions != null)
            {
                foreach (var resolution in availableResolutions)
                {
                    AvailableResolutions.Add(new Resolution(resolution));
                }
            }

            if (AvailableResolutions != null)
            {
                if (AvailableResolutions.Count > 0)
                {
                    SelectedResolution = AvailableResolutions[AvailableResolutions.Count() - 1];
                }
            }

            OpenCameraDevice(cameraPosition);
        }
示例#2
0
    public SpaceGrid(Material gridMaterial)
    {
        Resolution.Material = gridMaterial;

        this.resolutions = new Dictionary <AvailableResolutions, Resolution>();

        this.GenerateResolutionGrids();

        this.ActiveResolution = AvailableResolutions.SolarSystem;
    }
        public AutoFailureHandlingOptions(FailureDefinitionAccessor fda) : this()
        {
            FailureGuid = fda.GetId().Guid;
            BuiltInFailuresInternalName = fda.GetBuiltInFailuresInternalName();
            UserDescription             = fda.GetDescriptionText();
            BuiltInFailuresSubCategory  = fda.GetBuiltInFailuresSubCategory();

            switch (fda.GetSeverity())
            {
            case FailureSeverity.None:
                SeverityDescription = "None";
                break;

            case FailureSeverity.Warning:
                SeverityDescription = "Warning";
                break;

            case FailureSeverity.Error:
                SeverityDescription = "Error";
                break;

            case FailureSeverity.DocumentCorruption:
                SeverityDescription = "Document Corruption";
                break;

            default:
                break;
            }

            HasResolutions = fda.HasResolutions();

            if (fda.GetSeverity() == FailureSeverity.Warning)
            {
                AvailableResolutions = AutoOptionsResolution.WarningResolutions.Concat(fda.GetRevitFailureResolutionOptions()).ToList();
            }
            else if (fda.GetSeverity() == FailureSeverity.Error)
            {
                AvailableResolutions = AutoOptionsResolution.ErrorResolutions.Concat(fda.GetRevitFailureResolutionOptions()).ToList();
            }
            else
            {
                AvailableResolutions = new List <FailureResolutionOption>();
            }

            HasResolutions = fda.HasResolutions();
            FailureResolutionOption noActionRes = AvailableResolutions
                                                  .Where(x => x is AutoOptionsResolution)
                                                  .Cast <AutoOptionsResolution>()
                                                  .Where(x => x.Resolution == ((AutoOptionsResolution)AutoOptionsResolution.NoActionRes).Resolution)
                                                  .FirstOrDefault();

            SelectedResIndex = AvailableResolutions.IndexOf(noActionRes);
        }
示例#4
0
 static GraphicsConfigManager()
 {
     Resolution[] resolutions = Screen.resolutions;
     if (resolutions != null)
     {
         foreach (Resolution resolution in resolutions)
         {
             if (IsResolutionSupported(resolution))
             {
                 AvailableResolutions.Add(resolution);
             }
         }
     }
 }
示例#5
0
        private void LoadSettings()
        {
            try
            {
                IsolatedStorageSettings appSettings = IsolatedStorageSettings.ApplicationSettings;

                if (appSettings.Count() > 3)
                {
                    //Flash
                    if (appSettings.Contains("flashon"))
                    {
                        bool flashOn = (bool)appSettings["flashon"];
                        if (flashOn)
                        {
                            FlashOn  = true;
                            FlashOff = false;
                        }
                        else
                        {
                            FlashOff = true;
                            FlashOn  = false;
                        }
                    }

                    //camera location
                    if (appSettings.Contains("frontcameraselected"))
                    {
                        bool frontCamSelected = (bool)appSettings["frontcameraselected"];
                        if (frontCamSelected)
                        {
                            FrontCamera = true;
                            BackCamera  = false;
                        }
                        else
                        {
                            BackCamera  = true;
                            FrontCamera = false;
                        }
                    }

                    if (appSettings.Contains("selectedresolution"))
                    {
                        //picture resolution
                        string selectedResolution = (string)appSettings["selectedresolution"];
                        foreach (Resolution row in AvailableResolutions)
                        {
                            if (row.Display == selectedResolution)
                            {
                                SelectedResolution = row;
                            }
                        }
                        //set resolution to default if there is no resolution
                        if (SelectedResolution == null)
                        {
                            SelectedResolution = AvailableResolutions[AvailableResolutions.Count() - 1];
                        }
                    }

                    if (appSettings.Contains("mainscreenimage"))
                    {
                        //main image
                        string mainImage = (string)appSettings["mainscreenimage"];
                        if (mainImage != null)
                        {
                            foreach (var row in ScreenShots)
                            {
                                if (row.Name == mainImage)
                                {
                                    SelectedScreenShot = row;
                                }
                            }
                        }
                    }

                    if (appSettings.Contains("soundon"))
                    {
                        //sound on or off
                        bool sound = (bool)appSettings["soundon"];
                        if (sound)
                        {
                            SoundOn  = true;
                            SoundOff = false;
                        }
                        else
                        {
                            SoundOff = true;
                            SoundOn  = false;
                        }
                    }

                    if (appSettings.Contains("picturecountvisibilityon"))
                    {
                        //sound on or off
                        bool picCntVis = (bool)appSettings["picturecountvisibilityon"];
                        if (picCntVis)
                        {
                            PictureCountVisibilityOn  = true;
                            PictureCountVisibilityOff = false;
                        }
                        else
                        {
                            PictureCountVisibilityOff = true;
                            PictureCountVisibilityOn  = false;
                        }
                    }

                    if (appSettings.Contains("focuson"))
                    {
                        //focus
                        bool focusOn = (bool)appSettings["focuson"];
                        if (focusOn)
                        {
                            FocusOn  = true;
                            FocusOff = false;
                        }
                        else
                        {
                            FocusOff = true;
                            FocusOn  = false;
                        }
                    }
                }
                else
                {
                    FlashOn     = false;
                    SoundOn     = false;
                    FlashOff    = true;
                    SoundOff    = true;
                    FocusOff    = false;
                    FocusOn     = true;
                    FrontCamera = false;
                    BackCamera  = true;
                    PictureCountVisibilityOn  = true;
                    PictureCountVisibilityOff = false;
                }
            }
            catch (Exception ex)
            {
            }
        }
示例#6
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public OptionsMenuScreen()
            : base("Options")
        {
            int resolutionIndex = AvailableResolutions.FindIndex(d => d.Width == GameSettingsManager.Default.ResolutionWidth &&
                                                                 d.Height == GameSettingsManager.Default.ResolutionHeight);

            if (resolutionIndex != -1)
            {
                _CurrentResolution   = resolutionIndex;
                _TemporaryResolution = resolutionIndex;
            }

            int localeIndex = _AvailableLocales.FindIndex(l => l == GameSettingsManager.Default.Locale);

            if (localeIndex != -1)
            {
                _CurrentLocale = localeIndex;
            }

            // Create our menu entries.
            _ResolutionMenuEntry = new MenuEntry(String.Empty);
            _FullscreenEntry     = new MenuEntry(String.Empty);
            _BorderlessEntry     = new MenuEntry(String.Empty);
            _MusicMenuEntry      = new MenuEntry(String.Empty);
            _SfxMenuEntry        = new MenuEntry(String.Empty);
            _LanguageMenuEntry   = new MenuEntry(String.Empty);
            _InsultsMenuEntry    = new MenuEntry(String.Empty);
            _OceanColorMenuEntry = new MenuEntry(String.Empty);

            SetMenuEntryText();

            MenuEntry back = new MenuEntry("Back");

            // Hook up menu event handlers.
            _ResolutionMenuEntry.Selected += ResolutionMenuEntrySelected;
            _ResolutionMenuEntry.Right    += ResolutionMenuEntryRight;
            _ResolutionMenuEntry.Left     += ResolutionMenuEntryLeft;

            _FullscreenEntry.Selected += FullscreenMenuEntrySelected;

            _BorderlessEntry.Selected += BorderlessMenuEntrySelected;

            _MusicMenuEntry.Right         += MusicMenuEntryRight;
            _MusicMenuEntry.StillRight    += MusicMenuEntryRight;
            _MusicMenuEntry.RightReleased += MusicMenuEntryReleased;
            _MusicMenuEntry.Left          += MusicMenuEntryLeft;
            _MusicMenuEntry.StillLeft     += MusicMenuEntryLeft;
            _MusicMenuEntry.LeftReleased  += MusicMenuEntryReleased;

            _SfxMenuEntry.Right         += SfxMenuEntryRight;
            _SfxMenuEntry.StillRight    += SfxMenuEntryRight;
            _SfxMenuEntry.RightReleased += SfxMenuEntryReleased;
            _SfxMenuEntry.Left          += SfxMenuEntryLeft;
            _SfxMenuEntry.StillLeft     += SfxMenuEntryLeft;
            _SfxMenuEntry.LeftReleased  += SfxMenuEntryReleased;

            _LanguageMenuEntry.Selected += LanguageMenuEntrySelected;

            _InsultsMenuEntry.Selected += InsultsMenuEntrySelected;

            _OceanColorMenuEntry.Selected += OceanColorMenuEntrySelected;

            back.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(_ResolutionMenuEntry);
            MenuEntries.Add(_FullscreenEntry);
            MenuEntries.Add(_BorderlessEntry);
            MenuEntries.Add(_MusicMenuEntry);
            MenuEntries.Add(_SfxMenuEntry);
            MenuEntries.Add(_LanguageMenuEntry);
            MenuEntries.Add(_InsultsMenuEntry);
            MenuEntries.Add(_OceanColorMenuEntry);
            MenuEntries.Add(back);
        }