Esempio n. 1
0
        /// <summary>
        /// Adds a discrete value to a filter.
        /// </summary>
        /// <param name="value">discrete value</param>
        /// <param name="filter_name">name of the filter</param>
        /// <param name="comparison">conditional operator</param>
        /// <param name="active">filter's state</param>
        private void AddDiscreteValue(string value, string filter_name, string comparison, bool active)
        {
            if (!_currentSession.IsOpenedOrCreated)
            {
                return;
            }

            //get a reference to a graph using its name
            Graph graph = _currentRun.Graphs[_lastGraph];

            //get a reference to a filter using its name
            FilterItem fi = graph.Filter[filter_name];

            //set conditional operator
            if (comparison == "=")
            {
                fi.ConditionalOperator = FilterItem.FilterItemConditionalOperator.Equal;
            }
            else
            {
                fi.ConditionalOperator = FilterItem.FilterItemConditionalOperator.NotEqual;
            }

            //set isActive property
            fi.IsActive = active;

            //add current value to filter
            fi.AddDiscreteValue(value);
        }