public VMIService( VMIContextViewModel ctx, IServiceInfo service, VMIBase parent )
: base(ctx, parent)
{
_service = service;
Label = service.ServiceFullName;
if( !service.HasError && service.Implementations.Count == 0 )
ErrorMessage = "No implementation";
else
ErrorMessage = _service.ErrorMessage;
OnError = ErrorMessage != null;
if( service.IsDynamicService )
Assembly = service.AssemblyInfo.AssemblyName;
DetailsTemplateName = "ServiceDetails";
_pluginRunner = VMIContext.Context.GetService<PluginRunner>( true );
_pluginRunner.ApplyDone += new EventHandler<ApplyDoneEventArgs>( OnApplyDone );
_allReferencingPlugins = new Dictionary<VMIPlugin, RunningRequirement>();
ImplementedBy = new VMCollection<VMAlias<VMIPlugin>, IPluginInfo>( _service.Implementations, ( info ) => { return new VMAlias<VMIPlugin>( VMIContext.FindOrCreate( info ), null ); } );
}