public void ConvertTest()
        {
            var converter = new PointsConverter();

            Assert.AreEqual("Points: 10",
                            converter.Convert(10, null, null, null));
        }
Exemplo n.º 2
0
    protected void CalculatePointsValue()
    {
        try
        {
            int   points = Int32.Parse(SliderSinglePointsTextBox.Text);
            Money Amount = PointsConverter.ToMoney(points);

            PointsNumberLabel.Text = points.ToString();
            PointsValueLabel.Text  = Amount.ToString();
        }
        catch (Exception ex) { }
    }
Exemplo n.º 3
0
        /// <summary>
        /// The parse drawing.
        /// </summary>
        /// <param name="points">
        /// The points.
        /// </param>
        /// <param name="pageSize">
        /// The page Size.
        /// </param>
        /// <returns>
        /// The <see cref="IEnumerable{Point}"/>.
        /// </returns>
        private IEnumerable <Point> ParseDrawing(string points, Rectangle pageSize)
        {
            var result = new List <Point>();

            foreach (var point in PointsConverter.Parse(points))
            {
                {
                    var x = point.X;
                    var y = pageSize.Height - point.Y;
                    result.Add(new Point {
                        X = x, Y = y
                    });
                }
            }

            return(result);
        }
Exemplo n.º 4
0
 public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object valueObject)
 {
     return(new Wrapper.Points(PointsConverter.ConvertFromString(GetValueAsString(valueObject))));
 }
Exemplo n.º 5
0
 public override object ConvertFromInvariantString(string value)
 {
     return(new Wrapper.Points(PointsConverter.ConvertFromString(value)));
 }