Example #1
0
        public PDFReader(string pdf, CatParameters selectedCat)
        {
            _pdf         = pdf;
            _selectedCat = selectedCat;

            InitializeComponent();

            WebBrowser webBrowser = new WebBrowser();

            webBrowser.Navigate(new Uri(_pdf));
            PDF.Content = webBrowser;
        }
Example #2
0
 private void ShowCat_Click(object sender, RoutedEventArgs e)
 {
     if (catsList.SelectedItem != null)
     {
         string        name        = catsList.SelectedItem.ToString();
         CatParameters selectedCat = _catsList.Find(selCat => selCat.catName == name);
         var           newWPF      = new CatDetails(selectedCat);
         newWPF.CatDetail();
         newWPF.Show();
     }
     else
     {
         MessageBox.Show("Choose a cat!", "ERROR", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
Example #3
0
        private void NewCat_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var res = MessageBox.Show("Is " + newCatName.Text + " male?", "One more thing", MessageBoxButton.YesNo, MessageBoxImage.Question);
                if (res == MessageBoxResult.Yes)
                {
                    catSex = true;
                }
                CatParameters newCat = new CatParameters(newCatName.Text, newCatRace.Text, Convert.ToInt32(newCatMass.Text), food.Text, catSex);
                newCat.weightDate = DateTime.Now;
                _catsList.Add(newCat);

                catsList.Items.Add(newCat.catName);
                Directory.CreateDirectory(appPath + @"\" + newCatName.Text);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Example #4
0
 public CatDetails(CatParameters selectedCat)
 {
     _selectedCat = selectedCat;
 }