protected FilterEntry() { Action = OnChanged; FilterOptionsAttribute a = (FilterOptionsAttribute)Attribute.GetCustomAttribute(GetType(), typeof(FilterOptionsAttribute)); if (a == null) { return; } string resourceName = Strings.ResourceManager.GetString(a.Name); Name = string.IsNullOrEmpty(resourceName) ? a.Name : resourceName; Enabled = a.DefaultEnabled; }
protected FilterEntry() { Action = OnChanged; FilterOptionsAttribute a = (FilterOptionsAttribute)Attribute.GetCustomAttribute(GetType(), typeof(FilterOptionsAttribute)); if (a == null) { return; } string resourceName = Strings.ResourceManager.GetString(a.Name); if (string.IsNullOrEmpty(resourceName)) { throw new InvalidOperationException($"No localized text for filter: {a.Name}"); } Name = string.IsNullOrEmpty(resourceName) ? a.Name : resourceName; Enabled = a.DefaultEnabled; IsConfigurable = typeof(IConfigurableFilter).IsAssignableFrom(GetType()); }