本文整理汇总了C#中RoomData.Fill方法的典型用法代码示例。如果您正苦于以下问题:C# RoomData.Fill方法的具体用法?C# RoomData.Fill怎么用?C# RoomData.Fill使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RoomData
的用法示例。
在下文中一共展示了RoomData.Fill方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FetchRoomData
/// <summary>
/// Fetches the room data.
/// </summary>
/// <param name="roomId">The room identifier.</param>
/// <param name="dRow">The d row.</param>
/// <returns>RoomData.</returns>
internal RoomData FetchRoomData(uint roomId, DataRow dRow)
{
if (LoadedRoomData.ContainsKey(roomId))
{
LoadedRoomData[roomId].LastUsed = DateTime.Now;
return LoadedRoomData[roomId];
}
var roomData = new RoomData();
roomData.Fill(dRow);
LoadedRoomData.TryAdd(roomId, roomData);
return roomData;
}
示例2: GenerateRoomData
/// <summary>
/// Generates the room data.
/// </summary>
/// <param name="roomId">The room identifier.</param>
/// <returns>RoomData.</returns>
internal RoomData GenerateRoomData(uint roomId)
{
if (LoadedRoomData.ContainsKey(roomId))
{
LoadedRoomData[roomId].LastUsed = DateTime.Now;
return LoadedRoomData[roomId];
}
if (IsRoomLoaded(roomId))
return GetRoom(roomId).RoomData;
var roomData = new RoomData();
using (var queryReactor = Azure.GetDatabaseManager().GetQueryReactor())
{
queryReactor.SetQuery($"SELECT * FROM rooms_data WHERE id = {roomId} LIMIT 1");
var dataRow = queryReactor.GetRow();
if (dataRow == null)
return null;
roomData.Fill(dataRow);
LoadedRoomData.TryAdd(roomId, roomData);
}
return roomData;
}