示例#1
0
        public static ViewfinderKind UpdateRectangularStyle(RectangularViewfinderStyleType styleType, RectangularViewfinderLineStyleType lineStyleType)
        {
            if (lineStyleType.LineStyle != ((RectangularViewfinder)Rectangular.Viewfinder).LineStyle)
            {
                Rectangular = new ViewfinderKind(1, "Rectangular", RectangularViewfinder.Create(styleType.Style, lineStyleType.LineStyle));

                var viewfinder = (RectangularViewfinder)Rectangular.Viewfinder;
                viewfinder.Animation     = SettingsManager.Instance.RectangularViewfinderAnimation;
                viewfinder.Dimming       = SettingsManager.Instance.RectangularViewfinderDimming;
                viewfinder.Color         = SettingsManager.Instance.RectangularViewfinderColor.UIColor;
                viewfinder.DisabledColor = SettingsManager.Instance.RectangularViewfinderDisabledColor.UIColor;

                if (SettingsManager.Instance.ViewfinderSizeSpecification == RectangularSizeSpecification.WidthAndHeight)
                {
                    viewfinder.SetSize(new SizeWithUnit(SettingsManager.Instance.RectangularWidth, SettingsManager.Instance.RectangularHeight));
                }
                else if (SettingsManager.Instance.ViewfinderSizeSpecification == RectangularSizeSpecification.WidthAndHeightAspect)
                {
                    viewfinder.SetWidthAndAspectRatio(SettingsManager.Instance.RectangularWidth, SettingsManager.Instance.RectangularHeightAspect);
                }
                else if (SettingsManager.Instance.ViewfinderSizeSpecification == RectangularSizeSpecification.HeightAndWidthAspect)
                {
                    viewfinder.SetHeightAndAspectRatio(SettingsManager.Instance.SpotlightHeight, SettingsManager.Instance.RectangularWidthAspect);
                }
                else if (SettingsManager.Instance.ViewfinderSizeSpecification == RectangularSizeSpecification.ShorterDimensionAndAspectRatio)
                {
                    viewfinder.SetShorterDimensionAndAspectRatio(SettingsManager.Instance.RectangularShorterDimension, SettingsManager.Instance.RectangularLongerDimensionAspect);
                }
            }

            return(Rectangular);
        }
示例#2
0
 private Section CreateLaserlineSettings()
 {
     return(new Section(new Row[]
     {
         ChoiceRow <LaserlineViewfinderStyleType> .Create(
             "Style",
             Enumeration.GetAll <LaserlineViewfinderStyleType>().ToArray(),
             () => SettingsManager.Instance.LaserlineViewfinderStyleType,
             newStyle =>
         {
             SettingsManager.Instance.LaserlineViewfinderStyleType = newStyle;
             SettingsManager.Instance.ViewfinderKind = ViewfinderKind.UpdateLaserlineStyle(newStyle);
             this.laserlineSettings = this.CreateLaserlineSettings();
         },
             this.DataSourceListener),
         FloatWithUnitRow.Create(
             "Width",
             () => (SettingsManager.Instance.ViewfinderKind.Viewfinder as LaserlineViewfinder).Width,
             unit => (SettingsManager.Instance.ViewfinderKind.Viewfinder as LaserlineViewfinder).Width = unit,
             this.DataSourceListener
             ),
         this.LaserlineViewfinderEnabledColorRow(),
         ChoiceRow <LaserlineViewfinderDisabledColor> .Create(
             "Disabled Color",
             Enumeration.GetAll <LaserlineViewfinderDisabledColor>().ToArray(),
             () => SettingsManager.Instance.LaserlineViewfinderDisabledColor,
             color => SettingsManager.Instance.LaserlineViewfinderDisabledColor = color,
             this.DataSourceListener
             )
     }, "Laserline"));
 }
