Exemple #1
0
 private OptionManager()
 {
     _root = new OptionNode();
     _unloadedProviders            = new HashSet <IOptionProvider>();
     _providers                    = new ObservableCollection <IOptionProvider>();
     _providers.CollectionChanged += Providers_CollectionChanged;
 }
 public OptionManager()
 {
     _root = new OptionNode();
     _unloadedProviders            = new HashSet <IOptionProvider>();
     _providers                    = new Zongsoft.Collections.Collection <IOptionProvider>();
     _providers.CollectionChanged += Providers_CollectionChanged;
 }
Exemple #3
0
        private void Invoke(OptionNode node, InvokeMethod method)
        {
            if (node == null)
            {
                return;
            }

            if (node.Option != null)
            {
                switch (method)
                {
                case InvokeMethod.Apply:
                    node.Option.Apply();
                    break;

                case InvokeMethod.Reset:
                    node.Option.Reset();
                    break;
                }
            }

            foreach (var child in node.Children)
            {
                this.Invoke(child, method);
            }
        }
Exemple #4
0
 public Option(OptionNode node, IOptionProvider provider, IOptionViewBuilder viewBuilder)
 {
     _node      = node ?? throw new ArgumentNullException(nameof(node));
     _providers = new List <IOptionProvider>()
     {
         provider
     };
     _viewBuilder = viewBuilder;
     _isDirty     = false;
 }
        public OptionLoaderSelector(OptionNode root)
        {
            if (root == null)
            {
                throw new ArgumentNullException("root");
            }

            _root    = root;
            _loaders = new ConcurrentDictionary <Type, IOptionLoader>();
        }
        private void Initialize(OptionNode node, IOptionProvider provider, IOptionView view, IOptionViewBuilder viewBuilder)
        {
            if (node == null)
            {
                throw new ArgumentNullException("node");
            }

            _node        = node;
            _provider    = provider;
            _view        = view;
            _viewBuilder = viewBuilder;
            _isDirty     = false;
        }
 public Option(OptionNode node, IOptionProvider provider, IOptionViewBuilder viewBuilder)
 {
     this.Initialize(node, provider, null, viewBuilder);
 }
 public Option(OptionNode node, IOptionProvider provider, IOptionView view)
 {
     this.Initialize(node, provider, view, null);
 }
 public Option(OptionNode node, IOptionProvider provider)
 {
     this.Initialize(node, provider, null, null);
 }
 public Option(OptionNode node)
 {
     this.Initialize(node, null, null, null);
 }
Exemple #11
0
 public Option(OptionNode node, IOptionProvider provider) : this(node, provider, (IOptionView)null)
 {
 }
Exemple #12
0
 public Option(OptionNode node) : this(node, null, (IOptionView)null)
 {
 }
Exemple #13
0
 public MultiresultDictionary(OptionNode node, IEnumerable items)
 {
     _node  = node;
     _items = items.Cast <IReadOnlyDictionary <string, T> >();
 }