コード例 #1
0
        /// <summary>
        ///     Formats the event as a string.
        /// </summary>
        /// <param name="snapshot">The partition snapshot to format.</param>
        /// <param name="formatter">The formatter to use.</param>
        /// <returns>A formatted snapshot.</returns>
        public static string WriteEvent(this IEventTextFormatter formatter, PartitionSnapshot snapshot)
        {
            Guard.ArgumentNotNull(formatter, "formatter");

            using (var writer = new StringWriter(CultureInfo.CurrentCulture))
            {
                formatter.WriteEvent(snapshot, writer);
                return writer.ToString();
            }
        }
コード例 #2
0
        public void WriteEvent(PartitionSnapshot snapshot, TextWriter writer)
        {
            Guard.ArgumentNotNull(snapshot, "PartitionSnapshot");
            Guard.ArgumentNotNull(writer, "writer");

            writer.WriteLine("{0},{1},{2}",
                snapshot.PartitionId,
                snapshot.CapturedAtTimeUtc,
                snapshot.UnprocessedEvents);
        }