bool AutoShowGuidanceNavigator() { bool shouldAutoShow = true; using (var vsRegistryKey = RegistryHelper.GetCurrentVsRegistryKey(false)) { using (var regKey = vsRegistryKey.OpenSubKey(ProvidePackageSetting.GetRegistryKey(typeof(RecipeManagerPackage)))) { if (regKey != null) { object value = regKey.GetValue("AutoShowGuidanceNavigator"); if (value != null) { if ((int)value == 1) { shouldAutoShow = true; } else { shouldAutoShow = false; } } } } } return(shouldAutoShow); }
private static void LoadTraceLevelSetting() { var traceSwitch = new TraceSwitch(ThisAssembly.Title, ThisAssembly.Description); // Set the default traceSwitch.Level = TraceLevel.Error; try { using (var vsRegistryKey = RegistryHelper.GetCurrentVsRegistryKey(false)) { using (var settingsKey = vsRegistryKey.OpenSubKey(ProvidePackageSetting.GetRegistryKey(typeof(RecipeManagerPackage)))) { if (settingsKey != null) { var traceLevelValue = settingsKey.GetValue("TraceLevel", "Error") as string; TraceLevel result; if (Enum.TryParse <TraceLevel>(traceLevelValue, out result)) { traceSwitch.Level = result; } } } } } catch { // Set the default traceSwitch.Level = TraceLevel.Error; } RecipeManager.TraceSwitch = traceSwitch; }
private static void LoadSourceLevelsSetting() { if (sourceSwitchLoaded) { return; } sourceSwitchLoaded = true; // Set the default SourceLevels level = SourceLevels.Error; try { using (var vsRegistryKey = RegistryHelper.GetCurrentVsRegistryKey(false)) { using (var settingsKey = vsRegistryKey.OpenSubKey(ProvidePackageSetting.GetRegistryKey(typeof(RecipeManagerPackage)))) { if (settingsKey != null) { var sourceLevelsValue = settingsKey.GetValue("SourceLevels", "Error") as string; SourceLevels result; if (Enum.TryParse <SourceLevels>(sourceLevelsValue, out result)) { level = result; } } } } } catch { // Set the default level = SourceLevels.Error; } TraceUtil.GaxSourceSwitch.Level = level; }