Beispiel #1
0
 private void Button_Load_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         var openFileDialog = new OpenFileDialog();
         if (openFileDialog.ShowDialog().GetValueOrDefault())
         {
             SpiderSearch = SerializationTool.DeserializeJsonFile <SpiderSearch>(openFileDialog.FileName);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Beispiel #2
0
 private void Button_Save_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         var saveFileDialog = new SaveFileDialog();
         if (saveFileDialog.ShowDialog().GetValueOrDefault())
         {
             SerializationTool.SerializeJsonFile(saveFileDialog.FileName, SpiderSearch);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Beispiel #3
0
 private void Button_LoadTab_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         var openFileDialog = new OpenFileDialog();
         openFileDialog.Multiselect = true;
         if (openFileDialog.ShowDialog().GetValueOrDefault())
         {
             foreach (var fileName in openFileDialog.FileNames)
             {
                 var spiderSearch = SerializationTool.DeserializeJsonFile <SpiderSearch>(fileName);
                 var tabItem      = new TabItem();
                 tabItem.Header  = spiderSearch.Name;
                 tabItem.Content = new SpiderControl(this, tabItem, spiderSearch);
                 tabSearches.Items.Add(tabItem);
                 tabSearches.SelectedItem = tabItem;
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }