public int OnUserPreferencesChanged2(VIEWPREFERENCES2[] viewPrefs, FRAMEPREFERENCES2[] framePrefs, LANGPREFERENCES2[] langPrefs, FONTCOLORPREFERENCES2[] colorPrefs) {
     if (langPrefs != null && langPrefs.Length > 0 && langPrefs[0].guidLang == this._preferences.guidLang) {
         _preferences.IndentStyle = langPrefs[0].IndentStyle;
         _preferences.fAutoListMembers = langPrefs[0].fAutoListMembers;
         _preferences.fAutoListParams = langPrefs[0].fAutoListParams;
         _preferences.fHideAdvancedAutoListMembers = langPrefs[0].fHideAdvancedAutoListMembers;
     }
     return VSConstants.S_OK;
 }
        int IVsTextManagerEvents4.OnUserPreferencesChanged4(
            VIEWPREFERENCES3[] viewPrefs,
            LANGPREFERENCES3[] langPrefs,
            FONTCOLORPREFERENCES2[] colorPrefs)
        {
            if (langPrefs != null)
            {
                RefreshLanguageSettings(langPrefs);
            }

            return VSConstants.S_OK;
        }
        public int OnUserPreferencesChanged4(VIEWPREFERENCES3[] pViewPrefs, LANGPREFERENCES3[] pLangPrefs, FONTCOLORPREFERENCES2[] pColorPrefs) {
            IVsTextManager4 textMgr = (IVsTextManager4)NodejsPackage.Instance.GetService(typeof(SVsTextManager));

           if (pLangPrefs != null && pLangPrefs.Length > 0 && pLangPrefs[0].guidLang == _preferences.guidLang) {
                _preferences.IndentStyle = pLangPrefs[0].IndentStyle;
                _preferences.fAutoListMembers = pLangPrefs[0].fAutoListMembers;
                _preferences.fAutoListParams = pLangPrefs[0].fAutoListParams;
                _preferences.fHideAdvancedAutoListMembers = pLangPrefs[0].fHideAdvancedAutoListMembers;

                // Synchronize settings back to TS language service
                pLangPrefs[0].guidLang = Guids.TypeScriptLanguageInfo;
                textMgr.SetUserPreferences4(null, pLangPrefs, null);
            }
            return VSConstants.S_OK;
        }
 int IVsTextManagerEvents2.OnUserPreferencesChanged2(VIEWPREFERENCES2[] pViewPrefs, FRAMEPREFERENCES2[] pFramePrefs, LANGPREFERENCES2[] pLangPrefs, FONTCOLORPREFERENCES2[] pColorPrefs)
 {
     Func<LANGPREFERENCES2, bool> predicate = null;
     if (pLangPrefs != null)
     {
         if (predicate == null)
         {
             predicate = i => i.guidLang == this._preferences.guidLang;
         }
         LANGPREFERENCES2[] langpreferencesArray = pLangPrefs.Where<LANGPREFERENCES2>(predicate).ToArray<LANGPREFERENCES2>();
         if (langpreferencesArray.Length > 0)
         {
             this._preferences = langpreferencesArray[0];
         }
     }
     return 0;
 }
