private Section CreatePositionSection() { var rows = new List <Row>(); var worldFacingCamera = CameraObject.GetCamera(CameraPosition.WorldFacing); if (worldFacingCamera != null) { rows.Add(BoolOptionRow.Create( "World Facing", () => SettingsManager.Instance.Camera == worldFacingCamera, _ => SettingsManager.Instance.Camera = worldFacingCamera, this.DataSourceListener )); } var userFacingCamera = CameraObject.GetCamera(CameraPosition.UserFacing); if (userFacingCamera != null) { rows.Add(BoolOptionRow.Create( "User Facing", () => SettingsManager.Instance.Camera == userFacingCamera, _ => SettingsManager.Instance.Camera = userFacingCamera, this.DataSourceListener )); } return(new Section(rows.ToArray(), "Camera Position")); }
public CompositeTypesDataSource(IDataSourceListener dataSourceListener) { this.DataSourceListener = dataSourceListener; List <Row> options = new List <Row>(); foreach (CompositeType type in Enum.GetValues(typeof(CompositeType))) { options.Add(BoolOptionRow.Create( title: type.ToString(), getter: () => SettingsManager.Instance.EnabledCompositeTypes.HasFlag(type), setter: selected => { CompositeType compositeTypes = SettingsManager.Instance.EnabledCompositeTypes; if (selected) { compositeTypes |= type; } else { compositeTypes &= ~type; } SettingsManager.Instance.EnabledCompositeTypes = compositeTypes; }, this.DataSourceListener)); } this.Sections = new[] { new Section(options.ToArray(), "Type") }; }
private Section CreateTypeSection() { return(new Section(new [] { BoolOptionRow.Create( "None", () => SettingsManager.Instance.ViewfinderKind == ViewfinderKind.None, (_) => SettingsManager.Instance.ViewfinderKind = ViewfinderKind.None, this.DataSourceListener ), BoolOptionRow.Create( "Rectangular", () => SettingsManager.Instance.ViewfinderKind == ViewfinderKind.Rectangular, (_) => SettingsManager.Instance.ViewfinderKind = ViewfinderKind.Rectangular, this.DataSourceListener ), BoolOptionRow.Create( "Laserline", () => SettingsManager.Instance.ViewfinderKind == ViewfinderKind.Laserline, (_) => SettingsManager.Instance.ViewfinderKind = ViewfinderKind.Laserline, this.DataSourceListener ), BoolOptionRow.Create( "Aimer", () => SettingsManager.Instance.ViewfinderKind == ViewfinderKind.Aimer, (_) => SettingsManager.Instance.ViewfinderKind = ViewfinderKind.Aimer, this.DataSourceListener ) }, "Type")); }
private Section CreateTypeSection() { return(new Section(new [] { BoolOptionRow.Create( "None", () => SettingsManager.Instance.Viewfinder == null, (_) => SettingsManager.Instance.Viewfinder = null, this.DataSourceListener ), BoolOptionRow.Create( "Rectangular", () => SettingsManager.Instance.Viewfinder is RectangularViewfinder, (_) => SettingsManager.Instance.Viewfinder = RectangularViewfinder.Create(), this.DataSourceListener ), BoolOptionRow.Create( "Laserline", () => SettingsManager.Instance.Viewfinder is LaserlineViewfinder, (_) => SettingsManager.Instance.Viewfinder = LaserlineViewfinder.Create(), this.DataSourceListener ) }, "Type")); }