// copy filter tracks to internal list used for display in grid
        private List<ExFilterTrack> ConvertFilterTracksToInternalVar(IList<FilterTrackSelectStatement> tracks)
        {
            List<ExFilterTrack> targettracks = new List<ExFilterTrack>();
            foreach (var track in tracks)
            {
                var mytrack = new ExFilterTrack();
                var myconditions = new List<ExCondition>();
                foreach (var condition in track.PropertyConditions)
                {
                    var mycondition = new ExCondition();
                    mycondition.oper = condition.Operator.ToString();

                    if (condition.GetType() == typeof(FilterTrackTypeCondition)) // property type
                    {
                        FilterTrackTypeCondition conditionc = condition as FilterTrackTypeCondition;
                        mycondition.property = FilterProperty.Type;
                        mycondition.value = conditionc.Value.ToString();
                    }
                    else if (condition.GetType() == typeof(FilterTrackFourCCCondition)) // property FourCC
                    {
                        FilterTrackFourCCCondition conditionc = condition as FilterTrackFourCCCondition;
                        mycondition.property = FilterProperty.FourCC;
                        mycondition.value = conditionc.Value;

                    }
                    else if (condition.GetType() == typeof(FilterTrackLanguageCondition)) // property Type - we want to propose supported FourCC
                    {
                        FilterTrackLanguageCondition conditionc = condition as FilterTrackLanguageCondition;
                        mycondition.property = FilterProperty.Language;
                        mycondition.value = conditionc.Value;
                    }
                    else if (condition.GetType() == typeof(FilterTrackBitrateRangeCondition)) // property Bitrange - we want to propose supported FourCC
                    {
                        FilterTrackBitrateRangeCondition conditionc = condition as FilterTrackBitrateRangeCondition;
                        mycondition.property = FilterProperty.Bitrate;
                        mycondition.value = ReturnFilterTrackBitrateRangeAsString(conditionc.Value);
                    }
                    else if (condition.GetType() == typeof(FilterTrackNameCondition)) // property Name - we want to propose supported FourCC
                    {
                        FilterTrackNameCondition conditionc = condition as FilterTrackNameCondition;
                        mycondition.property = FilterProperty.Name;
                        mycondition.value = conditionc.Value;
                    }

                    myconditions.Add(mycondition);
                }
                mytrack.conditions = myconditions;
                targettracks.Add(mytrack);
            }
            return targettracks;
        }
 private void buttonAddTrack_Click(object sender, EventArgs e)
 {
     ExFilterTrack track = new ExFilterTrack() { conditions = new List<ExCondition>() };
     filtertracks.Add(track);
     RefreshTracks();
 }