Exemple #1
0
        private void setFilterManagerState(FilterGroup filterGroup, FilterValueState value)
        {
            var states = FilterManager.States;

            if (states[filterGroup.Index()] == value)
            {
                return;
            }

            states[filterGroup.Index()] = value;

            beginRestoreSettings();
            FilterManager.States = states;
            endRestoreSettings();
        }
Exemple #2
0
        private static string getFilterStatusText(
            FilterValueState[] filterManagerStates,
            FilterGroup filterGroup,
            bool hasInput,
            string noInputText)
        {
            if (!hasInput)
            {
                return(noInputText);
            }

            switch (filterManagerStates[filterGroup.Index()])
            {
            case FilterValueState.RequiredSome:
                return("or");

            case FilterValueState.Required:
                return("and");

            case FilterValueState.Prohibited:
                return("not");

            case FilterValueState.Ignored:
                return("any");

            default:
                throw new NotSupportedException();
            }
        }
Exemple #3
0
        private bool isFilterGroupEnabled(FilterGroup filterGroup)
        {
            var state = FilterManager.States[filterGroup.Index()];

            switch (state)
            {
            case FilterValueState.Required:
            case FilterValueState.RequiredSome:
            case FilterValueState.Prohibited:
                return(true);

            case FilterValueState.Ignored:
                return(false);

            default:
                throw new NotSupportedException();
            }
        }
Exemple #4
0
        private static string getFilterStatusText(
            FilterValueState[] filterManagerStates,
            FilterGroup filterGroup,
            bool hasInput,
            string noInputText)
        {
            if (!hasInput)
            {
                return(noInputText);
            }

            switch (filterManagerStates[filterGroup.Index()])
            {
            case FilterValueState.RequiredSome:
                return("OR mode");

            case FilterValueState.Required:
                return("AND mode");

            default:
                return("ignored");
            }
        }