示例#1
0
		public void InitialiseFromStub(RoomStub roomStub, DOMElement roomList, StateStub[] controllerStateStore)
		{
			stub = roomStub;

			Guid = stub.guid;
			Name = stub.name;
			Url = stub.url;
			Pinable = stub.pinable;
			pinned = stub.pinned;
			starred = stub.starred;
			Starrable = stub.starrable;
			isStarredByDefault = stub.isStarredByDefault;
			ReadOnly = stub.readOnly;
			IsPhotoChatRoom = stub.isPhotoChatRoom;
			IsPrivateChatRoom = stub.isPrivateChatRoom;
			IsNewPhotoAlertsRoom = stub.isNewPhotoAlertsRoom;
			Presence = stub.presence;
			tokenDateTimeTicks = stub.tokenDateTimeTicks;
			token = stub.token;
			hasArchive = stub.hasArchive;


			state = new StateStub();
			state.Initialise(
				stub.guid, 
				stub.selected,
				stub.guest,
				stub.newMessages,
				stub.totalMessages,
				stub.latestItem,
				stub.latestItemSeen,
				stub.latestItemOld,
				stub.listOrder,
				stub.tokenDateTimeTicks,
				stub.token);

			addToStateStoreIfNotAlreadyThere(controllerStateStore, state);

			html = new RoomHtml(stub, LoggedIn);

			string outerClientID = roomStub.parentClientID + "_Room_" + Guid + "_Outer";
			DOMElement newNode = Document.CreateElement("span");
			newNode.ID = outerClientID;
			newNode.InnerHTML = html.ToHtml();
			roomList.AppendChild(newNode.FirstChild);

			InitialiseElements(outerClientID);

			genericInitialise();
		}
示例#2
0
		void addContorls(Dictionary<Guid, RoomStub> rooms, List<Guid> roomsOrder, ref bool hasGuestRooms, ref bool hasPrivateRooms)
		{
			foreach (Guid g in roomsOrder)
			{
				RoomHtml roomHtml = new RoomHtml(rooms[g], Usr.Current != null);
				if (rooms[g].guest)
				{
					hasGuestRooms = true;
					RoomGuestList.Controls.Add(new LiteralControl(roomHtml.ToHtml()));
				}
				else if (rooms[g].isPrivateChatRoom)
				{
					hasPrivateRooms = true;
					RoomPrivateList.Controls.Add(new LiteralControl(roomHtml.ToHtml()));
				}
				else
				{
					RoomList.Controls.Add(new LiteralControl(roomHtml.ToHtml()));
				}
			}
		}