Example #1
0
        void dteEvents_OnStartupComplete()
        {
            if (BabePackage.Setting.IsFirstInstall)
            {
                BabePackage.WindowManager.ShowSettingWindow();
                //BabePackage.Current.ShowFolderWindow(null, null);
                //BabePackage.Current.ShowOutlineWindow(null, null);
                //var props = DTE.Properties["TextEditor", "Lua"];
                //props.Item("IndentStyle").Value = EnvDTE.vsIndentStyle.vsIndentStyleDefault;
            }
            else if (!string.IsNullOrWhiteSpace(BabePackage.Setting.CurrentSetting))
            {
                IntellisenseHelper.Scan();
            }

            if (BabePackage.Setting.HideUselessViews)
            {
                HiddenVSWindows();
            }

            //打开上次关闭时打开的文件

            //启动完成。开始初始化。

            //如果是此版本第一次运行,更改缩进设置项为“块”
            if (Properties.Settings.Default.IsFirstRun)
            {
                IVsTextManager textMgr   = (IVsTextManager)BabePackage.Current.GetService(typeof(SVsTextManager));
                var            langPrefs = new LANGPREFERENCES[1];
                langPrefs[0].guidLang = typeof(LuaLanguageInfo).GUID;
                ErrorHandler.ThrowOnFailure(textMgr.GetUserPreferences(null, null, langPrefs, null));
                langPrefs[0].IndentStyle = Microsoft.VisualStudio.TextManager.Interop.vsIndentStyle.vsIndentStyleDefault;
                textMgr.SetUserPreferences(null, null, langPrefs, null);
                Properties.Settings.Default.IsFirstRun = false;
                Properties.Settings.Default.Save();
            }

            //注册编辑器内容变化通知
            TextViewCreationListener.FileContentChanged += TextViewCreationListener_FileContentChanged;
            Logger.UploadLog();
            Updater.CheckVersion();
        }