예제 #1
0
        // returns:  All rooms in the home, including `roomForEntireHome`.
        public static HMRoom[] GetAllRooms(this HMHome self)
        {
            var rooms    = self.Rooms;
            var allRooms = new HMRoom[rooms.Length + 1];

            Array.Copy(rooms, allRooms, rooms.Length);
            allRooms [rooms.Length] = self.GetRoomForEntireHome();
            return(allRooms);
        }
예제 #2
0
        public static string GetNameForRoom(this HMHome home, HMRoom room)
        {
            var entireHome = room == home.GetRoomForEntireHome();

            return(entireHome ? string.Format("{0} Default Room", room.Name) : room.Name);
        }