createZoneNameFromRooms() публичный Метод

public createZoneNameFromRooms ( ) : void
Результат void
Пример #1
0
        private Zone createZoneForXMLNode(XmlNode _zoneNode)
        {
            if (_zoneNode == null)
            {
                return(null);
            }

            try
            {
                Zone newZone = new Zone();
                ZoneTrackMediaList mediaList;
                XmlNodeList        nodesAssignedRooms;
                Room newRoom;

                newZone.udn  = xmlDocumentHelper.getNodeAttributeValue(_zoneNode, "udn");
                newZone.uuid = newZone.udn.Substring(5);

                mediaList = Global.getZoneTitleListManager().getListForZone(newZone.udn);
                if (mediaList != null)
                {
                    newZone.trackListId = mediaList.listId;
                }

                if (String.IsNullOrWhiteSpace(newZone.udn))
                {
                    throw new Exception("Zone hat keinen UDN Identifier");
                }

                nodesAssignedRooms = _zoneNode.SelectNodes("room");
                if (nodesAssignedRooms != null)
                {
                    foreach (XmlNode nodeRoom in nodesAssignedRooms)
                    {
                        newRoom         = this.createRoomForXMLNode(nodeRoom);
                        newRoom.zoneUDN = newZone.udn;
                        rooms.Add(newRoom.udn, newRoom);
                        this.writeLog(LogType.Info, String.Format("Raum '{0}' in Zone '{1}' gefunden", newRoom.name, newZone.udn));
                        this.linkRoomToRoomRenderer(newRoom);
                        newZone.roomUDNs.Add(newRoom.udn);
                    }
                }

                newZone.createZoneNameFromRooms();

                this.writeLog(LogType.Info, String.Format("Zone UDN: '{0}' erstellt", newZone.udn));
                return(newZone);
            }
            catch (Exception e)
            {
                this.writeLog(LogType.Error, "Fehler beim erstellen von Zone aus XML-Knoten", e, _zoneNode.InnerXml);
                return(null);
            }
        }
Пример #2
0
        private Zone createZoneForXMLNode(XmlNode _zoneNode)
        {
            if (_zoneNode == null)
                return null;

            try
            {
                Zone newZone = new Zone();
                ZoneTrackMediaList mediaList;
                XmlNodeList nodesAssignedRooms;
                Room newRoom;

                newZone.udn = xmlDocumentHelper.getNodeAttributeValue(_zoneNode, "udn");
                newZone.uuid = newZone.udn.Substring(5);

                mediaList = Global.getZoneTitleListManager().getListForZone(newZone.udn);
                if (mediaList != null)
                    newZone.trackListId = mediaList.listId;

                if (String.IsNullOrWhiteSpace(newZone.udn))
                    throw new Exception("Zone hat keinen UDN Identifier");

                nodesAssignedRooms = _zoneNode.SelectNodes("room");
                if (nodesAssignedRooms != null)
                {
                    foreach (XmlNode nodeRoom in nodesAssignedRooms)
                    {
                        newRoom = this.createRoomForXMLNode(nodeRoom);
                        newRoom.zoneUDN = newZone.udn;
                        rooms.Add(newRoom.udn, newRoom);
                        this.writeLog(LogType.Info, String.Format("Raum '{0}' in Zone '{1}' gefunden", newRoom.name, newZone.udn));
                        this.linkRoomToRoomRenderer(newRoom);
                        newZone.roomUDNs.Add(newRoom.udn);
                    }
                }

                newZone.createZoneNameFromRooms();

                this.writeLog(LogType.Info, String.Format("Zone UDN: '{0}' erstellt", newZone.udn));
                return newZone;
            }
            catch (Exception e)
            {
                this.writeLog(LogType.Error, "Fehler beim erstellen von Zone aus XML-Knoten", e, _zoneNode.InnerXml);
                return null;
            }
        }