private List<ISpyItem> getFiles(string location) { List<ISpyItem> items = new List<ISpyItem>(); string[] files = Directory.GetFiles(location, "*.ispy"); //Only get files for ispy foreach (string file in files) { StreamReader r = new StreamReader(file); ISpyItem newItem = new ISpyItem(location+"\\"+r.ReadLine()); while(r.Peek()!=-1) { ISpySign newSign = new ISpySign(r.ReadLine()[0], r.ReadLine()); newItem.signs.Add(newSign); } r.Close(); items.Add(newItem); } return items; }
private void setSign(ISpySign spySign) { var curSign = Sign.FromName(spySign.signName); if (curSign == null) { throw new Exception("The sign \"" + spySign.signName + "\" has not been trained."); } #if KINECT currentSignModel = curSign.SignModel; skeletonDrawer = new SkeletonDrawer(SkeletonImage); KinectHandler.Get().AddVideoListener(NUIVideoFrameReady); CursorController.Get().StartListening(); #else currentSignModel = new MockModel(); #endif }