Advertisement
Guest User

Untitled

a guest
Dec 8th, 2011
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.71 KB | None | 0 0
  1. #region Template management:
  2.  
  3.         /// <summary>
  4.         /// Akcja po wczytaniu DomainDataSource szablonów
  5.         /// </summary>
  6.         /// <param name="sender"></param>
  7.         /// <param name="e"></param>
  8.         private void ExcelTemplateDomainDataSource_LoadedData(object sender, LoadedDataEventArgs e)
  9.         {
  10.             if (e.HasError)
  11.             {
  12.                 System.Windows.MessageBox.Show(e.Error.ToString(), "Load Error", System.Windows.MessageBoxButton.OK);
  13.                 e.MarkErrorAsHandled();
  14.             }
  15.         }
  16.  
  17.         /// <summary>
  18.         ///
  19.         /// </summary>
  20.         /// <param name="sender"></param>
  21.         /// <param name="e"></param>
  22.         private void CreateTemplateButton_Click(object sender, RoutedEventArgs e)
  23.         {
  24.             NewExcelTemplatePopUpWindow createTemplate = new NewExcelTemplatePopUpWindow(excelTemplateDomainDataSource);
  25.             Deployment.Current.Dispatcher.BeginInvoke(() => createTemplate.Show());
  26.         }
  27.  
  28.         /// <summary>
  29.         ///
  30.         /// </summary>
  31.         /// <param name="sender"></param>
  32.         /// <param name="e"></param>
  33.         private void DeleteTemplateButton_Click(object sender, RoutedEventArgs e)
  34.         {
  35.             RemoveExcelTemplate();
  36.         }
  37.  
  38.         /// <summary>
  39.         ///
  40.         /// </summary>
  41.         private void RemoveExcelTemplate()
  42.         {
  43.  
  44.         }
  45.  
  46.         /// <summary>
  47.         ///
  48.         /// </summary>
  49.         /// <param name="sender"></param>
  50.         /// <param name="e"></param>
  51.         private void ExcelTemplateDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
  52.         {
  53.             // Wypełnij listę kolumn wybranego szablonu:
  54.             this.columnNamesList.Items.Clear();
  55.  
  56.             if (this.excelTemplateDataGrid.SelectedItem != null)
  57.             {
  58.                 ExcelTemplate currentTemplate = this.excelTemplateDataGrid.SelectedItem as ExcelTemplate;
  59.                 if (!string.IsNullOrEmpty(currentTemplate.XmlColumnNames))
  60.                 {
  61.                     List<string> columnNames = this.DeserializeFromXLMString(typeof(List<string>), currentTemplate.XmlColumnNames) as List<string>;
  62.                     foreach (string s in columnNames)
  63.                         this.columnNamesList.Items.Add(s);
  64.                 }
  65.             }
  66.         }
  67.  
  68.         private void excelTemplateDomainDataSource_LoadedData(object sender, LoadedDataEventArgs e)
  69.         {
  70.             this.srfBusyIndicator.IsBusy = false;
  71.         }
  72.  
  73.         private void ExcelTemplateDomainDataSource_LoadingData(object sender, LoadingDataEventArgs e)
  74.         {
  75.             this.srfBusyIndicator.IsBusy = true;
  76.         }
  77.  
  78.         #endregion
  79.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement