Пример #1
0
 private IEnumerable <T> GetStates(System.Type tp)
 {
     if (_isStatic)
     {
         this.SyncStates();
         return(from s in _states where tp.IsAssignableFrom(s.GetType()) select s);
     }
     else
     {
         return(ParentComponentStateSupplier <T> .GetComponentsOnTarg(tp, _container, _includeStatesOnContainer));
     }
 }
Пример #2
0
 private IEnumerable <TSub> GetStates <TSub>() where TSub : class, T
 {
     if (_isStatic)
     {
         this.SyncStates();
         return(from s in _states where s is TSub select s as TSub);
     }
     else
     {
         return(ParentComponentStateSupplier <T> .GetComponentsOnTarg <TSub>(_container, _includeStatesOnContainer));
     }
 }
Пример #3
0
 private void SyncStates()
 {
     if (_isStatic)
     {
         if (!_clean)
         {
             _states.Clear();
             if (_container != null)
             {
                 ParentComponentStateSupplier <T> .GetComponentsOnTarg(_container, _states, _includeStatesOnContainer);
             }
             _clean = true;
         }
     }
     else
     {
         _states.Clear();
         if (_container != null)
         {
             ParentComponentStateSupplier <T> .GetComponentsOnTarg(_container, _states, _includeStatesOnContainer);
         }
     }
 }