Пример #1
0
        public TransferEvent(pTransferType s)
            : base(s.UnitID, s.Timer)
        {
            this.from = s.From;
            this.to = s.To;
            this.Range = null;
            if (null != s.EngramRange)
            {
                this.Range = new EngramRange(s.EngramRange);
            }

        }
Пример #2
0
        public override pTransferType pGetTransfer()
        {
            string unitID = "Unknown object";
            pTransferType returnValue;
            try
            {
                reader.Read();
                unitID = pGetString();
                pEngramRange engramRange = null;
                if ("EngramRange" == reader.Name)
                {
                    engramRange = pGetEngramRange();
                }


                int timer = pGetInt();
                string from = pGetString();
                string to = pGetString();
                returnValue = new pTransferType(unitID, engramRange, timer, from, to);

                reader.ReadEndElement();
            }
            catch (System.Exception e)
            {
                throw new ApplicationException("Error reading Transfer for " +
                    unitID + ": ", e);
            }

            return returnValue;
        }