示例#3
0
        public static ViewfinderKind UpdateLaserlineStyle(LaserlineViewfinderStyleType styleType)
        {
            if (styleType.Style != ((LaserlineViewfinder)Laserline.Viewfinder).Style)
            {
                Laserline = new ViewfinderKind(2, "Laserline", LaserlineViewfinder.Create(styleType.Style));

                SettingsManager.Instance.LaserlineViewfinderEnabledColor         = LaserlineViewfinderEnabledColor.Default;
                SettingsManager.Instance.LaserlineViewfinderAnimatedEnabledColor = LaserlineViewfinderAnimatedEnabledColor.Default;
                SettingsManager.Instance.LaserlineViewfinderDisabledColor        = LaserlineViewfinderDisabledColor.Default;
            }

            return(Laserline);
        }
示例#4
0
 private Section CreateRectangularSettings()
 {
     return(new Section(new Row[]
     {
         ChoiceRow <RectangularViewfinderStyleType> .Create(
             "Style",
             Enumeration.GetAll <RectangularViewfinderStyleType>().ToArray(),
             () => SettingsManager.Instance.RectangularViewfinderStyleType,
             newStyle =>
         {
             SettingsManager.Instance.RectangularViewfinderStyleType = newStyle;
             SettingsManager.Instance.ViewfinderKind = ViewfinderKind.UpdateRectangularStyle(newStyle);
         },
             this.DataSourceListener),
         ChoiceRow <RectangularViewfinderLineStyleType> .Create(
             "Line Style",
             Enumeration.GetAll <RectangularViewfinderLineStyleType>().ToArray(),
             () => SettingsManager.Instance.RectangularViewfinderLineStyleType,
             newLineStyle =>
         {
             SettingsManager.Instance.RectangularViewfinderLineStyleType = newLineStyle;
             SettingsManager.Instance.ViewfinderKind = ViewfinderKind.UpdateRectangularStyle(
                 SettingsManager.Instance.RectangularViewfinderStyleType, newLineStyle);
         },
             this.DataSourceListener),
         FloatRow.Create(
             "Dimming (0.0 - 1.0)",
             () => NumberFormatter.Instance.FormatNFloat(SettingsManager.Instance.RectangularViewfinderDimming),
             () => SettingsManager.Instance.RectangularViewfinderDimming,
             value => SettingsManager.Instance.RectangularViewfinderDimming = value
             ),
         ChoiceRow <RectangularViewfinderColor> .Create(
             "Color",
             Enumeration.GetAll <RectangularViewfinderColor>().ToArray(),
             () => SettingsManager.Instance.RectangularViewfinderColor,
             newColor => SettingsManager.Instance.RectangularViewfinderColor = newColor,
             this.DataSourceListener),
         ChoiceRow <RectangularViewfinderDisabledColor> .Create(
             "Disabled Color",
             Enumeration.GetAll <RectangularViewfinderDisabledColor>().ToArray(),
             () => SettingsManager.Instance.RectangularViewfinderDisabledColor,
             newColor => SettingsManager.Instance.RectangularViewfinderDisabledColor = newColor,
             this.DataSourceListener
             )
     }, "Rectangular"));
 }
示例#5
0
        public static ViewfinderKind UpdateRectangularStyle(RectangularViewfinderStyleType styleType)
        {
            if (styleType.Style != ((RectangularViewfinder)Rectangular.Viewfinder).Style)
            {
                Rectangular = new ViewfinderKind(1, "Rectangular", RectangularViewfinder.Create(styleType.Style));

                var viewfinder = (RectangularViewfinder)Rectangular.Viewfinder;
                viewfinder.Animation = null;
                SettingsManager.Instance.RectangularViewfinderAnimation     = viewfinder.Animation;
                SettingsManager.Instance.RectangularViewfinderLineStyleType = viewfinder.LineStyle ==
                                                                              RectangularViewfinderLineStyle.Light ? RectangularViewfinderLineStyleType.Light : RectangularViewfinderLineStyleType.Bold;
                SettingsManager.Instance.RectangularViewfinderDimming       = viewfinder.Dimming;
                SettingsManager.Instance.RectangularViewfinderColor         = RectangularViewfinderColor.Default;
                SettingsManager.Instance.RectangularViewfinderDisabledColor = RectangularViewfinderDisabledColor.Default;
            }

            return(Rectangular);
        }