상속: IDisposable
예제 #1
0
파일: NiHelp.cs 프로젝트: netide/netide
        private HelpServer GetServer()
        {
            if (_server == null)
            {
                var env = (INiEnv)GetService(typeof(INiEnv));

                string workDirectory = Path.Combine(env.FileSystemRoot, "Cache", "Help");

                Directory.CreateDirectory(workDirectory);

                _server = new HelpServer();
                _server.Manager.Resolve += Manager_Resolve;
                _server.Manager.Registrations.AddRange(_registrations);

                _searchManager = new HelpSearchManager(_server.Manager, workDirectory);
            }

            return _server;
        }
예제 #2
0
파일: NiHelp.cs 프로젝트: netide/netide
        protected override void Dispose(bool disposing)
        {
            if (!_disposed && disposing)
            {
                if (_form != null)
                {
                    _form.Dispose();
                    _form = null;
                }

                if (_server != null)
                {
                    _server.Dispose();
                    _server = null;
                }

                if (_searchManager != null)
                {
                    _searchManager.Dispose();
                    _searchManager = null;
                }

                _disposed = true;
            }

            base.Dispose(disposing);
        }