public abstract void Add(DataTemplateComponent c);
public abstract void Remove(DataTemplateComponent c);
public override void Remove(DataTemplateComponent c) { throw new CompositeException("Error: Cannot remove from a single leaf"); }
public override void Add(DataTemplateComponent c) { throw new CompositeException("Error: Cannot add to a single leaf"); }
public override void Remove(DataTemplateComponent component) { _children.Remove(component); }
public override void Add(DataTemplateComponent component) { component.Parent = this; _children.Add(component); }
private static void WriteElement(XmlWriter writer, DataTemplateComponent component, OutputConfiguration configuration) { if (component.Component == null) { writer.WriteElementString("Position", "n/a"); writer.WriteElementString("Name", component.Name); writer.WriteElementString("Type", "n/a"); writer.WriteElementString("Value", "n/a"); return; } switch (configuration) { case OutputConfiguration.Composite: writer.WriteElementString("Position", component.Component.Pos.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("Name", component.Component.Name); writer.WriteElementString("Type", component.Component.TypeOfVariable.ToString()); writer.WriteElementString("Value", CleanInvalidXmlChars(component.Component.StringValue()).Trim()); break; case OutputConfiguration.Template: writer.WriteAttributeString("Name", component.Component.Name); writer.WriteAttributeString("Reference", ""); var id = 0; var parent = component.Component.GetOwner() as CommunicationInterfaceHandler; if (parent != null) id = (int) parent.Header.Id; writer.WriteAttributeString("InterfaceId", id.ToString(CultureInfo.InvariantCulture)); writer.WriteAttributeString("InterfaceType", component.Component.TypeOfInterface.ToString()); break; } }