Esempio n. 1
0
 public SignatureHelpSource(ITextBuffer textBuffer, ICoreShell shell)
 {
     _disposeToken = DisposeToken.Create <SignatureHelpSource>();
     _textBuffer   = textBuffer;
     _shell        = shell;
     ServiceManager.AddService <SignatureHelpSource>(this, textBuffer, shell);
 }
Esempio n. 2
0
 public RSignatureHelpSource(ITextBuffer textBuffer, IServiceContainer services)
 {
     _disposeToken = DisposeToken.Create <RSignatureHelpSource>();
     _textBuffer   = textBuffer;
     _services     = services;
     _settings     = _services.GetService <IREditorSettings>();
     _broker       = _services.GetService <ISignatureHelpBroker>();
     _engine       = new RFunctionSignatureEngine(services);
     textBuffer.AddService(this);
 }
Esempio n. 3
0
        public RSession(int id, Action onDispose)
        {
            Id            = id;
            _onDispose    = onDispose;
            _disposeToken = DisposeToken.Create <RSession>();
            _disableMutatingOnReadConsole = new CountdownDisposable(() => {
                if (!_delayedMutatedOnReadConsole)
                {
                    return;
                }

                _delayedMutatedOnReadConsole = false;
                Task.Run(() => Mutated?.Invoke(this, EventArgs.Empty));
            });
        }
        public PriorityProducerConsumer(int maxPriority = 1, bool excludeDuplicates = false, IEqualityComparer <T> comparer = null)
        {
            _maxPriority = maxPriority;
            _queues      = new List <T> [maxPriority];
            for (var i = 0; i < _queues.Length; i++)
            {
                _queues[i] = new List <T>();
            }

            _syncObj                = new object();
            _pendingTasks           = new Queue <Pending>();
            _firstAvailablePriority = _maxPriority;
            _disposeToken           = DisposeToken.Create <PriorityProducerConsumer <T> >();
            _excludeDuplicates      = excludeDuplicates;
            _comparer               = comparer ?? EqualityComparer <T> .Default;
        }
Esempio n. 5
0
        public RSession(int id, IRHostBrokerConnector brokerConnector, Action onDispose)
        {
            Id = id;
            BrokerConnector = brokerConnector;
            _onDispose      = onDispose;
            _disposeToken   = DisposeToken.Create <RSession>();
            _disableMutatingOnReadConsole = new CountdownDisposable(() => {
                if (!_delayedMutatedOnReadConsole)
                {
                    return;
                }

                _delayedMutatedOnReadConsole = false;
                Task.Run(() => Mutated?.Invoke(this, EventArgs.Empty));
            });

            _afterHostStartedTask = TaskUtilities.CreateCanceled(new RHostDisconnectedException());
        }
Esempio n. 6
0
        public RSession(int id, IBrokerClient brokerClient, Action onDispose)
        {
            Id            = id;
            BrokerClient  = brokerClient;
            _onDispose    = onDispose;
            _disposeToken = DisposeToken.Create <RSession>();
            _disableMutatingOnReadConsole = new CountdownDisposable(() => {
                if (!_delayedMutatedOnReadConsole)
                {
                    return;
                }

                _delayedMutatedOnReadConsole = false;
                Task.Run(() => Mutated?.Invoke(this, EventArgs.Empty));
            });

            _initializationLock   = new BinaryAsyncLock();
            _initializationTcs    = new TaskCompletionSourceEx <object>();
            _afterHostStartedTask = TaskUtilities.CreateCanceled(new RHostDisconnectedException());
        }
Esempio n. 7
0
        public RSession(int id, string name, IBrokerClient brokerClient, IExclusiveReaderLock initializationLock, Action onDispose)
        {
            Id            = id;
            Name          = name;
            BrokerClient  = brokerClient;
            _onDispose    = onDispose;
            _disposeToken = DisposeToken.Create <RSession>();
            _disableMutatingOnReadConsole = new CountdownDisposable(() => {
                if (!_delayedMutatedOnReadConsole)
                {
                    return;
                }

                _delayedMutatedOnReadConsole = false;
                Task.Run(() => Mutated?.Invoke(this, EventArgs.Empty));
            });

            _initializationLock = initializationLock;
            _stopHostLock       = new BinaryAsyncLock(true);
            _hostStartedTcs     = new TaskCompletionSourceEx <object>();
            _startupInfo        = new RHostStartupInfo();
        }
Esempio n. 8
0
 public InteractiveWindowConsole(IServiceContainer services)
 {
     _disposeToken = DisposeToken.Create <InteractiveWindowConsole>();
     _workflow     = services.GetService <IRInteractiveWorkflow>();
     _mainThread   = services.MainThread();
 }
Esempio n. 9
0
 public DisposeTokenTest()
 {
     _disposeToken = DisposeToken.Create <DisposeTokenTest>();
 }
Esempio n. 10
0
 public InteractiveWindowConsole(IRInteractiveWorkflowVisual workflow)
 {
     _workflow     = workflow;
     _disposeToken = DisposeToken.Create <InteractiveWindowConsole>();
     _mainThread   = _workflow.Shell.MainThread();
 }