Exemplo n.º 1
0
 public OptionManager()
 {
     _root = new OptionNode();
     _unloadedProviders            = new HashSet <IOptionProvider>();
     _providers                    = new JF.Collections.Collection <IOptionProvider>();
     _providers.CollectionChanged += Providers_CollectionChanged;
 }
Exemplo n.º 2
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);
            }
        }
Exemplo n.º 3
0
        public OptionLoaderSelector(OptionNode root)
        {
            if (root == null)
            {
                throw new ArgumentNullException("root");
            }

            _root    = root;
            _loaders = new ConcurrentDictionary <Type, IOptionLoader>();
        }
Exemplo n.º 4
0
        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;
        }
Exemplo n.º 5
0
 public Option(OptionNode node, IOptionProvider provider, IOptionViewBuilder viewBuilder)
 {
     this.Initialize(node, provider, null, viewBuilder);
 }
Exemplo n.º 6
0
 public Option(OptionNode node, IOptionProvider provider, IOptionView view)
 {
     this.Initialize(node, provider, view, null);
 }
Exemplo n.º 7
0
 public Option(OptionNode node, IOptionProvider provider)
 {
     this.Initialize(node, provider, null, null);
 }
Exemplo n.º 8
0
 public Option(OptionNode node)
 {
     this.Initialize(node, null, null, null);
 }