Esempio n. 1
0
        public SearchOptionsProxy(SearchMetadata searchMetadata, IEnumerable <Swatch> swatches, Action <SearchMetadata> removeAction)
        {
            Swatches = swatches;
            if (searchMetadata == null)
            {
                throw new ArgumentNullException(nameof(searchMetadata));
            }
            if (swatches == null)
            {
                throw new ArgumentNullException(nameof(swatches));
            }
            if (removeAction == null)
            {
                throw new ArgumentNullException(nameof(removeAction));
            }

            _searchMetadata = searchMetadata;
            Highlight       = _searchMetadata.Highlight;
            Filter          = _searchMetadata.Filter;
            UseRegex        = searchMetadata.UseRegex;
            IgnoreCase      = searchMetadata.IgnoreCase;

            Status = searchMetadata.UseRegex ? SearchResultIndicatorStatus.Regex : SearchResultIndicatorStatus.Text;

            RemoveCommand = new Command(() => removeAction(searchMetadata));
        }
Esempio n. 2
0
        public SearchOptionsProxy(SearchMetadata searchMetadata, IEnumerable<Swatch> swatches, Action<SearchMetadata> removeAction)
        {
            Swatches = swatches;
            if (searchMetadata == null) throw new ArgumentNullException(nameof(searchMetadata));
            if (swatches == null) throw new ArgumentNullException(nameof(swatches));
            if (removeAction == null) throw new ArgumentNullException(nameof(removeAction));

            _searchMetadata = searchMetadata;
            Highlight = _searchMetadata.Highlight;
            Filter = _searchMetadata.Filter;
            UseRegex = searchMetadata.UseRegex;
            IgnoreCase = searchMetadata.IgnoreCase;

            Status = searchMetadata.UseRegex ? SearchResultIndicatorStatus.Regex : SearchResultIndicatorStatus.Text;

            RemoveCommand = new Command(() => removeAction(searchMetadata));
        }