This commit is contained in:
georgis 2013-10-25 20:49:47 -07:00
Родитель 5db9afe29b
Коммит 0686f108a4
3 изменённых файлов: 9 добавлений и 28 удалений

Двоичные данные
References/LinqPad/LINQPad.exe

Двоичный файл не отображается.

Просмотреть файл

@ -5,5 +5,5 @@ using System.Reflection;
[assembly: AssemblyCompany("MS Open Tech")]
[assembly: AssemblyProduct("Tx (LINQ to Traces)")]
[assembly: AssemblyCopyright("Copyright © MS Open Tech 2012")]
[assembly: AssemblyVersion("1.0.30930.0")]
[assembly: AssemblyFileVersion("1.0.30930.0")]
[assembly: AssemblyVersion("1.0.31025.0")]
[assembly: AssemblyFileVersion("1.0.31025.0")]

Просмотреть файл

@ -288,34 +288,15 @@ namespace Tx.LinqPad
return item;
}
public override void PreprocessObjectToWrite(ref object objectToWrite, ObjectGraphInfo info)
public override void OnQueryFinishing(IConnectionInfo cxInfo, object context, QueryExecutionManager executionManager)
{
if (null == objectToWrite)
return;
var playback = (Playback)context
.GetType()
.GetProperty("playback")
.GetValue(context, new object[] {});
Type type = objectToWrite.GetType();
if (type.IsGenericType && type.GetInterface(typeof (IObservable<>).Name) != null)
{
Type[] genericArguments = type.GetGenericArguments();
Type eventType = genericArguments[genericArguments.Length - 1];
MethodInfo process = GetType().GetMethod("RunSingleOutput", BindingFlags.Static | BindingFlags.Public);
process = process.MakeGenericMethod(eventType);
objectToWrite = process.Invoke(null, new[] {objectToWrite});
return;
}
}
//// this implements auto-start in "C# Expression" mode
//// In ohter modes Run or Start must be called from the queries
public static IEnumerable<T> RunSingleOutput<T>(IObservable<T> output)
{
var playback = (Playback) Thread.GetData(_threadStorageSlot);
IEnumerable<T> list = playback.BufferOutput(output);
playback.Run();
return list;
if (playback != null)
playback.Run();
}
private static Assembly AssemblyResolve(object sender, ResolveEventArgs args)