Exemplo n.º 1
0
 public SignatureHelpSource(ITextBuffer textBuffer, ICoreShell shell)
 {
     _disposeToken = DisposeToken.Create <SignatureHelpSource>();
     _textBuffer   = textBuffer;
     _shell        = shell;
     ServiceManager.AddService <SignatureHelpSource>(this, textBuffer, shell);
 }
Exemplo 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);
 }
Exemplo 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;
        }
Exemplo 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());
        }
Exemplo 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());
        }
Exemplo 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();
        }
Exemplo n.º 8
0
 public InteractiveWindowConsole(IServiceContainer services)
 {
     _disposeToken = DisposeToken.Create <InteractiveWindowConsole>();
     _workflow     = services.GetService <IRInteractiveWorkflow>();
     _mainThread   = services.MainThread();
 }
Exemplo n.º 9
0
 public DisposeTokenTest()
 {
     _disposeToken = DisposeToken.Create <DisposeTokenTest>();
 }
Exemplo n.º 10
0
 public InteractiveWindowConsole(IRInteractiveWorkflowVisual workflow)
 {
     _workflow     = workflow;
     _disposeToken = DisposeToken.Create <InteractiveWindowConsole>();
     _mainThread   = _workflow.Shell.MainThread();
 }