コード例 #1
0
        internal T SwitchExecutor <T>(T newExecutor)
            where T : IExecutor
        {
            newExecutor.Init(previous: _executor);
            _executor.Dispose(); // after INIT to make sure the new executor works

            _executor = newExecutor;
            return(newExecutor);
        }
コード例 #2
0
        private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            _instructions?.Clear();
            _instructions = null;

            _executionEnvironment?.Dispose();
            _executionEnvironment = null;

            _executor?.Dispose();
            _executor = null;
        }
コード例 #3
0
 private void Dispose(bool disposing)
 {
     if (!disposing || _disposed)
     {
         return;
     }
     Stop();
     _queue.Dispose();
     _executor.Dispose();
     _disposed = true;
 }
コード例 #4
0
        private void CloseFile()
        {
            _currentFileStream.Close();
            _currentFileName = null;

            _instructions.Clear();
            _instructions = null;

            _executionEnvironment.Dispose();
            _executionEnvironment = null;

            _executor.Dispose();
            _executor = null;

            ResetUi();
        }
コード例 #5
0
 /// <inheritdoc />
 protected override void OnStop()
 {
     _logging.LogDebug("Service stopped.");
     _timer?.Dispose();
     _executor?.Dispose();
     try
     {
         if (_api != null)
         {
             //TODO: find out how to dispose webapp
             // Structure map ioc is buggy and will throw an exception
             // see: https://github.com/WebApiContrib/WebApiContrib.IoC.StructureMap/commit/d0306db2169303f3fdb56a7c7ac940207b5cf0c2
             // Nuget has not been updated since 2012. switch to submodule, or ignore.
             //_api.Dispose();
         }
     }
     catch (Exception e)
     {
         _logging.LogException(e, "Failed to dispose webapp");
     }
 }
コード例 #6
0
        protected IDisposable StateHasChanged(IExecutor executor, bool immediate = true)
        {
            AddStateChange(executor);

            if (immediate)
            {
                StateHasChanged();
            }

            IDisposable disposable = new ActionDisposable(() =>
            {
                PostStateChange.Remove(executor);

                executor.Dispose();
            });

            PropChangeDisposables.Add(disposable);

            Disposables.Add(disposable);

            return(disposable);
        }
コード例 #7
0
 public void OneTimeTearDown()
 {
     Executor?.Dispose();
 }
コード例 #8
0
ファイル: BindManager.cs プロジェクト: zakyrion/Nexus
 public void Dispose()
 {
     _executor?.Dispose();
 }
コード例 #9
0
 private void FrmController_FormClosed(object sender, FormClosedEventArgs e)
 {
     executor.Dispose();
 }