public void Solution_Closed()
        {
            EnableFsWatcher(false);
            fsWatcher = null;

            cbProblems.Items.Clear();
            EnableAll(false);

            if (CHelperServer != null)
            {
                CHelperServer.Stop();
                CHelperServer = null;
            }
        }
        public void Solution_Opened()
        {
            lock (ToDoAfterAllProjectsLoaded)
            {
                IsProjectsLoadingInProgress = true;
                ToDoAfterAllProjectsLoaded.Clear();
            }

            bool isCaideDirectory = SolutionUtilities.IsCaideSolution();

            EnableAll(isCaideDirectory);

            if (isCaideDirectory)
            {
                var windowFrame = (IVsWindowFrame)mainToolWindow.Frame;
                windowFrame.Show();
                ReloadProblemList();

                if (CHelperServer != null)
                {
                    CHelperServer.Stop();
                    CHelperServer = null;
                }

                string enableChelperServerStr =
                    CaideExe.Run(new[] { "getopt", "vscaide", "enable_http_server" }, loud: Loudness.QUIET) ?? "1";
                if (new[] { "yes", "1", "true" }.Contains(enableChelperServerStr.ToLowerInvariant().Trim()))
                {
                    CHelperServer = new CHelperServer();
                }
                else
                {
                    Logger.LogMessage("Disabling CHelper HTTP server due to a setting in caide.ini");
                }


                EnableFsWatcher(false);

                string path = Path.Combine(SolutionUtilities.GetSolutionDir(), ".caide");
                fsWatcher = new FileSystemWatcher(path, "config")
                {
                    EnableRaisingEvents   = false,
                    IncludeSubdirectories = false,
                    NotifyFilter          = NotifyFilters.LastWrite,
                };
                fsWatcher.Changed            += fsWatcher_Changed;
                fsWatcher.EnableRaisingEvents = true;
                AfterProjectsLoaded(() => projectManager.CreateCppLibProject());
            }
        }
Пример #3
0
        public void Solution_Closed()
        {
            EnableFsWatcher(false);
            fsWatcher = null;

            cbProblems.Items.Clear();
            EnableAll(false);

            if (CHelperServer != null)
            {
                CHelperServer.Stop();
                CHelperServer = null;
            }
        }
Пример #4
0
        public void Solution_Opened()
        {
            lock (ToDoAfterAllProjectsLoaded)
            {
                IsProjectsLoadingInProgress = true;
                ToDoAfterAllProjectsLoaded.Clear();
            }

            bool isCaideDirectory = SolutionUtilities.IsCaideSolution();
            EnableAll(isCaideDirectory);

            if (isCaideDirectory)
            {
                var windowFrame = (IVsWindowFrame)mainToolWindow.Frame;
                windowFrame.Show();
                ReloadProblemList();

                if (CHelperServer != null)
                {
                    CHelperServer.Stop();
                    CHelperServer = null;
                }

                string enableChelperServerStr =
                    CaideExe.Run(new[] { "getopt", "vscaide", "enable_http_server" }, loud: Loudness.QUIET) ?? "1";
                if (new[] { "yes", "1", "true" }.Contains(enableChelperServerStr.ToLowerInvariant().Trim()))
                {
                    CHelperServer = new CHelperServer();
                }
                else
                {
                    Logger.LogMessage("Disabling CHelper HTTP server due to a setting in caide.ini");
                }

                EnableFsWatcher(false);

                string path = Path.Combine(SolutionUtilities.GetSolutionDir(), ".caide");
                fsWatcher = new FileSystemWatcher(path, "config")
                {
                    EnableRaisingEvents = false,
                    IncludeSubdirectories = false,
                    NotifyFilter = NotifyFilters.LastWrite,
                };
                fsWatcher.Changed += fsWatcher_Changed;
                fsWatcher.EnableRaisingEvents = true;
                AfterProjectsLoaded(() => projectManager.CreateCppLibProject());
            }
        }