bool ComputeStartableFor( IServiceDependentObject o, StartDependencyImpact impact )
 {
     foreach( var s in o.GetIncludedServices( impact, false ) )
     {
         if( s.Disabled ) return false;
     }
     foreach( var s in o.GetExcludedServices( impact ) )
     {
         if( s.FinalConfigSolvedStatus == SolvedConfigurationStatus.Running ) return false;
     }
     return true;
 }
        public FinalConfigStartableStatus( IServiceDependentObject o )
        {
            Debug.Assert( o.FinalConfigSolvedStatus != SolvedConfigurationStatus.Disabled );
            Debug.Assert( ComputeStartableFor( o, StartDependencyImpact.Minimal ) );

            StartDependencyImpact config = o.ConfigSolvedImpact;
            Debug.Assert( ComputeStartableFor( o, config ) );
            Debug.Assert( ComputeStartableFor( o, StartDependencyImpact.Minimal ) );

            CanStartWithFullStop = config != StartDependencyImpact.FullStop ? ComputeStartableFor( o, StartDependencyImpact.FullStop ) : true;
            CallableWithStopOptionalAndRunnable = config != StartDependencyImpact.StopOptionalAndRunnable ? ComputeStartableFor( o, StartDependencyImpact.StopOptionalAndRunnable ) : true;
            CallableWithStartRecommended = config != StartDependencyImpact.StartRecommended ? ComputeStartableFor( o, StartDependencyImpact.StartRecommended ) : true;
            CallableWithFullStart = config != StartDependencyImpact.FullStart ? ComputeStartableFor( o, StartDependencyImpact.FullStart ) : true;
        }
Ejemplo n.º 3
0
        public FinalConfigStartableStatus(IServiceDependentObject o)
        {
            Debug.Assert(o.FinalConfigSolvedStatus != SolvedConfigurationStatus.Disabled);
            Debug.Assert(ComputeStartableFor(o, StartDependencyImpact.Minimal));

            StartDependencyImpact config = o.ConfigSolvedImpact;

            Debug.Assert(ComputeStartableFor(o, config));
            Debug.Assert(ComputeStartableFor(o, StartDependencyImpact.Minimal));

            CanStartWithFullStop = config != StartDependencyImpact.FullStop ? ComputeStartableFor(o, StartDependencyImpact.FullStop) : true;
            CallableWithStopOptionalAndRunnable = config != StartDependencyImpact.StopOptionalAndRunnable ? ComputeStartableFor(o, StartDependencyImpact.StopOptionalAndRunnable) : true;
            CallableWithStartRecommended        = config != StartDependencyImpact.StartRecommended ? ComputeStartableFor(o, StartDependencyImpact.StartRecommended) : true;
            CallableWithFullStart = config != StartDependencyImpact.FullStart ? ComputeStartableFor(o, StartDependencyImpact.FullStart) : true;
        }
Ejemplo n.º 4
0
 bool ComputeStartableFor(IServiceDependentObject o, StartDependencyImpact impact)
 {
     foreach (var s in o.GetIncludedServices(impact, false))
     {
         if (s.Disabled)
         {
             return(false);
         }
     }
     foreach (var s in o.GetExcludedServices(impact))
     {
         if (s.FinalConfigSolvedStatus == SolvedConfigurationStatus.Running)
         {
             return(false);
         }
     }
     return(true);
 }