Example #1
0
        private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ComboBox   comboBox  = (ComboBox)sender;
            StackPanel sp        = comboBox.Parent as StackPanel;
            TextBlock  tb        = sp.Children.OfType <TextBlock>().First();
            StackPanel topsp     = sp.Parent as StackPanel;
            TextBlock  textBlock = topsp.Children.OfType <TextBlock>().First();
            string     path      = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "DataBase", e.AddedItems[0].ToString() + ".sqlite");
            double     count     = 0;
            long       length    = 0;

            if (File.Exists(path))
            {
                using (MySqlite sqlite = new MySqlite(path, true))
                {
                    count = sqlite.SelectCountByTable("movie");
                }
                length = new FileInfo(path).Length;
            }
            textBlock.Text = $"{Jvedio.Language.Resources.Number}:{count}\n{Jvedio.Language.Resources.FileSize}:{length.ToProperFileSize()}";

            if (tb.Text == Jvedio.Language.Resources.Source)
            {
                src = path;
            }
            else
            {
                dst = path;
            }
        }