コード例 #1
0
            private void toolStripButtonAddAeTitle_Click ( object sender, EventArgs e )
            {
               try
               {
                  EditAeTitleDialog dialog ;
                  
                  
                  dialog = new EditAeTitleDialog ( ) ;

                  if ( dialog.ShowDialog ( this ) == DialogResult.OK )
                  {
                     AeInfo newAeInfo = AddInUtils.Clone<AeInfo> ( dialog.AeInfo ) ;
                     
                     
                     newAeInfo.Address = newAeInfo.Address ;
                     
                     try
                     {
                        WorkstationService.SendMessage ( MessageNames.AddAeTitle, newAeInfo ) ;
                     }
                     catch ( Exception ex )
                     {
                        ThreadSafeMessager.ShowError (  "Error sending message.\n" + ex.Message ) ;
                     }
                  }
               }
               catch ( Exception exception )
               {
                  System.Diagnostics.Debug.Assert ( false, exception.Message ) ;
                                 
                  ThreadSafeMessager.ShowError (  exception.Message ) ;
               }
            }
コード例 #2
0
            private void toolStripButtonEditAeTitle_Click ( object sender, EventArgs e )
            {
               try
               {
                  EditAeTitleDialog dialog ;
                  string oldAe ;
                  
                  
                  if ( AeTitlesListView.SelectedItems.Count == 0 )
                  {
                     return ;
                  }
                  
                  dialog = new EditAeTitleDialog ( ) ;
                  
                  dialog.AeInfo = AddInUtils.Clone<AeInfo> ( AeTitlesListView.SelectedItems [ 0 ].Tag as AeInfo ) ;
                  
                  oldAe  = dialog.AeInfo.AETitle ;

                  if ( dialog.ShowDialog ( this ) == DialogResult.OK )
                  {
                     try
                     {
                        AeInfo newAeInfo = AddInUtils.Clone<AeInfo> ( dialog.AeInfo ) ;
                        
                        
                        newAeInfo.Address = newAeInfo.Address ;
                        
                        WorkstationService.SendMessage ( MessageNames.UpdateAeTitle,
                                                         oldAe, 
                                                         newAeInfo ) ;
                     }
                     catch (Exception ex)
                     {
                        ThreadSafeMessager.ShowError (  "Error sending message.\n" + ex.Message ) ;
                     }
                  }
               }
               catch ( Exception exception )
               {
                  System.Diagnostics.Debug.Assert ( false, exception.Message ) ;
                                 
                  ThreadSafeMessager.ShowError (  exception.Message ) ;
               }
            }