public void CanLoadSimpleProperties() { string xml = @"<Properties> <AddXmlDeclaration vt='11'>0</AddXmlDeclaration> <PreserveBom vt='11'>1</PreserveBom> </Properties>"; InstConfigPropertyBag bag = new InstConfigPropertyBag(Load(xml)); Assert.AreEqual(false, bag.Read("AddXmlDeclaration")); Assert.AreEqual(true, bag.Read("PreserveBom")); }
/// <summary> /// Applies the loaded configuration to a component /// </summary> /// <param name="stageId">The stage the component is in</param> /// <param name="name">The component name</param> /// <param name="index">The index of the component within the pipeline</param> /// <param name="reader">The per-instance configuration</param> private void ApplyComponentConfig(Guid stageId, string name, int index, XmlReader reader) { PipelineStage stage = PipelineStage.Lookup(stageId); IPersistPropertyBag component = GetComponent(stage, index) as IPersistPropertyBag; if (component != null) { String compName = component.GetType().FullName; if (compName != name) { throw new InvalidOperationException(String.Format( "Component in stage '{0}', index {1} is '{2}', expected '{3}'", stage.Name, index, compName, name)); } IPropertyBag bag = new InstConfigPropertyBag(reader); component.Load(bag, 1); } }