Beispiel #1
0
        public MainWindow()
        {
            ApplicationStartup();

            DataContext = currentViewModel;
            currentViewModel.AddAllSequences(SequenceList.Deserialize());

            InitializeComponent();

            RegisterKinect();
            InitiateDisplay();

            SetBaseCSVPath();
            CreateDataTables();
        }
Beispiel #2
0
        public static SequenceList Deserialize(string filename)
        {
            // Create an instance of the XmlSerializer.
            XmlSerializer serializer = new XmlSerializer(typeof(SequenceList));

            // Declare an object variable of the type to be deserialized.
            SequenceList sequences = null;

            try
            {
                using (Stream reader = new FileStream(filename, FileMode.Open))
                {
                    // Call the Deserialize method to restore the object's state.
                    sequences = (SequenceList)serializer.Deserialize(reader);
                }
            }
            catch (FileNotFoundException)
            {
                Debug.WriteLine("Sequence configuration file not found");
            }

            return(sequences);
        }