Exemple #1
0
        private void pointFilesListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            PointFile selectedFile = (PointFile)pointFilesListView.SelectedItem;

            if (selectedFile != null)
            {
                GraphWindow contactDetailsWindow = new GraphWindow(PointsToFile.parse(selectedFile.Points));
                contactDetailsWindow.ShowDialog();
            }
        }
Exemple #2
0
        private static void SetText(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            FileControl control = d as FileControl;

            if (control != null)
            {
                control.nameTextBlock.Text   = (e.NewValue as PointFile).Name;
                control.dateTextBlock.Text   = "Fecha: " + (e.NewValue as PointFile).Date.ToString();
                control.pathTextBlock.Text   = (e.NewValue as PointFile).Path;
                control.pointsTextBlock.Text = "Points: 0";
                if (!(e.NewValue as PointFile).Points.Equals(""))
                {
                    List <DataPoint> pointList = PointsToFile.parse((e.NewValue as PointFile).Points);
                    control.pointsTextBlock.Text = "Points: " + pointList.Count.ToString();
                }
            }
        }
Exemple #3
0
        public static void insertIntoDatabase(string path, List <DataPoint> points)
        {
            try
            {
                string[]  pathSplit    = path.Split('\\').ToArray();
                PointFile newPointFile = new PointFile()
                {
                    Name   = pathSplit[pathSplit.Length - 1],
                    Path   = path,
                    Date   = DateTime.Now,
                    Points = PointsToFile.reverseParse(points)
                };

                using (SQLiteConnection connection = new SQLiteConnection(databasePath))
                {
                    connection.CreateTable <PointFile>();
                    connection.Insert(newPointFile);
                };
            }
            catch (Exception)
            {
                throw;
            }
        }