/// <summary>
        /// Map the internal indices to external indices.
        /// </summary>
        /// <param name="internalIndexes">A tuple of internal row and column indices.</param>
        /// <returns>
        /// A tuple of external row and column indices.
        /// </returns>
        /// <exception cref="ArgumentNullException">internalIndexes</exception>
        public Tuple <int, int> InternalToExternal(Tuple <int, int> internalIndexes)
        {
            internalIndexes.ThrowIfNull(nameof(internalIndexes));

            var row    = Row.Reverse(internalIndexes.Item1);
            var column = Column.Reverse(internalIndexes.Item2);

            return(new Tuple <int, int>(row, column));
        }
Beispiel #2
0
        public static T[] ToArray <T>(this Tuple <T> tuple)
        {
            tuple.ThrowIfNull(nameof(tuple));

            return(new[]
            {
                tuple.Item1
            });
        }
        /// <summary>
        /// Map the external indices to internal indices.
        /// </summary>
        /// <param name="externalIndexes">A tuple of external row and column indices.</param>
        /// <returns>
        /// A tuple of internal row and column indices.
        /// </returns>
        /// <exception cref="ArgumentNullException">externalIndexes</exception>
        public Tuple <int, int> ExternalToInternal(Tuple <int, int> externalIndexes)
        {
            externalIndexes.ThrowIfNull(nameof(externalIndexes));

            var row    = Row[externalIndexes.Item1];
            var column = Column[externalIndexes.Item2];

            return(new Tuple <int, int>(row, column));
        }
Beispiel #4
0
        public static List <T> ToList <T>(this Tuple <T> tuple)
        {
            tuple.ThrowIfNull(nameof(tuple));

            return(new List <T>
            {
                tuple.Item1
            });
        }
Beispiel #5
0
 public Theme(Color[] colorSrc, Tuple<PathStyles, StopStyles, RadiusStyle, ColorStyle> styles, double radiusFactor, double quantumColorPick)
 {
     this.styles = styles;
     this.colors = new Gradient(colorSrc.ThrowIfEmpty());
     this.painter = new Painter(styles.ThrowIfNull());
     this.colorPick = styles.Item4.Delegate().ThrowIfNull();
     this.radiusFactor = radiusFactor;
     this.quantumColorPick = quantumColorPick;
     this.oldPercent = 0.5;
 }
Beispiel #6
0
        public static List <T> ToList <T>(this Tuple <T, T, T, T, T, T> tuple)
        {
            tuple.ThrowIfNull(nameof(tuple));

            return(new List <T>
            {
                tuple.Item1,
                tuple.Item2,
                tuple.Item3,
                tuple.Item4,
                tuple.Item5,
                tuple.Item6
            });
        }
Beispiel #7
0
        public static T[] ToArray <T>(this Tuple <T, T, T, T, T, T> tuple)
        {
            tuple.ThrowIfNull(nameof(tuple));

            return(new[]
            {
                tuple.Item1,
                tuple.Item2,
                tuple.Item3,
                tuple.Item4,
                tuple.Item5,
                tuple.Item6
            });
        }
Beispiel #8
0
 public Theme(Color[] colorSrc, Tuple<PathStyles, StopStyles, RadiusStyles> styles, double radiusFactor)
 {
     this.colors = new Gradient(colorSrc.ThrowIfEmpty());
     this.painter = new Painter(styles.ThrowIfNull());
     this.radiusFactor = radiusFactor;
 }