Exemple #1
0
        /// <summary>
        /// Handles the randomization of the cartographic properties of this stroke.
        /// </summary>
        /// <param name="generator">The random class that generates the random numbers</param>
        protected override void OnRandomize(Random generator)
        {
            base.OnRandomize(generator);
            DashStyle        = DashStyle.Custom;
            _dashCap         = generator.NextEnum <DashCap>();
            _startCap        = generator.NextEnum <LineCap>();
            _endCap          = generator.NextEnum <LineCap>();
            _dashButtons     = generator.NextBoolArray(1, 20);
            _compoundButtons = generator.NextBoolArray(1, 5);
            _offset          = generator.NextFloat(10);
            _joinType        = generator.NextEnum <LineJoinType>();
            int len = generator.Next(0, 1);

            if (len > 0)
            {
                _decorations.Clear();
                LineDecoration ld = new LineDecoration();
                ld.Randomize(generator);
                _decorations.Add(ld);
            }
        }
 /// <summary>
 /// Handles the randomization of the cartographic properties of this stroke.
 /// </summary>
 /// <param name="generator">The random class that generates the random numbers</param>
 protected override void OnRandomize(Random generator)
 {
     base.OnRandomize(generator);
     DashStyle = DashStyle.Custom;
     _dashCap = generator.NextEnum<DashCap>();
     _startCap = generator.NextEnum<LineCap>();
     _endCap = generator.NextEnum<LineCap>();
     _dashButtons = generator.NextBoolArray(1, 20);
     _compoundButtons = generator.NextBoolArray(1, 5);
     _offset = generator.NextFloat(10);
     _joinType = generator.NextEnum<LineJoinType>();
     int len = generator.Next(0, 1);
     if (len > 0)
     {
         _decorations.Clear();
         LineDecoration ld = new LineDecoration();
         ld.Randomize(generator);
         _decorations.Add(ld);
     }
 }