/// <summary>
        /// Disposes of the resources in <see cref="ToDispose"/>.
        /// </summary>
        void Dispose(bool disposing)
        {
            if (!disposed)
            {
                disposed = true;

                if (disposing)
                {
                    ToDispose?.Dispose();
                }
            }
        }
 /// <summary>
 /// Disposes of the resources in <see cref="ToDispose"/>.
 /// </summary>
 public void Dispose()
 {
     ToDispose?.Dispose();
     ToDispose = null;
 }