public string GetStartTime()
        {
            if (WasEverInTrial() == false)
            {
                return(string.Empty);
            }

            return(registryUtility.ReadCurrentUserKey(keyName));
        }
示例#2
0
        public void OnWindowActivated(Window GotFocus, Window LostFocus)
        {
            VsWindowController.SetPreviousActiveWindow(LostFocus);

            if (ReleaseNotesView.WasShown == false)
            {
                var releaseNotesView = new ReleaseNotesView(true);
                releaseNotesView.Show();
            }

            if (showOpenFolderWarning)
            {
                var    registryUtility      = new RegistryUtility(registryName);
                string showCMakeBetaWarning = registryUtility.ReadCurrentUserKey(keyName);

                if (showCMakeBetaWarning == null && SolutionInfo.IsOpenFolderModeActive())
                {
                    showOpenFolderWarning = false;
                    CMakeBetaWarning cMakeBetaWarning = new CMakeBetaWarning();
                    cMakeBetaWarning.Show();
                }
            }

            if (SettingsProvider.CompilerSettingsModel.ShowSquiggles == false)
            {
                return;
            }

            if (running || vsBuildRunning)
            {
                return;
            }

            Document document = GotFocus.Document;

            if (document == null)
            {
                return;
            }

            if (!string.IsNullOrEmpty(oldActiveDocumentName) && oldActiveDocumentName == document.FullName)
            {
                return;
            }

            oldActiveDocumentName = document.FullName;
            if (!ScriptConstants.kAcceptedFileExtensions.Contains(Path.GetExtension(document.FullName)))
            {
                return;
            }

            _ = Task.Run(() =>
            {
                lock (mutex)
                {
                    try
                    {
                        TaskErrorViewModel.FileErrorsPair.Clear();
                        using BackgroundTidy backgroundTidyCommand = new BackgroundTidy();
                        backgroundTidyCommand.Run(document, CommandIds.kTidyId);
                    }
                    catch (Exception e)
                    {
                        MessageBox.Show(e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            });
        }