コード例 #1
0
        private void OkBtn_Click(object sender, RoutedEventArgs e)
        {
            float?resizeFactor = ResizeLabUtil.ConvertToFloat(ResizeFactorTextBox.Text);

            if (ResizeLabUtil.IsValidFactor(resizeFactor))
            {
                _resizeLab.SlightAdjustResizeFactor = (float)resizeFactor;
                Close();
            }
            else
            {
                MessageBox.Show(TextCollection.ResizeLabText.ErrorValueLessThanEqualsZero, TextCollection.CommonText.ErrorTitle);
            }
        }
コード例 #2
0
        private void OkBtn_Click(object sender, RoutedEventArgs e)
        {
            var resizeFactor = ResizeLabUtil.ConvertToFloat(ResizeFactorTextBox.Text);

            if (ResizeLabUtil.IsValidFactor(resizeFactor))
            {
                _resizeLab.SlightAdjustResizeFactor = (float)resizeFactor;
                Close();
            }
            else
            {
                MessageBox.Show("Please enter a value greater than 0", "Error");
            }
        }
コード例 #3
0
        private void OkBtn_Click(object sender, RoutedEventArgs e)
        {
            List <float> proportionList = new List <float>();

            for (int i = 1; i < ShapesGrid.Children.Count; i += 2)
            {
                var textBox    = ShapesGrid.Children[i] as TextBox;
                var proportion = ResizeLabUtil.ConvertToFloat(textBox.Text);

                if (ResizeLabUtil.IsValidFactor(proportion))
                {
                    proportionList.Add(proportion.Value);
                }
                else
                {
                    MessageBox.Show("Please enter a value greater than 0 (Shape " + (i + 1) / 2 + ")", "Error");
                    return;
                }
            }
            _resizeLab.AdjustProportionallyProportionList = proportionList;
            Close();
        }
コード例 #4
0
        private void OkBtn_Click(object sender, RoutedEventArgs e)
        {
            List <float> proportionList = new List <float>();

            for (int i = 1; i < ShapesGrid.Children.Count; i += 2)
            {
                TextBox textBox    = ShapesGrid.Children[i] as TextBox;
                float?  proportion = ResizeLabUtil.ConvertToFloat(textBox.Text);

                if (ResizeLabUtil.IsValidFactor(proportion))
                {
                    proportionList.Add(proportion.Value);
                }
                else
                {
                    MessageBox.Show(string.Format(TextCollection.ResizeLabText.ErrorValueLessThanEqualsZeroWithShape, (i + 1) / 2), TextCollection.CommonText.ErrorTitle);
                    return;
                }
            }
            _resizeLab.AdjustProportionallyProportionList = proportionList;
            Close();
        }