Inheritance: IRxSpyEventHandler, IDisposable
コード例 #1
0
        public static RxSpySession Launch(IRxSpyEventHandler eventHandler, bool explicitCapture = false)
        {
            var session = new RxSpySession(eventHandler, explicitCapture);

            Current = session;

            if (Interlocked.CompareExchange(ref _launched, 1, 0) != 0)
            {
                throw new InvalidOperationException("Session already created");
            }

            InstallInterceptingQueryLanguage(session);

            return(session);
        }
コード例 #2
0
        static void InstallInterceptingQueryLanguage(RxSpySession session)
        {
            // TODO: Verify that the version is supported
            var rxLinqAssembly = Assembly.Load(new AssemblyName("System.Reactive.Linq"));

            // Make sure it's initialized
            Observable.Empty <Unit>();

            var observableType             = typeof(Observable);
            var defaultImplementationField = observableType.GetField("s_impl", BindingFlags.Static | BindingFlags.NonPublic);

            var actualImplementation = defaultImplementationField.GetValue(null);

            object proxy = new QueryLanguageProxy(session, actualImplementation)
                           .GetTransparentProxy();

            defaultImplementationField.SetValue(null, proxy);
        }
コード例 #3
0
ファイル: RxSpySession.cs プロジェクト: niik/RxSpy
        public static RxSpySession Launch(IRxSpyEventHandler eventHandler, bool explicitCapture = false)
        {
            var session = new RxSpySession(eventHandler, explicitCapture);
            Current = session;

            if (Interlocked.CompareExchange(ref _launched, 1, 0) != 0)
                throw new InvalidOperationException("Session already created");

            InstallInterceptingQueryLanguage(session);

            return session;
        }
コード例 #4
0
ファイル: RxSpySession.cs プロジェクト: niik/RxSpy
        static void InstallInterceptingQueryLanguage(RxSpySession session)
        {
            // TODO: Verify that the version is supported
            var rxLinqAssembly = Assembly.Load(new AssemblyName("System.Reactive.Linq"));

            // Make sure it's initialized
            Observable.Empty<Unit>();

            var observableType = typeof(Observable);
            var defaultImplementationField = observableType.GetField("s_impl", BindingFlags.Static | BindingFlags.NonPublic);

            var actualImplementation = defaultImplementationField.GetValue(null);

            object proxy = new QueryLanguageProxy(session, actualImplementation)
                .GetTransparentProxy();

            defaultImplementationField.SetValue(null, proxy);
        }