private void ClearHIstoryButton_Click(object sender, RoutedEventArgs e)
 {
     if (MessageBox.Show("Вы действительно хотите очистить историю???", "Очистить историю", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
     {
         BrowserL.GEtInstatce().History.Clear();
     }
 }
Exemple #2
0
        public MainWindow()
        {
            InitializeComponent();
            Browser.Source = new Uri("https://www.google.com.ua/");
            ResourceDictionary resourceDict = Application.LoadComponent(new Uri(BrowserL.GEtInstatce().CurrentTheme, UriKind.Relative)) as ResourceDictionary;

            Application.Current.Resources.MergedDictionaries.Add(resourceDict);
        }
Exemple #3
0
 //for write history
 private void Browsernavigated(object sender, NavigationEventArgs e)
 {
     if (BrowserL.GEtInstatce().IsSaveHistory)
     {
         string URL = ((WebBrowser)sender).Source.ToString();
         BrowserL.GEtInstatce().AddHistory(new History(URL, GetTitle()));
     }
     ((TabItem)TabControls.Items[TabControls.SelectedIndex]).Header = GetTitle();
 }
        private void StyleComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            // BrowserL.GEtInstatce().CurrentTheme = ((ComboBoxItem)StyleComboBox.SelectedItem).Content.ToString();
            BrowserL.GEtInstatce().CurrentTheme = ((string)StyleComboBox.SelectedItem);


            ResourceDictionary resourceDict = Application.LoadComponent(new Uri(BrowserL.GEtInstatce().CurrentTheme, UriKind.Relative)) as ResourceDictionary;

            // очищаем коллекцию ресурсов приложения

            // добавляем загруженный словарь ресурсов
            Application.Current.Resources.MergedDictionaries.Add(resourceDict);
        }
Exemple #5
0
 public static BrowserL GEtInstatce()
 {
     if (Browser == null)
     {
         if (File.Exists(@"D:\Study\ШАГ\С#\New\WPF\Browser\Browser\bin\Debug\sett.xml"))
         {
             Des();
         }
         else
         {
             Browser = new BrowserL();
         }
     }
     return(Browser);
 }
Exemple #6
0
 private void OK_Click(object sender, RoutedEventArgs e)
 {
     BrowserL.GEtInstatce().AddBookmarks(new Bookmark(this.URLTB.Text, NameTB.Text));
     MessageBox.Show("Закладка добавленна");
     this.Close();
 }
 public SettingWindow()
 {
     InitializeComponent();
     this.StyleComboBox.SelectedIndex = BrowserL.GEtInstatce().styleList.IndexOf(BrowserL.GEtInstatce().CurrentTheme.Replace(@"Themes/", String.Empty).Replace(".xaml", String.Empty));
 }