コード例 #1
0
        //public void CreateRoomVariable(string roomName, string name, RoomVariable so)
        //{
        //    Room room = RoomRepository.Instance.FindByName(roomName);
        //    if (room != null)
        //    {
        //        room.AddVariable(name, so);
        //    }
        //}

        //public RoomVariable GetRoomVariable(string roomName, string variableName)
        //{
        //    //RoomVariable so = null;

        //    //Room room = RoomRepository.Instance.FindByName(roomName);
        //    //if (room != null)
        //    //{
        //    //    so = room.GetVariable(variableName);
        //    //}

        //    //return so;

        //    throw new NotImplementedException();


        //}

        //public void UpdateRoomVariable(int RoomId, string Name, RoomVariable Value)
        //{
        //    //Room room = RoomRepository.Instance.Find(RoomId);
        //    //if (room != null)
        //    //{
        //    //    RoomVariable oldValue = room.GetVariable(Name);
        //    //    if (oldValue != null)
        //    //    {
        //    //        room.RemoveVariable(oldValue);
        //    //    }

        //    //    room.AddVariable(Name, Value);
        //    //}
        //    throw new NotImplementedException();

        //}

        //public void DeleteRoomVariable(int RoomId, string Name)
        //{
        //    //Room room = RoomRepository.Instance.Find(RoomId);
        //    //if (room != null)
        //    //{
        //    //    RoomVariable oldValue = room.GetVariable(Name);
        //    //    if (oldValue != null)
        //    //    {
        //    //        room.RemoveVariable(oldValue);
        //    //    }
        //    //}
        //    throw new NotImplementedException();

        //}

        //public Room GetRoomByName(string name)
        //{
        //    //return RoomRepository.Instance.FindByName(name);
        //    throw new NotImplementedException();
        //}

        //public Room GetRoomById(int roomId)
        //{
        //    throw new NotImplementedException();
        //}

        public void CreateRoomVariable(Room room, string variableName, byte [] value)
        {
            var variable = new RoomVariable();

            variable.Name  = variableName;
            variable.Value = value;

            room.RoomVariables.Add(variable);
            RoomRepository.Instance.Update(room);
        }
コード例 #2
0
        /// <summary>
        /// Create a new RoomVariable object.
        /// </summary>
        /// <param name="id">Initial value of the Id property.</param>
        /// <param name="name">Initial value of the Name property.</param>
        /// <param name="value">Initial value of the Value property.</param>
        /// <param name="roomId">Initial value of the RoomId property.</param>
        public static RoomVariable CreateRoomVariable(global::System.Int64 id, global::System.String name, global::System.Byte[] value, global::System.Int64 roomId)
        {
            RoomVariable roomVariable = new RoomVariable();

            roomVariable.Id     = id;
            roomVariable.Name   = name;
            roomVariable.Value  = value;
            roomVariable.RoomId = roomId;
            return(roomVariable);
        }
コード例 #3
0
 /// <summary>
 /// Create a new RoomVariable object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="value">Initial value of the Value property.</param>
 /// <param name="roomId">Initial value of the RoomId property.</param>
 public static RoomVariable CreateRoomVariable(global::System.Int64 id, global::System.String name, global::System.Byte[] value, global::System.Int64 roomId)
 {
     RoomVariable roomVariable = new RoomVariable();
     roomVariable.Id = id;
     roomVariable.Name = name;
     roomVariable.Value = value;
     roomVariable.RoomId = roomId;
     return roomVariable;
 }