Exemple #1
0
        /// <summary>
        /// Concatenates the indices representing a key path to the current key path and returns the result.
        /// </summary>
        /// <param name="indices">The indices representing a key path to concenate to the current path.</param>
        /// <returns>Returns the key path resulting from this key path concatenated with the provided indices representing a key path.</returns>
        public KeyPath Concat(uint[] indices)
        {
            // We'll want to concatenate our indices
            uint[] concatenatedIndices = Indices.Concat(indices).ToArray();

            // Return a new key path
            return(new KeyPath(concatenatedIndices));
        }
        /// <summary>
        /// Concatenates two snapshots.
        /// </summary>
        /// <param name="other">Snapshot to concat.</param>
        /// <returns>Concatenated snapshots.</returns>
        private RouteSnapshot Concat(RouteSnapshot other)
        {
            if (!ValidExceptRouteInfo())
            {
                return(other);
            }

            if (!other.ValidExceptRouteInfo())
            {
                return(this);
            }

            return(new RouteSnapshot(
                       Indices.Concat(other.Indices.Skip(1).Select(i => i + Points.Length)),
                       Points.Concat(other.Points),
                       Info ?? other.Info
                       ));
        }