Beispiel #1
0
 public abstract void Add(DataTemplateComponent c);
Beispiel #2
0
 public abstract void Remove(DataTemplateComponent c);
Beispiel #3
0
 public override void Remove(DataTemplateComponent c)
 {
     throw new CompositeException("Error: Cannot remove from a single leaf");
 }
Beispiel #4
0
 public override void Add(DataTemplateComponent c)
 {
     throw new CompositeException("Error: Cannot add to a single leaf");
 }
Beispiel #5
0
 public override void Remove(DataTemplateComponent component)
 {
     _children.Remove(component);
 }
Beispiel #6
0
 public override void Add(DataTemplateComponent component)
 {
     component.Parent = this;
     _children.Add(component);
 }
Beispiel #7
0
        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;
            }
        }