public static T GetAttribute <T>(this Room room, RoomAttributes roomAttribute, T defaultValue) { object attr; if (room.CustomProperties.TryGetValue(roomAttribute.ToString(), out attr)) { return((T)attr); } return(defaultValue); }
public static void SetAttribute(this Room room, RoomAttributes roomAttribute, object value) { Hashtable newTable = new Hashtable(); newTable[roomAttribute.ToString()] = value; room.SetCustomProperties(newTable); }