public static void AddResolutions() { try { foreach (RDPResolutions RDPResolution in Enum.GetValues(typeof(RDPResolutions))) { if (RDPResolution == RDPResolutions.FitToWindow || RDPResolution == RDPResolutions.SmartSize || RDPResolution == RDPResolutions.Fullscreen) { Resolutions.Add(new Resolution(0, 0)); } else { string[] ResSize = (Enum.GetName(typeof(RDPResolutions), RDPResolution)).Split('x'); string ResWidth = (string)(ResSize[0].Substring(3)); string ResHeight = ResSize[1]; Resolutions.Add(new Resolution(Convert.ToInt32(ResWidth), Convert.ToInt32(ResHeight))); } } } catch (Exception ex) { Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, Language.strRdpAddResolutionsFailed + Constants.vbNewLine + ex.Message, true); } }
protected virtual void InitAllResolutions() { ResolutionsKey.Clear(); Resolutions.Clear(); foreach (var item in Screen.resolutions) { string customKey = string.Format($"{item.width}x{item.height}"); if (!ResolutionsKey.Contains(customKey)) { ResolutionsKey.Add(customKey); Resolutions.Add(item); } } Resolutions.Sort((x, y) => { if (x.width > y.width) { return(-1); } else { return(1); } }); }
public UnProjected() { var resolutions = new[] { 0.703125, 0.3515625, 0.17578125, 0.087890625, 0.0439453125, 0.02197265625, 0.010986328125, 0.0054931640625, 0.00274658203125, 0.001373291015625, 0.0006866455078125, 3.4332275390625e-4, 1.71661376953125e-4, 8.58306884765625e-5, 4.291534423828125e-5, }; var count = 0; foreach (var resolution in resolutions) { Resolutions.Add(new Resolution { Id = count.ToString(CultureInfo.InvariantCulture), UnitsPerPixel = resolution }); count++; } Height = 256; Width = 256; Extent = new Extent(-180, -90, 180, 90); OriginX = -180; OriginY = -90; Name = "UnProjected"; Format = "image/png"; Axis = AxisDirection.Normal; Srs = "EPSG:4326"; }
public void AddResolution(Resolution resolution) { if (Resolutions.Add(resolution)) { IsDirty = true; } }
public static void loadFarmInformation() { #region Farm Layouts FarmLayouts.Add(new Layout { Name = "Standard", Image = "images/farms/standard.jpg", Icon = "images/farms/standardIcon.png" }); FarmLayouts.Add(new Layout { Name = "Riverland", Image = "images/farms/riverland.jpg", Icon = "images/farms/riverlandIcon.png" }); FarmLayouts.Add(new Layout { Name = "Forest", Image = "images/farms/forest.jpg", Icon = "images/farms/forestIcon.png" }); FarmLayouts.Add(new Layout { Name = "Hill-Top", Image = "images/farms/hilltop.jpg", Icon = "images/farms/hilltopIcon.png" }); FarmLayouts.Add(new Layout { Name = "Wilderness", Image = "images/farms/wilderness.jpg", Icon = "images/farms/wildernessIcon.png" }); #endregion TerrainObjects.Add(new Terrain { Name = "Grass", Image = "images/terrain/grass.png" }); TerrainObjects.Add(new Terrain { Name = "Amaranth", Image = "images/shippeditems/Amaranth.png" }); Resolutions.Add(50); Resolutions.Add(75); Resolutions.Add(100); }
public TmsGlobalGeodeticTileSchema() { OriginX = -180; OriginY = -90; YAxis = YAxis.TMS; Extent = new Extent(-180, -90, 180, 90); var f = 0.70312500000000000000; for (var p = 0; p <= 20; p++) { Resolutions.Add(p.ToString(), new Resolution(p.ToString(), f)); f = f / 2; } Srs = "EPSG:4326"; }
public Physical(string value) { Value = value; var rgx = new Regex(PHYSICAL_PATTERN); if (!rgx.Match(value).Success) { throw new Exception(string.Format("Invalid Physical Expression - {0}", value)); } if (value.Contains(" to ") && !value.Contains("range")) { throw new Exception(string.Format("Invalid Physical Range - {0}, please prefix a range of values with \"range \"", value)); } string remainder = value; string word = NextWord(remainder, out remainder); while (!string.IsNullOrWhiteSpace(word)) { if (IsNumericExpression(word) || IsQualifier(word)) { _magnitude = new QualifiedQuantity(word + " " + remainder, out remainder); AddQuantity(_magnitude); } else if (IsRange(word)) { var range = new RangingInformation(remainder, out remainder, _magnitude == null ? 0d : _magnitude.Magnitude); Ranges.Add(range); } else if (IsErrorLimit(word)) { ErrorLimits.Add(new ErrorLimit(remainder, out remainder)); } else if (IsResolution(word)) { Resolutions.Add(new Quantity(remainder, out remainder)); } else if (IsConfidence(word)) { } else if (IsLoad(word)) { } word = NextWord(remainder, out remainder); } }
/// <summary> /// Updates the Resolutions list, and sets the heighest Resolution as the SelectedResolution /// </summary> private void UpdateResolutions(IReadOnlyList <IMediaEncodingProperties> videoEncodingProperties) { Resolutions.Clear(); SelectedResolution = null; uint maxPixelheight = 0; foreach (VideoEncodingProperties videoProperties in videoEncodingProperties) { ResolutionWrapper resolutionWrapper = new ResolutionWrapper { Text = videoProperties.Height + " x " + videoProperties.Width, VideoProperties = videoProperties }; Resolutions.Add(resolutionWrapper); // select the heighest resolution if (maxPixelheight < videoProperties.Height) { maxPixelheight = videoProperties.Height; SelectedResolution = resolutionWrapper; } } }
protected override void OnParametersSet() { base.OnParametersSet(); foreach (var c in (SupportedResolution[])Enum.GetValues(typeof(SupportedResolution))) { Resolutions.Add(c, Enum.GetName(typeof(SupportedResolution), c)); } foreach (var c in (ISO[])Enum.GetValues(typeof(ISO))) { Isos.Add(c, Enum.GetName(typeof(ISO), c)); } // Find the config if it exists SettingConfig exitingConfig = SettingsService.Settings.Where(x => string.Compare(x.Name, Name) == 0).FirstOrDefault(); if (exitingConfig != null) { Config = new SettingConfig(exitingConfig.Name, exitingConfig.Settings); } }
public SphericalMercatorWorldSchema() { var resolutions = new double[] { 156543.033900000, 78271.516950000, 39135.758475000, 19567.879237500, 9783.939618750, 4891.969809375, 2445.984904688, 1222.992452344, 611.496226172, 305.748113086, 152.874056543, 76.437028271, 38.218514136, 19.109257068, 9.554628534, 4.777314267, 2.388657133, 1.194328567, 0.597164283 }; foreach (double resolution in resolutions) { Resolutions.Add(resolution); } Height = 256; Width = 256; Extent = new Extent(-20037508.342789, -20037508.342789, 20037508.342789, 20037508.342789); OriginX = -20037508.342789; OriginY = -20037508.342789; Name = "WorldShericalMercator"; Format = "png"; Axis = AxisDirection.Normal; Srs = "EPSG:3785"; }
public void FillData() { //engine setting uint width, height; Engine.Instance.Driver.GetDisplayMode(out width, out height); SVideoSetting videoSetting = Engine.Instance.VideoSetting; // DisplayModes.Clear(); DisplayModes.Add(new DisplayMode() { WindowMode = true }); _cbDisplayModes.SelectedIndex = 0; _cbDisplayModes.SelectionChanged += new SelectionChangedEventHandler(_option_SelectionChanged); // Resolutions.Clear(); Resolutions.Add(new Resolution() { Width = width, Height = height }); _cbResolutions.SelectedIndex = 0; _cbResolutions.SelectionChanged += new SelectionChangedEventHandler(_option_SelectionChanged); // RefreshRates.Default(); _cbRefreshRates.SelectedIndex = 0; _cbRefreshRates.SelectionChanged += new SelectionChangedEventHandler(_option_SelectionChanged); // VideoDevices.Clear(); VideoDevices.Add(new VideoDevice() { Index = 0 }); _cbVideoDevices.SelectedIndex = 0; _cbVideoDevices.SelectionChanged += new SelectionChangedEventHandler(_option_SelectionChanged); // MultiSamples.Default(); _cbMultisamples.SelectedItem = (from x in MultiSamples where x.Sample == videoSetting.antialias select x).ToArray()[0]; _cbMultisamples.SelectionChanged += new SelectionChangedEventHandler(_option_SelectionChanged); // _cbVsyncs.SelectedItem = (from x in VSyncs where x.On == videoSetting.vsync select x).ToArray()[0]; _cbVsyncs.SelectionChanged += new SelectionChangedEventHandler(_option_SelectionChanged); // MatResolutions.Clear(); MatResolutions.Add(new OptionLevel() { Level = E_LEVEL.EL_LOW }); MatResolutions.Add(new OptionLevel() { Level = E_LEVEL.EL_FAIR }); MatResolutions.Add(new OptionLevel() { Level = E_LEVEL.EL_GOOD }); MatResolutions.Add(new OptionLevel() { Level = E_LEVEL.EL_HIGH }); _cbMatResolutions.SelectedItem = (from x in MatResolutions where x.Level == videoSetting.textureResolution select x).ToArray()[0]; _cbMatResolutions.SelectionChanged += new SelectionChangedEventHandler(_option_SelectionChanged); // _cbMatTextureFilters.SelectedItem = (from x in MatTextureFilters where x.Filter == videoSetting.textureFiltering select x).ToArray()[0]; _cbMatTextureFilters.SelectionChanged += new SelectionChangedEventHandler(_option_SelectionChanged); // _cbMatProjections.SelectedItem = (from x in MatProjections where x.On == false select x).ToArray()[0]; _cbMatProjections.SelectionChanged += new SelectionChangedEventHandler(_option_SelectionChanged); // ViewDistances.Default(); _cbViewDistances.SelectedItem = (from x in ViewDistances where x.Level == videoSetting.viewDistance select x).ToArray()[0]; _cbViewDistances.SelectionChanged += new SelectionChangedEventHandler(_option_SelectionChanged); EnvDetails.Default(); _cbEnvDetails.SelectedItem = (from x in EnvDetails where x.Level == videoSetting.envDetail select x).ToArray()[0]; _cbEnvDetails.SelectionChanged += new SelectionChangedEventHandler(_option_SelectionChanged); GroundScenes.Default(); _cbGroundScenes.SelectedItem = (from x in GroundScenes where x.Level == videoSetting.groundClutter select x).ToArray()[0]; _cbGroundScenes.SelectionChanged += new SelectionChangedEventHandler(_option_SelectionChanged); ShadowQualities.Default(); _cbShadowQuality.SelectedItem = (from x in ShadowQualities where x.Level == videoSetting.shadowQuality select x).ToArray()[0]; _cbShadowQuality.SelectionChanged += new SelectionChangedEventHandler(_option_SelectionChanged); LiquidDetails.Clear(); LiquidDetails.Add(new OptionLevel() { Level = E_LEVEL.EL_LOW }); LiquidDetails.Add(new OptionLevel() { Level = E_LEVEL.EL_FAIR }); LiquidDetails.Add(new OptionLevel() { Level = E_LEVEL.EL_GOOD }); LiquidDetails.Add(new OptionLevel() { Level = E_LEVEL.EL_ULTRA }); _cbLiquidDetail.SelectedItem = (from x in LiquidDetails where x.Level == videoSetting.liquidDetail select x).ToArray()[0]; _cbLiquidDetail.SelectionChanged += new SelectionChangedEventHandler(_option_SelectionChanged); SunLightEffects.Clear(); SunLightEffects.Add(new OptionLevel() { Level = E_LEVEL.EL_DISABLE }); SunLightEffects.Add(new OptionLevel() { Level = E_LEVEL.EL_LOW }); SunLightEffects.Add(new OptionLevel() { Level = E_LEVEL.EL_HIGH }); _cbSunLightEffect.SelectedItem = (from x in SunLightEffects where x.Level == videoSetting.sunshafts select x).ToArray()[0]; _cbSunLightEffect.SelectionChanged += new SelectionChangedEventHandler(_option_SelectionChanged); ParticleDensities.Default(); _cbParticleDensity.SelectedItem = (from x in ParticleDensities where x.Level == videoSetting.particleDensity select x).ToArray()[0]; _cbParticleDensity.SelectionChanged += new SelectionChangedEventHandler(_option_SelectionChanged); SSAOLevels.Clear(); SSAOLevels.Add(new OptionLevel() { Level = E_LEVEL.EL_DISABLE }); SSAOLevels.Add(new OptionLevel() { Level = E_LEVEL.EL_LOW }); SSAOLevels.Add(new OptionLevel() { Level = E_LEVEL.EL_HIGH }); _cbSSAO.SelectedItem = (from x in SSAOLevels where x.Level == videoSetting.SSAO select x).ToArray()[0]; _cbSSAO.SelectionChanged += new SelectionChangedEventHandler(_option_SelectionChanged); }
public void AddResolution(object attachment) { Resolutions.Add((ResolutionAttachment)attachment); }