private void SaveRenderSystemConfiguration( object sender, RenderSystem rs ) { string renderSystemId = rs.GetType().FullName; EngineConfig.ConfigOptionDataTable codt = ( (EngineConfig.ConfigOptionDataTable)config.Tables[ "ConfigOption" ] ); foreach ( ConfigOption opt in rs.ConfigOptions ) { EngineConfig.ConfigOptionRow coRow = codt.FindByNameRenderSystem( opt.Name, renderSystemId ); if ( coRow == null ) { coRow = codt.NewConfigOptionRow(); coRow.RenderSystem = renderSystemId; coRow.Name = opt.Name; codt.AddConfigOptionRow( coRow ); } coRow.Value = opt.Value; } config.AcceptChanges(); config.WriteXml( CONFIG_FILE ); }
private void LoadRenderSystemConfiguration( object sender, RenderSystem rs ) { string renderSystemId = rs.GetType().FullName; EngineConfig.ConfigOptionDataTable codt = ( (EngineConfig.ConfigOptionDataTable)config.Tables[ "ConfigOption" ] ); foreach ( EngineConfig.ConfigOptionRow row in codt ) { if ( row.RenderSystem == renderSystemId ) { if ( rs.ConfigOptions.ContainsKey( row.Name ) ) { rs.ConfigOptions[ row.Name ].Value = row.Value; } } } }