public void GetExceptionCategorySettings(Guid categoryId, out HostConfigurationSection categoryConfigSection, out string categoryName)
        {
            var category = _config.ExceptionSettings.Categories.FirstOrDefault((x) => x.Id == categoryId);

            if (category == null)
            {
                throw new InvalidDataException(string.Format(CultureInfo.CurrentUICulture, HostResources.Error_ExceptionCategoryMissing, categoryId));
            }

            categoryName          = category.Name;
            categoryConfigSection = new HostConfigurationSection(category.DefaultTriggers);
        }
        public void GetExceptionCategorySettings(Guid categoryId, out HostConfigurationSection categoryConfigSection, out string categoryName)
        {
            string      subKeyName  = @"AD7Metrics\Exception\" + categoryId.ToString("B", CultureInfo.InvariantCulture);
            RegistryKey categoryKey = _configKey.OpenSubKey(subKeyName);

            if (categoryKey == null)
            {
                throw new HostConfigurationException("$RegRoot$\\" + subKeyName);
            }

            categoryConfigSection = new HostConfigurationSection(categoryKey);
            categoryName          = categoryKey.GetSubKeyNames().Single();
        }
Exemple #3
0
            public ExceptionCategorySettings(ExceptionManager parent, HostConfigurationSection categoryKey, string categoryName)
            {
                _parent = parent;
                this.CategoryName = categoryName;
                this.DefaultCategoryState = RegistryToExceptionBreakpointState(categoryKey.GetValue("*"));
                Dictionary<string, ExceptionBreakpointState> exceptionSettings = new Dictionary<string, ExceptionBreakpointState>();
                foreach (string valueName in categoryKey.GetValueNames())
                {
                    if (string.IsNullOrEmpty(valueName) || valueName == "*" || !ExceptionManager.IsSupportedException(valueName))
                        continue;

                    ExceptionBreakpointState value = RegistryToExceptionBreakpointState(categoryKey.GetValue(valueName));
                    if (value == this.DefaultCategoryState)
                    {
                        Debug.Fail("Redundant exception trigger found in the registry.");
                        continue;
                    }

                    exceptionSettings.Add(valueName, value);
                }
                this.DefaultRules = new ReadOnlyDictionary<string, ExceptionBreakpointState>(exceptionSettings);
                _settingsUpdate = new SettingsUpdates(this.DefaultCategoryState, this.DefaultRules);
            }
Exemple #4
0
 /// <summary>
 /// Obtains exception settings for the specified exception category.
 /// </summary>
 /// <param name="categoryId">The GUID used to identify the exception category</param>
 /// <param name="categoryConfigSection">The configuration section where exception values can be obtained.</param>
 /// <param name="categoryName">The name of the exception category.</param>
 public void GetExceptionCategorySettings(Guid categoryId, out HostConfigurationSection categoryConfigSection, out string categoryName)
 {
     throw new NotImplementedException();
 }