Consider me new to the world of C# and the lingo associated with IObservable lingo. I have a question on how to extract the info from Current. Here is my c# code:
private static IObservable<T> ToObservableInterval<T>(IEnumerable<T> source,
TimeSpan period, System.Reactive.Concurrency.IScheduler scheduler)
{
return Observable.Using(
() => source.GetEnumerator(),
it => Observable.Generate(
default(object),
_ => it.MoveNext(),
_ => _,
_ =>
{
Console.WriteLine("Input {0}", it.Current);
return it.Current;
},
_ => period, scheduler));
}
If I pass the values of this class in the source:
class LogEvent
{
public DateTime X { get; set; }
public int Id { get; set; }
public string ServerName { get; set; }
public string Level { get; set; }
public override string ToString()
{
return new { x, Id, ServerName, Level}.ToString();
}
}
Is there a easy way to extract values of either x, Id, Level out of the Current representation?
Thanks