Exemple #1
0
        private int CountTreeItemsFullySelected(ISyncOptionList list)
        {
            List <ISyncSelectionOption> list2 = new List <ISyncSelectionOption>(list.Options);

            foreach (ISyncSelectionOption option in list2)
            {
                if (option.IsSelectedForSync.HasValue)
                {
                    if (option.IsSelectedForSync.Value)
                    {
                        int num;
                        if (!option.HasChildOptions)
                        {
                            return(1);
                        }
                        if (this.CountTreeItemsSelected(option.ChildOptions, out num) == num)
                        {
                            return(1);
                        }
                        return(this.CountTreeItemsFullySelected(option.ChildOptions));
                    }
                    if (option.HasChildOptions)
                    {
                        return(this.CountTreeItemsFullySelected(option.ChildOptions));
                    }
                    return(0);
                }
                if (option.HasChildOptions)
                {
                    return(this.CountTreeItemsFullySelected(option.ChildOptions));
                }
            }
            return(0);
        }
Exemple #2
0
        private int CountTreeItemsSelected(ISyncOptionList list, out int totalCount)
        {
            int num = 0;

            totalCount = list.Count <KeyValuePair <string, ISyncSelectionOption> >();
            List <ISyncSelectionOption> list2 = new List <ISyncSelectionOption>(list.Options);

            foreach (ISyncSelectionOption option in list2)
            {
                if (option.IsSelectedForSync.HasValue && option.IsSelectedForSync.Value)
                {
                    num++;
                }
                if (option.HasChildOptions)
                {
                    int num2;
                    num        += this.CountTreeItemsSelected(option.ChildOptions, out num2);
                    totalCount += num2;
                }
            }
            return(num);
        }
        public SyncOptionListViewModel(ISyncOptionList list, SelectableOptionViewModel parent, string filter)
        {
            Action <ISyncSelectionOption> action = null;

            this.lockObject   = new object();
            this.parent       = parent;
            this.FilterString = filter;
            if (list == null)
            {
                throw new ArgumentNullException(typeof(ISyncOptionList).ToString());
            }
            this.model = list;
            if (action == null)
            {
                action = delegate(ISyncSelectionOption o) {
                    this.Add(new SelectableOptionViewModel(o, this, parent, filter));
                };
            }
            list.Options.ToList <ISyncSelectionOption>().ForEach(action);
            this.buffer = new BatchingTimer(new Action <List <object> >(this.ProcessChanges), 0x3e8);
            this.model.CollectionChanged += new NotifyCollectionChangedEventHandler(this.OnModelCollectionChanged);
        }
 public DesignSyncSelectionOption(string label)
 {
     this.Label = label;
     this.childOptionList = new DesignSyncOptionList();
 }
Exemple #5
0
 private int CountTreeItemsSelected(ISyncOptionList list, out int totalCount)
 {
     int num = 0;
     totalCount = list.Count<KeyValuePair<string, ISyncSelectionOption>>();
     List<ISyncSelectionOption> list2 = new List<ISyncSelectionOption>(list.Options);
     foreach (ISyncSelectionOption option in list2)
     {
         if (option.IsSelectedForSync.HasValue && option.IsSelectedForSync.Value)
         {
             num++;
         }
         if (option.HasChildOptions)
         {
             int num2;
             num += this.CountTreeItemsSelected(option.ChildOptions, out num2);
             totalCount += num2;
         }
     }
     return num;
 }
Exemple #6
0
 private int CountTreeItemsFullySelected(ISyncOptionList list)
 {
     List<ISyncSelectionOption> list2 = new List<ISyncSelectionOption>(list.Options);
     foreach (ISyncSelectionOption option in list2)
     {
         if (option.IsSelectedForSync.HasValue)
         {
             if (option.IsSelectedForSync.Value)
             {
                 int num;
                 if (!option.HasChildOptions)
                 {
                     return 1;
                 }
                 if (this.CountTreeItemsSelected(option.ChildOptions, out num) == num)
                 {
                     return 1;
                 }
                 return this.CountTreeItemsFullySelected(option.ChildOptions);
             }
             if (option.HasChildOptions)
             {
                 return this.CountTreeItemsFullySelected(option.ChildOptions);
             }
             return 0;
         }
         if (option.HasChildOptions)
         {
             return this.CountTreeItemsFullySelected(option.ChildOptions);
         }
     }
     return 0;
 }
 public DesignSyncSelectionOption(string label)
 {
     this.Label           = label;
     this.childOptionList = new DesignSyncOptionList();
 }
 private static SyncOptionListViewModel GetViewModel(ISyncOptionList model, string filterString)
 {
     return(new SyncOptionListViewModel(model, filterString));
 }
 public SyncOptionListViewModel(ISyncOptionList list, string filter) : this(list, null, filter)
 {
 }
 public SyncOptionListViewModel(ISyncOptionList list, SelectableOptionViewModel parent) : this(list, parent, null)
 {
 }
 private static SyncOptionListViewModel GetViewModel(ISyncOptionList model, string filterString)
 {
     return new SyncOptionListViewModel(model, filterString);
 }