Ejemplo n.º 1
0
        public override string ToString()
        {
            String output = "";

            output += "     Attribute: " + attributeName + "(ID=" + attributeId + ")\n";
            if (value is LinkIDCompound)
            {
                LinkIDCompound compound = (LinkIDCompound)value;
                output += "       Compound:\n";
                output += compound.ToString();
            }
            else
            {
                output += "       value=" + value + "\n";
            }

            return(output);
        }
Ejemplo n.º 2
0
        private static AttributeType getAttributeType(LinkIDAttribute attribute)
        {
            AttributeType attributeType = new AttributeType();

            attributeType.Name = attribute.attributeName;
            if (null != attribute.attributeId)
            {
                setAttributeId(attributeType, attribute.attributeId);
            }

            if (null != attribute.value)
            {
                if (attribute.value is LinkIDCompound)
                {
                    // wrap members
                    AttributeType compoundValueAttribute = new AttributeType();
                    attributeType.AttributeValue = new AttributeType[] { compoundValueAttribute };

                    // compounded
                    LinkIDCompound       compound = (LinkIDCompound)attribute.value;
                    List <AttributeType> members  = new List <AttributeType>();
                    foreach (LinkIDAttribute member in compound.members)
                    {
                        AttributeType memberAttributeType = new AttributeType();
                        memberAttributeType.Name           = member.attributeName;
                        memberAttributeType.AttributeValue = new Object[] { member.value };
                        members.Add(memberAttributeType);
                    }
                    compoundValueAttribute.AttributeValue = members.ToArray();
                }
                else
                {
                    // single/multi valued
                    attributeType.AttributeValue = new Object[] { attribute.value };
                }
            }
            return(attributeType);
        }