コード例 #1
0
        private void SetupForRectangularLocationSelection(LocationTypeRectangular location)
        {
            this.textLocationType.Visibility     = ViewStates.Visible;
            this.containerRadius.Visibility      = ViewStates.Gone;
            this.containerRectangular.Visibility = ViewStates.Visible;

            switch (location.SizeSpecification)
            {
            case SizeSpecification.WidthAndHeight:
                this.containerRectangularHeight.Visibility       = ViewStates.Visible;
                this.containerRectangularWidth.Visibility        = ViewStates.Visible;
                this.containerRectangularHeightAspect.Visibility = ViewStates.Gone;
                this.containerRectangularWidthAspect.Visibility  = ViewStates.Gone;
                break;

            case SizeSpecification.HeightAndWidthAspect:
                this.containerRectangularHeight.Visibility       = ViewStates.Visible;
                this.containerRectangularWidth.Visibility        = ViewStates.Gone;
                this.containerRectangularHeightAspect.Visibility = ViewStates.Gone;
                this.containerRectangularWidthAspect.Visibility  = ViewStates.Visible;
                break;

            case SizeSpecification.WidthAndHeightAspect:
                this.containerRectangularHeight.Visibility       = ViewStates.Gone;
                this.containerRectangularWidth.Visibility        = ViewStates.Visible;
                this.containerRectangularHeightAspect.Visibility = ViewStates.Visible;
                this.containerRectangularWidthAspect.Visibility  = ViewStates.Gone;
                break;
            }

            this.RefreshRectangularLocationData(location);
        }
コード例 #2
0
        private void RefreshRectangularLocationData(LocationTypeRectangular location)
        {
            this.textLocationType.SetText(location.DisplayNameResourceId);
            this.textRectangularSizeSpecification.Text = this.Context.GetString((int)location.SizeSpecification);
            this.textRectangularWidth.Text             = location.Width.GetStringWithUnit(this.Context);
            this.textRectangularHeight.Text            = location.Height.GetStringWithUnit(this.Context);
            var textFormat = this.Context.GetString(Resource.String.size_no_unit);

            this.editRectangularWidthAspect.Text  = string.Format(textFormat, location.WidthAspectRatio);
            this.editRectangularHeightAspect.Text = string.Format(textFormat, location.HeightAspectRatio);
        }
        public LocationType CreateLocationType()
        {
            if (this.CurrentLocation is RectangularLocationSelection)
            {
                return(LocationTypeRectangular.FromCurrentLocationSelectionAndSettings(this.CurrentLocation, this.settingsManager));
            }
            else if (this.CurrentLocation is RadiusLocationSelection)
            {
                return(LocationTypeRadius.FromCurrentLocationSelection(this.CurrentLocation, this.settingsManager));
            }

            return(LocationTypeNone.FromCurrentLocationSelection(this.CurrentLocation));
        }
コード例 #4
0
        public LocationType GetCurrentLocationType()
        {
            switch (this.CurrentLocationSelection)
            {
            case RadiusLocationSelection locationSelection:
                return(LocationTypeRadius.FromCurrentLocationSelection(locationSelection, this.settingsManager));;

            case RectangularLocationSelection locationSelection:
                return(LocationTypeRectangular.FromCurrentLocationSelectionAndSettings(locationSelection, this.settingsManager));

            default:
                return(LocationTypeNone.FromCurrentLocationSelection(this.CurrentLocationSelection));
            }
        }