public void AddRoomControl(RaumfeldNET.Room _roomInformation) { WPFControls.RoomStripControl roomStripControl = new WPFControls.RoomStripControl(); roomStripControl.RoomId = _roomInformation.udn; roomStripControl.RoomName = _roomInformation.name; roomStripControl.DataContext = _roomInformation; roomStripControl.RoomColor = (Color)ColorConverter.ConvertFromString(_roomInformation.color); roomStripControl.removeAddButtonClicked += roomStripControl_removeAddButtonClicked; DockPanel.SetDock(roomStripControl, Dock.Bottom); RoomsDockPanel.Children.Add(roomStripControl); }
private Room createRoomForXMLNode(XmlNode _roomNode) { if (_roomNode == null) return null; try { Room newRoom = new Room(); newRoom.udn = xmlDocumentHelper.getNodeAttributeValue(_roomNode, "udn"); newRoom.uuid = newRoom.udn.Substring(5); newRoom.name = xmlDocumentHelper.getNodeAttributeValue(_roomNode, "name"); newRoom.color = xmlDocumentHelper.getNodeAttributeValue(_roomNode, "color"); // we store real UDN of renderer and this is the same but without the uuid! newRoom.rendererUDN = xmlDocumentHelper.getChildNodeAttributeValue(_roomNode, "renderer", "udn"); newRoom.rendererUDN = newRoom.rendererUDN.Substring(5); // if room has no color assigned, then give him some white painting if (String.IsNullOrWhiteSpace(newRoom.color)) newRoom.color = "#FFFFFF"; if (String.IsNullOrWhiteSpace(newRoom.udn)) throw new Exception("Raum hat keinen UDN Identifier"); this.writeLog(LogType.Info, String.Format("Raum UDN: '{0}' erstellt", newRoom.udn)); return newRoom; } catch (Exception e) { this.writeLog(LogType.Error, "Fehler beim erstellen von Raum aus XML-Knoten", e, _roomNode.InnerXml); return null; } }
public void linkRoomToRoomRenderer(Room _room, Boolean _unlink = false, Boolean _crossLink = true) { RendererManager rendererManager = Global.getRendererManager(); RendererRoom renderer; renderer = (RendererRoom)rendererManager.getRenderer(_room.rendererUDN); if (renderer != null) { if (_unlink) renderer.roomUDN = String.Empty; else renderer.roomUDN = _room.udn; renderer.roomLinked(); //rendererManager.updateRenderersValue(renderer); if (_crossLink) rendererManager.linkRoomRendererToRoom(renderer, _unlink, false); this.checkAllRenderersLinked(); if (_unlink == true) this.writeLog(LogType.Info, String.Format("Raum '{0}' wurde von Renderer '{1}' entfernt", _room.udn, renderer.udn)); else this.writeLog(LogType.Info, String.Format("Raum '{0}' wurde zu Renderer '{1}' zugeordnet", _room.udn, renderer.udn)); } else this.writeLog(LogType.Warning, String.Format("Kein Renderer für Raum '{0}' für Zuordnung gefunden", _room.udn)); }