void cboConditionType_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            GroupFilterConditionType conditionType = GroupFilterHelper.GetEnumForText_ConditionType(cboConditionType.SelectedItem.ToString());

            cboConditionOperator.Items.Clear();
            foreach (string op in GroupFilterHelper.GetAllowedOperators(conditionType))
            {
                cboConditionOperator.Items.Add(op);
            }

            cboConditionOperator.SelectedIndex = 0;

            EvaluateConditionsAndOperators();
        }
        public void Init(GroupFilterVM gf, GroupFilterConditionVM gfc)
        {
            groupFilter          = gf;
            groupFilterCondition = gfc;


            try
            {
                cboConditionType.Items.Clear();
                foreach (string cond in GroupFilterHelper.GetAllConditionTypes())
                {
                    cboConditionType.Items.Add(cond);
                }

                PopulateAnimeGroups();
                PopulateTags();
                PopulateCustomTags();
                PopulateVideoQuality();
                PopulateAnimeTypes();
                PopulateLanguages();

                // find the right condition
                int idx = 0;
                for (int i = 0; i < cboConditionType.Items.Count; i++)
                {
                    GroupFilterConditionType conditionTypeTemp = GroupFilterHelper.GetEnumForText_ConditionType(cboConditionType.Items[i].ToString());
                    if (conditionTypeTemp == gfc.ConditionTypeEnum)
                    {
                        idx = i;
                        break;
                    }
                }
                cboConditionType.SelectedIndex = idx;
                GroupFilterConditionType conditionType = GroupFilterHelper.GetEnumForText_ConditionType(cboConditionType.SelectedItem.ToString());

                cboConditionOperator.Items.Clear();
                foreach (string op in GroupFilterHelper.GetAllowedOperators(conditionType))
                {
                    cboConditionOperator.Items.Add(op);
                }

                cboConditionType.SelectionChanged     += new SelectionChangedEventHandler(cboConditionType_SelectionChanged);
                cboConditionOperator.SelectionChanged += new SelectionChangedEventHandler(cboConditionOperator_SelectionChanged);

                // find the right operator
                idx = 0;
                for (int i = 0; i < cboConditionOperator.Items.Count; i++)
                {
                    GroupFilterOperator opTypeTemp = GroupFilterHelper.GetEnumForText_Operator(cboConditionOperator.Items[i].ToString());
                    if (opTypeTemp == gfc.ConditionOperatorEnum)
                    {
                        idx = i;
                        break;
                    }
                }
                cboConditionOperator.SelectedIndex = idx;
                GroupFilterOperator opType = GroupFilterHelper.GetEnumForText_Operator(cboConditionOperator.Items[idx].ToString());

                // display the selected filter value
                switch (conditionType)
                {
                case GroupFilterConditionType.AirDate:
                case GroupFilterConditionType.SeriesCreatedDate:
                case GroupFilterConditionType.EpisodeAddedDate:
                case GroupFilterConditionType.EpisodeWatchedDate:
                case GroupFilterConditionType.LatestEpisodeAirDate:

                    if (opType == GroupFilterOperator.LastXDays)
                    {
                        txtParameter.Text = gfc.ConditionParameter;
                    }
                    else
                    {
                        DateTime airDate = GroupFilterHelper.GetDateFromString(gfc.ConditionParameter);
                        dpDate.SelectedDate = airDate;
                    }
                    break;

                case GroupFilterConditionType.AnimeGroup:

                    // don't display anything
                    break;

                case GroupFilterConditionType.AnimeType:
                case GroupFilterConditionType.Tag:
                case GroupFilterConditionType.CustomTags:
                case GroupFilterConditionType.ReleaseGroup:
                case GroupFilterConditionType.Studio:
                case GroupFilterConditionType.VideoQuality:
                case GroupFilterConditionType.AniDBRating:
                case GroupFilterConditionType.UserRating:
                case GroupFilterConditionType.AudioLanguage:
                case GroupFilterConditionType.SubtitleLanguage:
                case GroupFilterConditionType.Year:
                    txtParameter.Text = gfc.ConditionParameter;
                    break;
                }
            }
            catch (Exception ex)
            {
                Utils.ShowErrorMessage(ex);
            }
        }