상속: 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);
        }