Example #1
0
        /// <summary>
        /// Creates a new instance of this LabStateManager, as well as a new IYodiiEngine.
        /// </summary>
        internal LabStateManager()
        {
            YodiiEngine engine = new YodiiEngine(this);

            _engine = engine;

            Debug.Assert(_engine.LiveInfo != null);
            _engine.PropertyChanged += _engine_PropertyChanged;
            _engine.LiveInfo.Plugins.CollectionChanged  += Plugins_CollectionChanged;
            _engine.LiveInfo.Services.CollectionChanged += Services_CollectionChanged;

            Debug.Assert(_engine.IsRunning == false);

            _serviceInfos = new CKObservableSortedArrayKeyList <ServiceInfo, string>(s => s.ServiceFullName, false);
            _pluginInfos  = new CKObservableSortedArrayKeyList <PluginInfo, string>(p => p.PluginFullName, false);

            _labServiceInfos = new CKObservableSortedArrayKeyList <LabServiceInfo, ServiceInfo>(s => s.ServiceInfo, (x, y) => String.CompareOrdinal(x.ServiceFullName, y.ServiceFullName), false);
            _labPluginInfos  = new CKObservableSortedArrayKeyList <LabPluginInfo, PluginInfo>(p => p.PluginInfo, (x, y) => String.CompareOrdinal(x.PluginFullName, y.PluginFullName), false);

            _runningPlugins = new ObservableCollection <IPluginInfo>();

            _serviceInfos.CollectionChanged += _serviceInfos_CollectionChanged;
            _pluginInfos.CollectionChanged  += _pluginInfos_CollectionChanged;

            UpdateEngineInfos();
        }
Example #2
0
 internal LiveInfo(YodiiEngine engine)
 {
     Debug.Assert( engine != null );
     _engine = engine;
     _plugins = new CKObservableSortedArrayKeyList<LivePluginInfo, string>( l => l.PluginInfo.PluginFullName );
     _services = new CKObservableSortedArrayKeyList<LiveServiceInfo, string>( l => l.ServiceInfo.ServiceFullName );
 }
Example #3
0
 internal ConfigurationItemCollection(ConfigurationLayer parent)
 {
     _items = new CKObservableSortedArrayKeyList <ConfigurationItem, string>(e => e.ServiceOrPluginFullName, (x, y) => StringComparer.Ordinal.Compare(x, y));
     _layer = parent;
     _items.PropertyChanged   += RetrievePropertyEvent;
     _items.CollectionChanged += RetrieveCollectionEvent;
 }
Example #4
0
 internal LiveInfo(YodiiEngine engine)
 {
     Debug.Assert(engine != null);
     _engine   = engine;
     _plugins  = new CKObservableSortedArrayKeyList <LivePluginInfo, string>(l => l.PluginInfo.PluginFullName);
     _services = new CKObservableSortedArrayKeyList <LiveServiceInfo, string>(l => l.ServiceInfo.ServiceFullName);
 }
Example #5
0
            internal ConfigurationLayerCollection(ConfigurationManager parent)
            {
                _parent = parent;
                _layers = new CKObservableSortedArrayKeyList <ConfigurationLayer, string>(e => e.LayerName, (x, y) => StringComparer.Ordinal.Compare(x, y), allowDuplicates: true);

                _layers.PropertyChanged   += RetrievePropertyEvent;
                _layers.CollectionChanged += RetrieveCollectionEvent;
            }
Example #6
0
        internal VMZoneSimple( VMContextSimple ctx, IZone zone )
            : base(ctx)
        {
            _zone = zone;
            _keys = new CKObservableSortedArrayKeyList<VMKeySimple, int>( k => k.Index );

            foreach( IKey key in _zone.Keys )
            {
                VMKeySimple k = Context.Obtain( key );
                Keys.Add( k );
            }
        }
        public VMZoneEditable( VMContextEditable ctx, IZone zone )
            : base(ctx)
        {
            _ctx = ctx;
            _zone = zone;
            _keys = new CKObservableSortedArrayKeyList<VMKeyEditable, int>( k => k.Index );

            foreach( IKey key in _zone.Keys )
            {
                VMKeyEditable k = Context.Obtain( key );
                Keys.Add( k );
            }
        }
Example #8
0
        internal VMZoneSimple( VMContextSimpleBase ctx, IZone zone, int index )
            : base(ctx)
        {
            Debug.Assert( Dispatcher.CurrentDispatcher == Context.NoFocusManager.ExternalDispatcher, "This method should only be called by the ExternalThread." );
            _zone = zone;
            _index = index;
            SafeUpdateLoopCount();
            _keys = new CKObservableSortedArrayKeyList<VMKeySimple, int>( k => k.Index );

            foreach( IKey key in _zone.Keys )
            {
                VMKeySimple k = Context.Obtain( key );
                Keys.Add( k );
            }
            Context.Config.ConfigChanged += OnConfigChanged;
        }
            internal ConfigurationLayerCollection( ConfigurationManager parent )
            {
                _parent = parent;
                _layers = new CKObservableSortedArrayKeyList<ConfigurationLayer, string>( e => e.LayerName, ( x, y ) => StringComparer.Ordinal.Compare( x, y ), allowDuplicates: true );

                _layers.PropertyChanged += RetrievePropertyEvent;
                _layers.CollectionChanged += RetrieveCollectionEvent;
            }
Example #10
0
 public VMZoneSimple( VMContextSimpleBase ctx )
     : base(ctx)
 {
     Debug.Assert( Dispatcher.CurrentDispatcher == Context.NoFocusManager.ExternalDispatcher, "This method should only be called by the ExternalThread." );
     _keys = new CKObservableSortedArrayKeyList<VMKeySimple, int>( k => k.Index );
 }
Example #11
0
        /// <summary>
        /// Creates a new instance of this LabStateManager, as well as a new IYodiiEngine.
        /// </summary>
        internal LabStateManager()
        {
            YodiiEngine engine = new YodiiEngine( this );
            _engine = engine;

            Debug.Assert( _engine.LiveInfo != null );
            _engine.PropertyChanged += _engine_PropertyChanged;
            _engine.LiveInfo.Plugins.CollectionChanged += Plugins_CollectionChanged;
            _engine.LiveInfo.Services.CollectionChanged += Services_CollectionChanged;

            Debug.Assert( _engine.IsRunning == false );

            _serviceInfos = new CKObservableSortedArrayKeyList<ServiceInfo, string>( s => s.ServiceFullName, false );
            _pluginInfos = new CKObservableSortedArrayKeyList<PluginInfo, string>( p => p.PluginFullName, false );

            _labServiceInfos = new CKObservableSortedArrayKeyList<LabServiceInfo, ServiceInfo>( s => s.ServiceInfo, ( x, y ) => String.CompareOrdinal( x.ServiceFullName, y.ServiceFullName ), false );
            _labPluginInfos = new CKObservableSortedArrayKeyList<LabPluginInfo, PluginInfo>( p => p.PluginInfo, ( x, y ) => String.CompareOrdinal( x.PluginFullName, y.PluginFullName ), false );

            _runningPlugins = new ObservableCollection<IPluginInfo>();

            _serviceInfos.CollectionChanged += _serviceInfos_CollectionChanged;
            _pluginInfos.CollectionChanged += _pluginInfos_CollectionChanged;

            UpdateEngineInfos();
        }