public SolvedPluginConfiguration(ConfigManagerImpl cfg)
        {
            _cfg = cfg;
            _dic = new Dictionary <Guid, SolvedPluginConfigElement>();

            //Triggered when a PluginStatus is set
            _cfg.GetUserConfiguration(false).PluginStatusCollection.Changed   += (o, e) => OnPluginConfigurationChanged(e.PluginID);
            _cfg.GetSystemConfiguration(false).PluginStatusCollection.Changed += (o, e) => OnPluginConfigurationChanged(e.PluginID);
            _cfg.GetUserConfiguration(false).LiveUserConfiguration.Changed    += (o, e) => OnPluginConfigurationChanged(e.PluginID);

            ResolveConfiguration();
        }
示例#2
0
        public void WriteReadSystemConfig()
        {
            string path = Path.Combine( TestFolder, "SystemConfig.xml" );

            // Write ----------------------------------------------------------
            {
                ISharedDictionary dic = SharedDictionary.Create( null );
                IConfigManagerExtended config = ConfigurationManager.Create( dic );

                Assert.That( config.ConfigManager.SystemConfiguration != null );

                config.HostSystemConfig["key1"] = "value1";
                config.HostSystemConfig["key2"] = "value2";
                config.HostSystemConfig["key3"] = "value3";
                config.HostSystemConfig["{12A9FCC0-ECDC-4049-8DBF-8961E49A9EDE}"] = true;

                Assert.That( config.IsSystemConfigDirty );
                Assert.That( config.IsUserConfigDirty, Is.False );

                using( Stream wrt = new FileStream( path, FileMode.Create ) )
                using( IStructuredWriter sw = SimpleStructuredWriter.CreateWriter( wrt, null ) )
                {
                    config.SaveSystemConfig( sw );
                }
            }
            TestBase.DumpFileToConsole( path );
            // Read ------------------------------------------------------------
            {
                ISharedDictionary dic = SharedDictionary.Create( null );
                IConfigManagerExtended config = new ConfigManagerImpl( dic );

                using( Stream str = new FileStream( path, FileMode.Open ) )
                using( IStructuredReader sr = SimpleStructuredReader.CreateReader( str, null ) )
                {
                    config.LoadSystemConfig( sr );
                }
                Assert.That( config.HostSystemConfig["key1"], Is.EqualTo( "value1" ) );
                Assert.That( config.HostSystemConfig["key2"], Is.EqualTo( "value2" ) );
                Assert.That( config.HostSystemConfig["key3"], Is.EqualTo( "value3" ) );
                Assert.That( config.HostSystemConfig["{12A9FCC0-ECDC-4049-8DBF-8961E49A9EDE}"], Is.EqualTo( true ) );
            }
        }
示例#3
0
 protected ConfigurationBase( ConfigManagerImpl configManager, string uriHistoryEntryName )
 {
     ConfigManager = configManager;
     PluginStatusCollection = new PluginStatusCollection( this );
     UriHistoryCollection = new UriHistoryCollection( this, uriHistoryEntryName );
 }
示例#4
0
 public UserConfiguration(ConfigManagerImpl configManager)
     : base(configManager, "ContextProfile")
 {
     _live = new LiveUserConfiguration();
 }
 public SystemConfiguration( ConfigManagerImpl configManager )
     : base( configManager, "UserProfile" )
 {
 }
示例#6
0
 public SystemConfiguration(ConfigManagerImpl configManager)
     : base(configManager, "UserProfile")
 {
 }
示例#7
0
 protected ConfigurationBase(ConfigManagerImpl configManager, string uriHistoryEntryName)
 {
     ConfigManager          = configManager;
     PluginStatusCollection = new PluginStatusCollection(this);
     UriHistoryCollection   = new UriHistoryCollection(this, uriHistoryEntryName);
 }