Пример #1
0
 private void btnSave_Click(object sender, RoutedEventArgs e)
 {
     if (StoredProcList.GetSPList().IsEmpty)
     {
         if (MessageBox.Show("Do you want to save an empty list?", "Nothing added to list", MessageBoxButton.YesNo) == MessageBoxResult.No)
         {
             return;
         }
     }
     //TODO: make the default be the right place
     Microsoft.Win32.SaveFileDialog svDlg = new Microsoft.Win32.SaveFileDialog();
     svDlg.Filter          = @"Racoon Settings|*.rst|All Files|*.*";
     svDlg.DefaultExt      = "*.rst";
     svDlg.Title           = "Select target for settings file";
     svDlg.OverwritePrompt = false;
     svDlg.FileName        = RacoonMiddleWare.Properties.Settings.Default.QueryDefsPath;
     if (svDlg.ShowDialog().Value)
     {
         StoredProcList.GetSPList().SaveToFile(svDlg.FileName);
         tbStatusText.Text = "Saved";
     }
     else
     {
         tbStatusText.Text = "Save Canceled";
     }
 }
 public static StoredProcList GetSPList()
 {
     lock (spListLock)
     {
         if (theStoredProcList != null)
         {
             return(theStoredProcList);
         }
         else
         {
             theStoredProcList = new StoredProcList();
             return(theStoredProcList);
         }
     }
 }
Пример #3
0
 private void btnAdd_Click(object sender, RoutedEventArgs e)
 {
     StoredProcList.GetSPList().CreateAndAdd(QryName, QueryType, ContentText, Server, DataStore);
     tbStatusText.Text = "Added item";
 }