Exemplo n.º 1
0
        public override int Read(System.Xml.XmlReader reader)
        {
            int depth = reader.Depth;

            while (reader.Read())
            {
                int ret = 0;

                if ((reader.NodeType == XmlNodeType.Comment) ||
                    (reader.NodeType == XmlNodeType.Whitespace))
                {
                    continue;
                }

                if ((string.Compare(reader.Name, Name) == 0) &&
                    (reader.NodeType == XmlNodeType.EndElement) &&
                    (reader.Depth == depth))
                {
                    return(0);
                }
                else if (string.Compare(reader.Name, aECGControlVariable.ControlVariableName) == 0)
                {
                    aECGControlVariable var = new aECGControlVariable();

                    ret = var.Read(reader);

                    if (ret == 0)
                    {
                        ControlVariable = var;
                    }
                }
                else if (string.Compare(reader.Name, aECGRelatedObservation.RelatedObservationName) == 0)
                {
                    aECGRelatedObservation robs = new aECGRelatedObservation();

                    ret = robs.Read(reader);

                    if (ret == 0)
                    {
                        RelatedObservation = robs;
                    }
                }
                else if (string.Compare(reader.Name, aECGRelatedObservation.RelatedObservationName) == 0)
                {
                    aECGTransactionType tt = new aECGTransactionType();

                    ret = tt.Read(reader);

                    if (ret == 0)
                    {
                        TransactionType = tt;
                    }
                }
                else
                {
                    ret = aECGElement.ReadOne(this, reader);
                }

                if (ret != 0)
                {
                    return(ret > 0 ? 1 + ret : ret);
                }
            }

            return(-1);
        }
Exemplo n.º 2
0
        public override int Read(System.Xml.XmlReader reader)
        {
            int level = 0;

            while (reader.Read())
            {
                if ((reader.NodeType == XmlNodeType.Comment) ||
                    (reader.NodeType == XmlNodeType.Whitespace))
                {
                    continue;
                }

                if (_InnerName != null)
                {
                    if (level == 0)
                    {
                        if ((string.Compare(reader.Name, _InnerName) == 0) &&
                            (reader.NodeType == XmlNodeType.Element))
                        {
                            level++;
                        }

                        if ((string.Compare(reader.Name, Name) == 0) &&
                            (reader.NodeType == XmlNodeType.EndElement))
                        {
                            return(0);
                        }

                        continue;
                    }
                    else
                    {
                        if ((string.Compare(reader.Name, _InnerName) == 0) &&
                            (reader.NodeType == XmlNodeType.EndElement))
                        {
                            level--;
                            continue;
                        }
                    }
                }

                if ((string.Compare(reader.Name, Name) == 0) &&
                    (reader.NodeType == XmlNodeType.EndElement))
                {
                    return(0);
                }

                int ret = 0;

                if ((InnerVariables != null) &&
                    (string.Compare(reader.Name, "component") == 0))
                {
                    aECGControlVariable var = new aECGControlVariable("component");

                    ret = var.Read(reader);

                    if (ret == 0)
                    {
                        for (int i = 0; i < InnerVariables.Length; i++)
                        {
                            if (InnerVariables[i] == null)
                            {
                                InnerVariables[i] = var;
                                break;
                            }
                        }
                    }
                }
                else
                {
                    ret = aECGElement.ReadOne(this, reader);
                }

                if (ret != 0)
                {
                    return((ret > 0) ? 2 + ret : ret);
                }
            }

            return(-1);
        }
Exemplo n.º 3
0
 public aECGControlVariableHolder(aECGControlVariable var) : base(ControlVariableHolderName)
 {
     ControlVariable = var;
 }