Inheritance: Caliburn.Micro.Screen, IDisposable
Esempio n. 1
0
 public VMApplicationInfo( VMIContextViewModel ctx )
     : base(ctx, null)
 {
     VMIContext.Context.ConfigManager.UserConfiguration.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler( OnUserConfigurationChanged );
     VMIContext.Context.ConfigManager.SystemConfiguration.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler( OnSystemConfigurationChanged );
     _hostInfo = ( (IHostInformation)VMIContext.Context.ServiceContainer.GetService( typeof( IHostInformation ) ) );
 }
Esempio n. 2
0
        public VMIAssembly( VMIContextViewModel ctx, IAssemblyInfo assembly )
            : base(ctx, null)
        {
            _assemblyInfo = assembly;
            Assembly = assembly.AssemblyName;
            if( !assembly.HasError )
                Label = assembly.AssemblyName.Name;
            else
                Label = assembly.AssemblyFileName;
            OnError = assembly.HasError;

            DetailsTemplateName = "AssemblyDetails";

            Plugins = new VMCollection<VMAlias<VMIPlugin>, IPluginInfo>( assembly.Plugins, ( info ) => { return new VMAlias<VMIPlugin>( VMIContext.FindOrCreate( info ), this ); } );
            Services = new VMCollection<VMAlias<VMIService>, IServiceInfo>( assembly.Services, ( info ) => { return new VMAlias<VMIService>( VMIContext.FindOrCreate( info ), this ); } );
        }
Esempio n. 3
0
        public VMIPlugin( VMIContextViewModel ctx, IPluginInfo plugin, VMIBase parent )
            : base(ctx, parent)
        {
            _pluginInfo = plugin;

            Label = plugin.PublicName;
            Assembly = plugin.AssemblyInfo.AssemblyName;
            DetailsTemplateName = "PluginDetails";

            _systemPluginStatus = VMIContext.Context.ConfigManager.SystemConfiguration.PluginsStatus.GetStatus( Id, ConfigPluginStatus.Manual );
            _userPluginStatus = VMIContext.Context.ConfigManager.UserConfiguration.PluginsStatus.GetStatus( Id, ConfigPluginStatus.Manual );

            _pluginRunner = VMIContext.Context.GetService<PluginRunner>( true );
            _pluginRunner.ApplyDone += new EventHandler<ApplyDoneEventArgs>( OnApplyDone );

            VMIContext.Context.ConfigManager.UserConfiguration.LiveUserConfiguration.Changed += new EventHandler<LiveUserConfigurationChangedEventArgs>( OnLiveUserConfigurationChanged );
            VMIContext.Context.ConfigManager.SystemConfiguration.PluginsStatus.Changed += new EventHandler<PluginStatusCollectionChangedEventArgs>( OnSystemPluginStatusChanged );
            VMIContext.Context.ConfigManager.UserConfiguration.PluginsStatus.Changed += new EventHandler<PluginStatusCollectionChangedEventArgs>( OnUserPluginStatusChanged );

            VMIContext.Context.ConfigManager.UserConfiguration.PropertyChanged += new PropertyChangedEventHandler( OnUserConfigurationChanged );
            VMIContext.Context.ConfigManager.SystemConfiguration.PropertyChanged += new PropertyChangedEventHandler( OnSystemConfigurationChanged );

            CreateCommands();

            IList<IPluginInfo> editableBy = new List<IPluginInfo>();
            foreach( IPluginConfigAccessorInfo p in plugin.EditableBy )
                editableBy.Add( p.Plugin );
            _canEdit = new List<IPluginInfo>();
            foreach( IPluginConfigAccessorInfo p in _pluginInfo.EditorsInfo )
                _canEdit.Add( p.EditedSource );
            IList<IPluginInfo> required = new List<IPluginInfo>();

            _vmRequirementLayers = new List<VMIPluginRequirementLayer>();
            foreach( RequirementLayer layer in RequirementLayers )
            {
                _vmRequirementLayers.Add( new VMIPluginRequirementLayer( this, layer ) );
            }

            ServiceRefs = new VMCollection<VMAlias<VMIService>, IServiceReferenceInfo>( plugin.ServiceReferences, ( info ) => { return new VMAlias<VMIService>( VMIContext.FindOrCreate( info ), this ); } );
            CanEdit = new VMCollection<VMAlias<VMIPlugin>, IPluginInfo>( new CKReadOnlyListOnIList<IPluginInfo>( _canEdit ), ( info ) => { return new VMAlias<VMIPlugin>( VMIContext.FindOrCreate( info ), this ); } );
            EditableBy = new VMCollection<VMAlias<VMIPlugin>, IPluginInfo>( new CKReadOnlyListOnIList<IPluginInfo>( editableBy ), ( info ) => { return new VMAlias<VMIPlugin>( VMIContext.FindOrCreate( info ), this ); } );
        }
Esempio n. 4
0
        public VMIService( VMIContextViewModel ctx, IServiceReferenceInfo service, VMIBase parent )
            : base(ctx, parent)
        {
            _serviceRef = service;
            _service = service.Reference;
            Label = service.Reference.ServiceFullName;
            OnError = service.HasError;

            if( service.Reference.IsDynamicService )
                Assembly = service.Reference.AssemblyInfo.AssemblyName;

            _pluginRunner = VMIContext.Context.GetService<PluginRunner>( true );
            _pluginRunner.ApplyDone += new EventHandler<ApplyDoneEventArgs>( OnApplyDone );

            DetailsTemplateName = "ServiceRefDetails";
            _owner = new VMIPlugin( ctx, service.Owner, this );
            _reference = new VMIService( ctx, service.Reference, this );

            _allReferencingPlugins = new Dictionary<VMIPlugin,RunningRequirement>();
            ImplementedBy = new VMCollection<VMAlias<VMIPlugin>, IPluginInfo>( _service.Implementations, ( info ) => { return new VMAlias<VMIPlugin>( VMIContext.FindOrCreate( info ), this ); } );
        }
Esempio n. 5
0
        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 ); } );
        }
Esempio n. 6
0
 public VMOSInfo( VMIContextViewModel ctx )
     : base(ctx, null)
 {
 }
Esempio n. 7
0
 void OnViewClosing( object sender, System.ComponentModel.CancelEventArgs e )
 {
     if( !_isClosing )
     {
         _isClosing = true;
         Context.ConfigManager.UserConfiguration.LiveUserConfiguration.SetAction( new Guid( PluginGuidString ), ConfigUserAction.Stopped );
         Context.PluginRunner.Apply();
         return;
     }
     else
     {
         _isClosing = false;
         VMIContext = null;
     }
 }
Esempio n. 8
0
 public void Stop()
 {
     if( !_isClosing )
     {
         _isClosing = true;
         _view.Close();
     }
     else
     {
         _isClosing = false;
         VMIContext = null;
     }
 }
Esempio n. 9
0
        public void Start()
        {
            VMIContext = new VMIContextViewModel( Context, Config, LogService, HelpService );

            _view = new VMIContextView();
            _view.DataContext = VMIContext;
            _view.Closing += OnViewClosing;
            _view.Show();
        }
Esempio n. 10
0
 public VMIBase( VMIContextViewModel context, VMIBase parent )
 {
     VMIContext = context;
     Parent = parent;
 }
Esempio n. 11
0
 public VMISelectableElement( VMIContextViewModel ctx, VMIBase parent )
     : base(ctx, parent)
 {
 }