public static void SaveDetector(string fileName, GestureDetector detector) { using (BinaryWriter writer = new BinaryWriter(new FileStream(fileName, FileMode.Create))) { detector.Save(writer); } }