Exemplo n.º 1
0
        public override void ToXml(XmlWriter o, string tag, params KeyValuePair<string, string>[] attrs)
        {
            cll = DNACall.CreateCall(Value);
            o.WriteStartElement(tag);
            foreach (KeyValuePair<string, string> at in attrs)
                o.WriteAttributeString(at.Key, at.Value);

            o.WriteAttributeString("callType", cll.CallType);

            foreach (DNACall.FieldValue fld in cll.Fields)
            {
                o.WriteStartElement(fld.m_fldDesc.m_FieldName);
                o.WriteString(fld.Value);
                o.WriteEndElement();
            }
            o.WriteEndElement();
        }
Exemplo n.º 2
0
        //1 call creation
        public override void OnXmlAttribute(XmlReader tr)
        {
            string callType = tr.GetAttribute("callType");
            if (callType == null || !DNACall.CallTypes.Contains(callType))
            {
                string callTypes = string.Empty;
                foreach (string ct in DNACall.CallTypes)
                    callTypes += "callType=\"" + ct + "\" or ";
                callTypes = callTypes.Substring(0, callTypes.Length - 4);
                throw new Exception("Mandatory attribute 'callType' is missing. Valid values are: " + callTypes);
            }

            cll = DNACall.CreateCall(callType);
        }