コード例 #1
0
        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;
        }
コード例 #2
0
        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());
        }