Ejemplo n.º 1
0
 public static void Load(string file)
 {
     using (Stream reader = File.OpenRead(file))
     {
         _results = Serializer.Deserialize<ResultSet>(reader);
     }
 }
Ejemplo n.º 2
0
        public static void Load(string file)
        {
            using (Stream reader = File.OpenRead(file))
            {
                _results = Serializer.Deserialize<ResultSet>(reader);
            }

            _results.Matches.ForEach(x => x.Initialize(_results.Shapes[x.ShapeId]));
        }
Ejemplo n.º 3
0
        private void SaveToolStripMenuItemClick(object sender, EventArgs e)
        {
            SaveFileDialog saveFileDialog = new SaveFileDialog
                                                {
                                                    Filter = @"Match collections (*.transit)|*.transit|All files (*.*)|*.*",
                                                    FilterIndex = 1
                                                };

            DialogResult result = saveFileDialog.ShowDialog();
            if (result != DialogResult.OK) return;

            File.Delete(saveFileDialog.FileName);

            ResultSet resultSet = new ResultSet(_matchCollection.IncludedMatches.ToList(), Data.Shapes);

            using (Stream writer = File.OpenWrite(saveFileDialog.FileName))
            {
                Serializer.Serialize(writer, resultSet);
                Serializer.FlushPool();
            }
        }