Exemplo n.º 1
0
        public SelectableOptionViewModel(ISyncSelectionOption option, SyncOptionListViewModel parentList, SelectableOptionViewModel parent, string filter)
        {
            string str;

            this.isExpanded = true;
            this.lockObject = new object();
            if (option == null)
            {
                throw new ArgumentNullException("option");
            }
            this.Option       = option;
            this.parentVm     = parent;
            this.parentListVm = parentList;
            this.filterString = filter;
            if (parentList != null)
            {
                this.isAutoSelected     = parentList.IsAutoSelected;
                this.autoSelectionValue = parentList.AutoSelectionValue;
            }
            if (StringUtilities.HasArticlePrefix(option.Label, out str))
            {
                this.sortString = str;
            }
            this.InitViewModel();
        }
Exemplo n.º 2
0
        int IComparer.Compare(object x, object y)
        {
            SelectableOptionViewModel model  = (SelectableOptionViewModel)x;
            SelectableOptionViewModel model2 = (SelectableOptionViewModel)y;

            if ((model != null) && (model2 != null))
            {
                return(stringComparer.Compare(model.SortString, model2.SortString));
            }
            return(0);
        }
Exemplo n.º 3
0
        public static bool DoesMatchFilter(object value)
        {
            SelectableOptionViewModel model = (SelectableOptionViewModel)value;

            if (string.IsNullOrWhiteSpace(model.FilterString))
            {
                return(true);
            }
            bool flag = model.Option.FilterMatchingString.Contains(model.FilterString);

            if (!flag && model.Option.HasChildOptions)
            {
                return(model.childView.Count > 0);
            }
            return(flag);
        }
 public SelectableOptionViewModel(ISyncSelectionOption option, SyncOptionListViewModel parentList, SelectableOptionViewModel parent, string filter)
 {
     string str;
     this.isExpanded = true;
     this.lockObject = new object();
     if (option == null)
     {
         throw new ArgumentNullException("option");
     }
     this.Option = option;
     this.parentVm = parent;
     this.parentListVm = parentList;
     this.filterString = filter;
     if (parentList != null)
     {
         this.isAutoSelected = parentList.IsAutoSelected;
         this.autoSelectionValue = parentList.AutoSelectionValue;
     }
     if (StringUtilities.HasArticlePrefix(option.Label, out str))
     {
         this.sortString = str;
     }
     this.InitViewModel();
 }
Exemplo n.º 5
0
 public SelectableOptionViewModel(ISyncSelectionOption option, SyncOptionListViewModel parentList, SelectableOptionViewModel parent) : this(option, parentList, parent, null)
 {
 }
 public SelectableOptionViewModel(ISyncSelectionOption option, SyncOptionListViewModel parentList, SelectableOptionViewModel parent)
     : this(option, parentList, parent, null)
 {
 }