Beispiel #1
0
        private Adjustment _GetAdjustment(XmlNode xmlNode)
        {
            if (xmlNode.Attributes != null)
            {
                var adjustment = new Adjustment { Id = new Guid(xmlNode.Attributes["Id"].Value) };

                foreach (XmlNode childNode in xmlNode.ChildNodes)
                {
                    switch (childNode.Name)
                    {
                        case "Timestamp":
                            adjustment.Timestamp = _GetTimeStamp(childNode);
                            break;

                        case "Product":
                            adjustment.Product = _GetProduct(childNode);
                            break;

                        case "UserName":
                            adjustment.Username = childNode.InnerText;
                            break;

                        case "Channels":
                            adjustment.Channels = _GetChannelList(childNode);
                            break;

                        default:
                            Logger.WriteDebugMessage(string.Format("Unknown XML Node found! Node Name: '{0}'", childNode.Name));
                            break;
                    }
                }

                return adjustment;
            }

            return null;
        }