Basic class used to expose core properties. It will be used by the Object Explorer plugin.
Inheritance: CK.WPF.ViewModel.VMBase, IDisposable
示例#1
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 ); } );
        }
示例#2
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 ); } );
        }
示例#3
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 ); } );
        }
示例#4
0
 public VMIBase( VMIContextViewModel context, VMIBase parent )
 {
     VMIContext = context;
     Parent = parent;
 }
 public VMISelectableElement( VMIContextViewModel ctx, VMIBase parent )
     : base(ctx, parent)
 {
 }