public void Initialize(string webURL, ContentType contentType, SearchFilter filter, bool isOr)
        {
            this.WebURL      = webURL;
            this.ContentType = contentType;
            this.IsOr        = isOr;
            this.FillFilterTypeComboBox();
            this.FillPropertyComboBox();

            string          fieldName  = filter.FieldName;
            CamlFilterTypes filterType = filter.FilterType;
            FieldTypes      fieldType  = filter.FieldType;

            this.SearchFilter = new SearchFilter(fieldName, fieldType, filterType, filter.FilterValue);

            PropertyComboBox.SelectedValue   = this.SearchFilter.FieldName;
            FilterTypeComboBox.SelectedValue = this.SearchFilter.FieldType;
            if (this.IsOr == true)
            {
                AndOrComboBox.SelectedIndex = 1;
            }
            else
            {
                AndOrComboBox.SelectedIndex = 0;
            }

            PropertyLabel.Content    = this.SearchFilter.FieldName;
            FilterTypeLabel.Content  = this.SearchFilter.FilterType.ToString();
            FilterValueLabel.Content = this.SearchFilter.FilterValue;
            AndOrLabel.Content       = Languages.Translate(this.IsOr == true ? "Or" : "And");
        }
Пример #2
0
 public CamlFilter(string fieldName, FieldTypes fieldType, CamlFilterTypes filterType, string filterValue)
 {
     FieldName   = fieldName;
     FieldType   = fieldType;
     FilterType  = filterType;
     FilterValue = filterValue;
 }
        private void FilterTypeComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            CamlFilterTypes filterType = (CamlFilterTypes)FilterTypeComboBox.SelectedValue;

            this.SearchFilter.FilterType = filterType;
            editItemControl.TakeFocus();
        }
Пример #4
0
        private string GetCamlFilterTypeString(CamlFilterTypes filterType)
        {
            string camlString = String.Empty;

            switch (filterType)
            {
            case CamlFilterTypes.BeginsWith:
                camlString = "BeginsWith";
                break;

            case CamlFilterTypes.Contains:
                camlString = "Contains";
                break;

            case CamlFilterTypes.Equals:
                camlString = "Eq";
                break;

            case CamlFilterTypes.EqualsGreater:
                camlString = "Geq";
                break;

            case CamlFilterTypes.EqualsLesser:
                camlString = "Leq";
                break;

            case CamlFilterTypes.Greater:
                camlString = "Gt";
                break;

            case CamlFilterTypes.NotEqual:
                camlString = "Neq";
                break;
            }
            return(camlString);
        }