Example #5
0
 public int OnUserPreferencesChanged2(VIEWPREFERENCES2[] viewPrefs, FRAMEPREFERENCES2[] framePrefs, LANGPREFERENCES2[] langPrefs, FONTCOLORPREFERENCES2[] colorPrefs) {
     int hr = VSConstants.S_OK;
     if (langPrefs != null && langPrefs.Length > 0 && langPrefs[0].guidLang == this._preferences.guidLang) {
         _preferences.IndentStyle = langPrefs[0].IndentStyle;
         _preferences.fAutoListMembers = langPrefs[0].fAutoListMembers;
         _preferences.fAutoListParams = langPrefs[0].fAutoListParams;
         _preferences.fHideAdvancedAutoListMembers = langPrefs[0].fHideAdvancedAutoListMembers;
         if (_preferences.fDropdownBar != (_preferences.fDropdownBar = langPrefs[0].fDropdownBar)) {
             foreach(var window in _service.CodeWindowManagers) {
                 hr = window.ToggleNavigationBar(_preferences.fDropdownBar != 0);
                 if (ErrorHandler.Failed(hr)) {
                     break;
                 }
             }
         }
     }
     return VSConstants.S_OK;
 }
        public int OnUserPreferencesChanged2(VIEWPREFERENCES2[] pViewPrefs, FRAMEPREFERENCES2[] pFramePrefs, LANGPREFERENCES2[] pLangPrefs, FONTCOLORPREFERENCES2[] pColorPrefs)
        {
            if (pLangPrefs != null && pLangPrefs.Length > 0 && pLangPrefs[0].guidLang == _preferences.guidLang)
            {
                _preferences.IndentStyle = pLangPrefs[0].IndentStyle;

                if (_preferences.fDropdownBar != (_preferences.fDropdownBar = pLangPrefs[0].fDropdownBar))
                {
                    foreach (var window in _package.CodeWindowManagers)
                    {
                        var hr = window.ToggleNavigationBar(_preferences.fDropdownBar != 0);
                        if (ErrorHandler.Failed(hr))
                        {
                            break;
                        }
                    }
                }
            }
            return VSConstants.S_OK;
        }
Example #7
0
 public int OnUserPreferencesChanged2(VIEWPREFERENCES2[] pViewPrefs, FRAMEPREFERENCES2[] pFramePrefs, LANGPREFERENCES2[] pLangPrefs, FONTCOLORPREFERENCES2[] pColorPrefs)
 {
     return VSConstants.S_OK;
 }
Example #8
0
 public int OnUserPreferencesChanged2(VIEWPREFERENCES2[] viewPreferences, FRAMEPREFERENCES2[] pFramePrefs, LANGPREFERENCES2[] languagePreferences, FONTCOLORPREFERENCES2[] pColorPrefs)
 {
     this.UpdatePreferences(viewPreferences, languagePreferences);
     return VSConstants.S_OK;
 }
Example #9
0
 public virtual int OnUserPreferencesChanged2(VIEWPREFERENCES2[] viewPrefs, FRAMEPREFERENCES2[] framePrefs, LANGPREFERENCES2[] langPrefs, FONTCOLORPREFERENCES2[] fontColorPrefs) {
     if (langPrefs != null && langPrefs.Length > 0 && langPrefs[0].guidLang == this.langSvc) {
         this.prefs = langPrefs[0];
     }
     return NativeMethods.S_OK;
 }
        public int OnUserPreferencesChanged4(
            VIEWPREFERENCES3[] viewPrefs,
            LANGPREFERENCES3[] langPrefs,
            FONTCOLORPREFERENCES2[] colorPrefs) {
            if (langPrefs != null && langPrefs[0].guidLang == _languageServiceId) {
                _langPrefs = langPrefs[0];
                FireSettingsChanged();
            }

            return VSConstants.S_OK;
        }
Example #11
0
 public int OnUserPreferencesChanged2(VIEWPREFERENCES2[] pViewPrefs, FRAMEPREFERENCES2[] pFramePrefs, LANGPREFERENCES2[] pLangPrefs, FONTCOLORPREFERENCES2[] pColorPrefs)
 {
     if (pLangPrefs != null) {
         _preferences.IndentStyle = pLangPrefs[0].IndentStyle;
         _preferences.fAutoListMembers = pLangPrefs[0].fAutoListMembers;
         _preferences.fAutoListParams = pLangPrefs[0].fAutoListParams;
         _preferences.fHideAdvancedAutoListMembers = pLangPrefs[0].fHideAdvancedAutoListMembers;
         if (_preferences.fDropdownBar != (_preferences.fDropdownBar = pLangPrefs[0].fDropdownBar)) {
             CodeWindowManager.ToggleNavigationBar(_preferences.fDropdownBar != 0);
         }
     }
     return VSConstants.S_OK;
 }
Example #12
0
 public int SetUserPreferences4(VIEWPREFERENCES3[] pViewPrefs, LANGPREFERENCES3[] pLangPrefs, FONTCOLORPREFERENCES2[] pColorPrefs)
 {
     return VSConstants.S_OK;
 }