private SkeletonContainer[] ToContainer(SkeletonFrame frame)
 {
     return frame.Skeletons.Select((skeleton) => skeleton.ToContainer()).ToArray();
 }
 public bool Write(SkeletonFrame frame)
 {
     bool success = false;
     lock (this.writer)
     {
         if (!this.stopped && (success = !frame.IsEmpty)
             && frame.RelativeTime.Ticks != this.previous.RelativeTime.Ticks)
         {
     //					Console.Log (frame);
             this.writeableBlock.Add(this.FrameToMasterDetail(frame));
             this.initialTimestamp = this.initialTimestamp == 0 ? frame.RelativeTime.Ticks : this.initialTimestamp;
             this.previous = frame;
             if (this.writeableBlock.Count == BlockBufferSize)
             {
                 //Console.Log("Writing frame");
                 this.totalWrittenFrames += this.writeableBlock.Count;
                 this.engine.WriteStream(this.writer, this.writeableBlock.ToArray());
                 this.writeableBlock.Clear();
             }
         }
     }
     //if(success)Console.Log("Wrote frame successfully "+totalWrittenFrames);
     //	else Console.Log("Frame locked");
     return success;
 }
 private MasterDetails FrameToMasterDetail(SkeletonFrame frame)
 {
     return new MasterDetails()
     {
         Master = frame.ToContainer(),
         Details = this.ToContainer(frame)
     };
 }
 //public void AddFrame(HBP.SkeletonBone[] frame)
 public void AddFrame(SkeletonFrame frame)
 {
     this.motion.Add(frame);
     this.numberFrames++;
     Console.ImportantIf(frame.UserCount > 1,"<color=orange><b>MORE THAN 1 USERS CAPTURED!</b></color>");
 }