зеркало из https://github.com/microsoft/Tx.git
Update the LINQPad driver
This commit is contained in:
Родитель
5db9afe29b
Коммит
0686f108a4
Двоичные данные
References/LinqPad/LINQPad.exe
Двоичные данные
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)
|
||||
|
|
Загрузка…
Ссылка в новой задаче