Exemplo n.º 1
0
        protected override void ApplyFilter()
        {
            if (IsUpdatingDisplayText)
            {
                return;
            }

            Func <Tag, bool> statusFilter;

            switch (TagFilterMode)
            {
            case TagFilterMode.Verified:
                statusFilter = t => t.IsVerified && t.ManuallyVerified;
                break;

            case TagFilterMode.AutoVerified:
                statusFilter = t => t.IsVerified && !t.ManuallyVerified;
                break;

            case TagFilterMode.Unverified:
                statusFilter = t => !t.IsVerified || !t.ManuallyVerified;
                break;

            case TagFilterMode.All:
            default:
                statusFilter = t => true;
                break;
            }
            FilteredTags = AllValues.Where(statusFilter).OrderBy(t => t.Name).ToList();

            SearchedValues = FilteredTags.Where(Filter).ToList();
        }
Exemplo n.º 2
0
 protected virtual void ApplyFilter()
 {
     if (!IsUpdatingDisplayText)
     {
         SearchedValues = AllValues.Where(Filter).ToList();
     }
 }
Exemplo n.º 3
0
        public EntryNameContract GetEntryName(ContentLanguagePreference languagePreference)
        {
            var display    = SortNames[languagePreference];
            var additional = string.Join(", ", AllValues.Where(n => n != display));

            return(new EntryNameContract(display, additional));
        }
Exemplo n.º 4
0
        private double GetIrregularity()
        {
            var avgValue   = AllValues.Where(v => !double.IsNaN(v)).Average();
            var sumOfDiffs = AllValues.Where(v => !double.IsNaN(v)).Sum(v => Math.Abs(avgValue - v));
            var sum        = AllValues.Where(v => !double.IsNaN(v)).Sum();

            return(100.0 * sumOfDiffs / sum);
        }
Exemplo n.º 5
0
        public override void PopulateFromKVP(List <KVP> kvps)
        {
            BasePopulateFromKVP(kvps);
            var valueStrings = ((string)kvps.First(kvp => kvp.Key == "values").Value).Split(new string[] { "||" }, StringSplitOptions.RemoveEmptyEntries);

            Values = AllValues.Where(val => valueStrings.Contains(val.Name)).ToList();
            //var lookup = FixedValue as PickList;
            //FixedValue = AllValues.FirstOrDefault(val => lookup.Name == val.Name);
            //    Values = ((string)kvps.First(kvp => kvp.Key == "values").Value).Split(new string[] { "||" }, StringSplitOptions.RemoveEmptyEntries);
            SelectionStyle = kvps.First(kvp => kvp.Key == "selectionstyle").Value.ToString();
        }
Exemplo n.º 6
0
 private void FilterValues()
 {
     if (AllValues != null)
     {
         FilteredValues = new ObservableCollection <ValueItemModel>(
             AllValues.Where(x =>
                             string.IsNullOrEmpty(SearchText) || x.Name.IndexOf(SearchText, StringComparison.CurrentCultureIgnoreCase) != -1)
             );
     }
     else
     {
         FilteredValues = null;
     }
 }
Exemplo n.º 7
0
        public override void PopulateFromKVP(List <KVP> kvps)
        {
            BasePopulateFromKVP(kvps);
            SelectionStyle = kvps.First(kvp => kvp.Key == "selectionstyle").Value.ToString();
            string values = (string)kvps.FirstOrDefault(kvp => kvp.Key == "values")?.Value;

            if (values == null)
            {
                return;
            }
            var valueStrings = values.Split(new string[] { "||" }, StringSplitOptions.RemoveEmptyEntries);

            Values = AllValues.Where(val => valueStrings.Contains(val.Name)).ToList();
            // Values = ((string)kvps.First(kvp => kvp.Key == "values").Value).Split(new string[] { "||" }, StringSplitOptions.RemoveEmptyEntries).Select(s => new looku;
        }
Exemplo n.º 8
0
 public static T FromId(TId id)
 {
     return(AllValues.Where(value => value.Id.Equals(id)).FirstOrDefault());
 }