Пример #1
0
 /// <summary>
 /// フレームにオブジェクトを追加します
 /// </summary>
 /// <param name="info">追加するオブジェクトの情報</param>
 /// <param name="object">オブジェクトの状態</param>
 public void SetObject(IReadableMotionObjectInfo info, MotionObject @object)
 {
     lock (this) {
         //if(info.Parent != this.Parent)
         //    throw new ArgumentException("Parent mismatch");
         if (@object == null)
         {
             RemoveObject(info.Id);
         }
         else
         {
             if ([email protected](info.ObjectType))
             {
                 throw new ArgumentException(string.Format("cannot assign '{0}' to frame as '{1}'", @object.GetType(), info.ObjectType));
             }
             _objectList[info.Id] = @object;
         }
     }
 }
Пример #2
0
 /// <summary>
 /// フレームにオブジェクトを追加します
 /// </summary>
 /// <param name="id">追加するオブジェクトのID</param>
 /// <param name="object">オブジェクトの状態</param>
 public void SetObject(uint id, MotionObject @object)
 {
     lock (this) {
         if (@object == null)
         {
             this.RemoveObject(id);
         }
         else
         {
             MotionObjectInfo info = this.Parent.GetObjectInfoById(id);
             if ([email protected](info.ObjectType))
             {
                 throw new ArgumentException(string.Format("cannot assign '{0}' to frame as '{1}'", @object.GetType(), info.ObjectType));
             }
             _objectList[id] = @object;
         }
     }
 }