Source code for MSQuant: frmExportFilters.vb, MSQuant/msquant/src/GUI/forms/frmExportFilters.vb.

Table of contents page.

Home page for MSQuant.

'****************************************************************************
'* Copyright (C) 2004 Peter Mortensen and Matthias Mann                     *
'* This file is part of MSQuant.                                            *
'*                                                                          *
'* MSQuant is distributed under the terms of                                *
'* the GNU General Public License. See src/COPYING.TXT or                   *
'* <http://www.gnu.org/licenses/gpl.txt> for details.                       *
'*                                                                          *
'* MSQuant is free software; you can redistribute it                        *
'* and/or modify it under the terms of the GNU                              *
'* General Public License as published by the Free                          *
'* Software Foundation; either version 2 of the                             *
'* License, or (at your option) any later version.                          *
'*                                                                          *
'* MSQuant is distributed in the hope that it will be                       *
'* useful, but WITHOUT ANY WARRANTY; without even the                       *
'* implied warranty of MERCHANTABILITY or FITNESS FOR                       *
'* A PARTICULAR PURPOSE.  See the GNU General Public                        *
'* License for more details.                                                *
'*                                                                          *
'* You should have received a copy of the GNU General                       *
'* Public License along with MSQuant; if not, write to                      *
'* the Free Software Foundation, Inc., 59 Temple                            *
'* Place, Suite 330, Boston, MA  02111-1307  USA                            *
'*                                                                          *
'* Purpose: User set of what protein and peptide information to include     *
'*           in an export/save.                                             *
'*          Holds Class frmExportFilters, see below for                     *
'*          documentation.                                                  *
'*                                                                          *
'****************************************************************************

'****************************************************************************
'*                               CEBI                                       *
'*                    Software Development Group                            *
'*                         Peter Mortensen                                  *
'*                E-mail: NUKESPAMMERSdrmortensen@get2netZZZZZZ.dk          *
'*                 WWW: http://www.cebi.sdu.dk/                             *
'*                                                                          *
'*  Program for post-processing of result from search in mass               *
'*    spectrometric data.                                                   *
'*                                                                          *
'*    FILENAME:   frmExportFilters.vb                                       *
'*    TYPE:  VISUAL_BASIC                                                   *
'*                                                                          *
'* CREATED: PM 2005-03-08   Vrs 1.0. Estimated date...                      *
'* UPDATED: PM 2005-xx-xx                                                   *
'*                                                                          *
'****************************************************************************

Option Strict On
Option Explicit On 

Imports System.Text 'For StringBuilder
Imports System.IO 'For Path
Imports System.Collections.Generic 'For Dictionary


Imports massSpectrometryBase 'For peptideFilterSpecificationStructure

Imports App 'For class quantApplication

Imports SDUPutility 'For exportTargetSettingsStruct


Public Enum tagEnum
    enumTag1 = 271
    enumTag2
    enumTag3
End Enum 'tagEnum


Public Structure proteinAndPeptidesFilterStructure2

    Dim tag As tagEnum 'What is it used for? A helper flag
    '  for either saving user selected file or export to Excel.

    Dim includeProteinInformation3 As Boolean

    'Changed PM_PEPTIDEFILTER_GENERALISED 2007-08-26
    'Dim includeAllPeptides As Boolean
    Dim includePeptides As Boolean 'Very much semantic
    '   difference: all peptide vs. to output peptides at all.

    'Changed PM_PEPTIDEFILTER_GENERALISED 2007-08-27. Now implicit
    '  in the options structure. This also means the peptide filter
    '  part is global, whereas the other parameters are per parse -#
    '  not good.
    '
    ''Changed PM_PEPTIDEFILTER_GENERALISED 2007-08-26
    ''Dim includeVerifiedPeptides As Boolean
    ''Dim includeQuantifiedPeptides As Boolean
    'Dim peptideFilter As peptideFilterSpecificationStructure

    'Changed PM_SPECTRAEXPORT_GENERALISED 2008-05-05
    Dim includeSpectra As Boolean 'Exist for quantified peptides.

    'Changed PM_BROKENEXPORT 2008-05-28
    Dim exportTargetSettings4 As exportTargetSettingsStruct

End Structure 'proteinAndPeptidesFilterStructure


'Changed PM_SPECTRAEXPORT_GENERALISED 2008-05-05
Public Structure exportFilterValuesStructure 'For use in event that
    '  transfers information to the client.

    Dim proteinAndPeptidesFilter As proteinAndPeptidesFilterStructure2
    Dim peptideFilter As peptideFilterStructure
End Structure 'exportFilterValuesStructure


'****************************************************************************
'd$ <summary>
'd$   Purpose: Let the user select a subset of peptides for subsequently
'd$            action, e.g. saving of a report to a filter.
'd$ 
'd$   <see cref="T:VBXMLDoc.CVBXMLDoc" />.
'd$   <applicationname>test_rawDataFileHandling</applicationname>
'd$   <author>Peter Mortensen</author>
'd$   <seealso>http://www.cebi.sdu.dk/</seealso>
'd$   <codetype>GUI</codetype>
'd$ </summary>
Public Class frmExportFilters
    Inherits System.Windows.Forms.Form

    'Changed PM_SPECTRAEXPORT_GENERALISED 2008-05-05
    Public Event exportFilterDismissed( _
      ByVal aSender As Object, _
      ByVal anEvent As exportFilterEventArgs)

    Friend WithEvents lblProteinSubsetText As System.Windows.Forms.Label
    Friend WithEvents btnPeptideFilter As System.Windows.Forms.Button
    Friend WithEvents chkIncludePeptides As System.Windows.Forms.CheckBox
    Friend WithEvents lblPeptideFilterSummary As System.Windows.Forms.Label

    'Changed PM_SPECTRAEXPORT_GENERALISED 2008-05-05
    '  Private mParentForm As frmProteinList

    'Changed PM_PEPTIDEFILTER_GENERALISED 2007-08-27
    Private WithEvents mFilterForm As frmPeptideFilters

    Private mProteinAndPeptidesFilter2 As proteinAndPeptidesFilterStructure2

    'Changed PM_PEPTIDEFILTER_GENERALISED 2007-08-27
    'Private mOptions As OptionsStruct2
    Private mPeptideFilter As peptideFilterStructure

    Private mApplication As quantApplication
    Friend WithEvents GroupBox3 As System.Windows.Forms.GroupBox
    Friend WithEvents chkSpectraInfo As System.Windows.Forms.CheckBox
    Friend WithEvents lblExportTargetSettingsSummary As System.Windows.Forms.Label
    Friend WithEvents btnExportTarget As System.Windows.Forms.Button 'This for access to modifications set.

    'Changed PM_RAWFILE_PEPFILTER 2007-11-17
    Private mRawFiles() As fileSpecStructure

    'Changed PM_SILAC_AWARE_PEPTIDEFILTERDIALOG 2008-10-05
    Private mSILACmods As Dictionary(Of Integer, Integer)

    'Changed PM_BROKENEXPORT 2008-05-28
    Private WithEvents mExportTargetForm As frmExportTarget



#Region " Windows Form Designer generated code "

    Public Sub New( _
      ByVal aInProteinAndPeptidesFilter2 As proteinAndPeptidesFilterStructure2, _
      ByVal anExtraText As String, _
      ByRef anApp As quantApplication, _
      ByVal aPeptideFilter As peptideFilterStructure, _
      ByRef anInRawFiles() As fileSpecStructure, _
      ByRef aSILACmods As Dictionary(Of Integer, Integer) _
      )

        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

        Me.Init( _
          aInProteinAndPeptidesFilter2, _
          anExtraText, _
          anApp, _
          aPeptideFilter, _
          anInRawFiles, _
          aSILACmods)
    End Sub 'Constructor.


    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
    Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox
    Friend WithEvents btnCancel As System.Windows.Forms.Button
    Friend WithEvents btnOK As System.Windows.Forms.Button
    Friend WithEvents chkProteinsInfo As System.Windows.Forms.CheckBox
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.GroupBox1 = New System.Windows.Forms.GroupBox
        Me.chkProteinsInfo = New System.Windows.Forms.CheckBox
        Me.GroupBox2 = New System.Windows.Forms.GroupBox
        Me.lblPeptideFilterSummary = New System.Windows.Forms.Label
        Me.btnPeptideFilter = New System.Windows.Forms.Button
        Me.chkIncludePeptides = New System.Windows.Forms.CheckBox
        Me.btnCancel = New System.Windows.Forms.Button
        Me.btnOK = New System.Windows.Forms.Button
        Me.lblProteinSubsetText = New System.Windows.Forms.Label
        Me.GroupBox3 = New System.Windows.Forms.GroupBox
        Me.chkSpectraInfo = New System.Windows.Forms.CheckBox
        Me.lblExportTargetSettingsSummary = New System.Windows.Forms.Label
        Me.btnExportTarget = New System.Windows.Forms.Button
        Me.GroupBox1.SuspendLayout()
        Me.GroupBox2.SuspendLayout()
        Me.GroupBox3.SuspendLayout()
        Me.SuspendLayout()
        '
        'GroupBox1
        '
        Me.GroupBox1.Controls.Add(Me.chkProteinsInfo)
        Me.GroupBox1.Location = New System.Drawing.Point(24, 214)
        Me.GroupBox1.Name = "GroupBox1"
        Me.GroupBox1.Size = New System.Drawing.Size(185, 48)
        Me.GroupBox1.TabIndex = 16
        Me.GroupBox1.TabStop = False
        Me.GroupBox1.Text = "Protein information"
        '
        'chkProteinsInfo
        '
        Me.chkProteinsInfo.Location = New System.Drawing.Point(22, 21)
        Me.chkProteinsInfo.Name = "chkProteinsInfo"
        Me.chkProteinsInfo.Size = New System.Drawing.Size(109, 16)
        Me.chkProteinsInfo.TabIndex = 17
        Me.chkProteinsInfo.Text = "Include"
        '
        'GroupBox2
        '
        Me.GroupBox2.Controls.Add(Me.lblPeptideFilterSummary)
        Me.GroupBox2.Controls.Add(Me.btnPeptideFilter)
        Me.GroupBox2.Controls.Add(Me.chkIncludePeptides)
        Me.GroupBox2.Location = New System.Drawing.Point(24, 75)
        Me.GroupBox2.Name = "GroupBox2"
        Me.GroupBox2.Size = New System.Drawing.Size(185, 133)
        Me.GroupBox2.TabIndex = 12
        Me.GroupBox2.TabStop = False
        Me.GroupBox2.Text = "Peptides"
        '
        'lblPeptideFilterSummary
        '
        Me.lblPeptideFilterSummary.Location = New System.Drawing.Point(30, 86)
        Me.lblPeptideFilterSummary.Name = "lblPeptideFilterSummary"
        Me.lblPeptideFilterSummary.Size = New System.Drawing.Size(149, 44)
        Me.lblPeptideFilterSummary.TabIndex = 105
        Me.lblPeptideFilterSummary.Text = "<>"
        '
        'btnPeptideFilter
        '
        Me.btnPeptideFilter.Location = New System.Drawing.Point(22, 51)
        Me.btnPeptideFilter.Name = "btnPeptideFilter"
        Me.btnPeptideFilter.Size = New System.Drawing.Size(79, 23)
        Me.btnPeptideFilter.TabIndex = 15
        Me.btnPeptideFilter.Text = "Peptide &filter"
        '
        'chkIncludePeptides
        '
        Me.chkIncludePeptides.Location = New System.Drawing.Point(22, 19)
        Me.chkIncludePeptides.Name = "chkIncludePeptides"
        Me.chkIncludePeptides.Size = New System.Drawing.Size(109, 16)
        Me.chkIncludePeptides.TabIndex = 13
        Me.chkIncludePeptides.Text = "Include"
        '
        'btnCancel
        '
        Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.btnCancel.Location = New System.Drawing.Point(189, 373)
        Me.btnCancel.Name = "btnCancel"
        Me.btnCancel.Size = New System.Drawing.Size(67, 24)
        Me.btnCancel.TabIndex = 33
        Me.btnCancel.Text = "&Cancel"
        '
        'btnOK
        '
        Me.btnOK.Location = New System.Drawing.Point(110, 374)
        Me.btnOK.Name = "btnOK"
        Me.btnOK.Size = New System.Drawing.Size(67, 23)
        Me.btnOK.TabIndex = 31
        Me.btnOK.Text = "&OK"
        '
        'lblProteinSubsetText
        '
        Me.lblProteinSubsetText.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblProteinSubsetText.Location = New System.Drawing.Point(21, 12)
        Me.lblProteinSubsetText.Name = "lblProteinSubsetText"
        Me.lblProteinSubsetText.Size = New System.Drawing.Size(238, 33)
        Me.lblProteinSubsetText.TabIndex = 101
        Me.lblProteinSubsetText.Text = "xyz"
        '
        'GroupBox3
        '
        Me.GroupBox3.Controls.Add(Me.chkSpectraInfo)
        Me.GroupBox3.Location = New System.Drawing.Point(24, 277)
        Me.GroupBox3.Name = "GroupBox3"
        Me.GroupBox3.Size = New System.Drawing.Size(185, 48)
        Me.GroupBox3.TabIndex = 18
        Me.GroupBox3.TabStop = False
        Me.GroupBox3.Text = "Quantified spectrum information"
        '
        'chkSpectraInfo
        '
        Me.chkSpectraInfo.Location = New System.Drawing.Point(22, 23)
        Me.chkSpectraInfo.Name = "chkSpectraInfo"
        Me.chkSpectraInfo.Size = New System.Drawing.Size(109, 16)
        Me.chkSpectraInfo.TabIndex = 19
        Me.chkSpectraInfo.Text = "Include"
        '
        'lblExportTargetSettingsSummary
        '
        Me.lblExportTargetSettingsSummary.AutoSize = True
        Me.lblExportTargetSettingsSummary.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblExportTargetSettingsSummary.Location = New System.Drawing.Point(109, 40)
        Me.lblExportTargetSettingsSummary.Name = "lblExportTargetSettingsSummary"
        Me.lblExportTargetSettingsSummary.Size = New System.Drawing.Size(21, 13)
        Me.lblExportTargetSettingsSummary.TabIndex = 103
        Me.lblExportTargetSettingsSummary.Text = "<>"
        '
        'btnExportTarget
        '
        Me.btnExportTarget.Location = New System.Drawing.Point(24, 35)
        Me.btnExportTarget.Name = "btnExportTarget"
        Me.btnExportTarget.Size = New System.Drawing.Size(79, 23)
        Me.btnExportTarget.TabIndex = 11
        Me.btnExportTarget.Text = "Target"
        '
        'frmExportFilters
        '
        Me.AcceptButton = Me.btnOK
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.CancelButton = Me.btnCancel
        Me.ClientSize = New System.Drawing.Size(271, 412)
        Me.Controls.Add(Me.btnExportTarget)
        Me.Controls.Add(Me.lblExportTargetSettingsSummary)
        Me.Controls.Add(Me.GroupBox3)
        Me.Controls.Add(Me.lblProteinSubsetText)
        Me.Controls.Add(Me.btnCancel)
        Me.Controls.Add(Me.btnOK)
        Me.Controls.Add(Me.GroupBox1)
        Me.Controls.Add(Me.GroupBox2)
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.Name = "frmExportFilters"
        Me.Text = "Proteins and peptides filter"
        Me.GroupBox1.ResumeLayout(False)
        Me.GroupBox2.ResumeLayout(False)
        Me.GroupBox3.ResumeLayout(False)
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub

#End Region


    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Private Sub Init( _
      ByVal aInProteinAndPeptidesFilter2 As proteinAndPeptidesFilterStructure2, _
      ByVal anExtraText As String, _
      ByRef anApp As quantApplication, _
      ByVal aPeptideFilter As peptideFilterStructure, _
      ByRef anInRawFiles() As fileSpecStructure, _
      ByRef aSILACmods As Dictionary(Of Integer, Integer) _
      )

        'Old parameter (in second place):
        '  ByRef aParentForm As frmProteinList, _


        'Note: the peptide filter is embedded within the first parameters...

        'aSelectedProteins is for displaying in the dialog to the user - 
        'so it is more evident that export works on the selection (of proteins).

        'Changed PM_SPECTRAEXPORT_GENERALISED 2008-05-05
        'mParentForm = aParentForm

        mProteinAndPeptidesFilter2 = aInProteinAndPeptidesFilter2

        'Changed PM_PEPTIDEFILTER_GENERALISED 2007-08-27
        mApplication = anApp

        'Changed PM_CANCEL_ALSO_SAVES_PEPTFILT_BUG 2007-09-06
        'mOptions = aOptions
        mPeptideFilter = aPeptideFilter.deepCopy2()

        'Changed PM_RAWFILE_PEPFILTER 2007-11-17
        mRawFiles = anInRawFiles

        'Changed PM_SILAC_AWARE_PEPTIDEFILTERDIALOG 2008-10-05
        mSILACmods = aSILACmods


        'Changed PM_DISPLAY_NUMBER_SELECTED 2006-12-30
        lblProteinSubsetText.Text = anExtraText

        If True Then 'Settings user changable values
            'Proteins
            chkProteinsInfo.Checked = _
              mProteinAndPeptidesFilter2.includeProteinInformation3

            'Peptides
            chkIncludePeptides.Checked = _
              aInProteinAndPeptidesFilter2.includePeptides

            'Changed PM_SPECTRAEXPORT_GENERALISED 2008-05-05
            'Spectra (several for each quantified peptide)
            chkSpectraInfo.Checked = _
              aInProteinAndPeptidesFilter2.includeSpectra
        End If

        'Changed PM_PEPTIDEFILTER_GENERALISED 2007-08-28
        updatePeptideFilterSummary2(aPeptideFilter)

        'Changed PM_PEPTIDEFILTER_GENERALISED 2007-08-29
        updatePeptideEnabledStates(aInProteinAndPeptidesFilter2.includePeptides)

        'Changed PM_PEPTIDEFILTER_GENERALISED 2007-08-27. Now in peptide filter.
        'Delete at any time.
        'chkPeptidesQuantified.Checked = _
        '  mProteinAndPeptidesFilter.includeQuantifiedPeptides
        'chkPeptidesVerified.Checked = _
        '  mProteinAndPeptidesFilter.includeVerifiedPeptides

        updateExportTargetSummary( _
          aInProteinAndPeptidesFilter2.exportTargetSettings4)
    End Sub 'Init()


    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Private Sub updatePeptideEnabledStates(ByVal anIncludePeptides As Boolean)

        btnPeptideFilter.Enabled = anIncludePeptides
        lblPeptideFilterSummary.Enabled = anIncludePeptides
    End Sub 'updatePeptideEnabledStates


    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Private Sub btnOK_Click( _
      ByVal aSender As System.Object, ByVal anEvent As System.EventArgs) _
      Handles btnOK.Click

        'No validation for now....
        Try
            mProteinAndPeptidesFilter2.includeProteinInformation3 = _
              chkProteinsInfo.Checked

            mProteinAndPeptidesFilter2.includePeptides = _
              chkIncludePeptides.Checked

            'Changed PM_SPECTRAEXPORT_GENERALISED 2008-05-05
            mProteinAndPeptidesFilter2.includeSpectra = chkSpectraInfo.Checked

            'Changed PM_BROKENEXPORT 2008-05-28
            'Note: the export target parameters are stored directly
            '      in mProteinAndPeptidesFilter2 when this dialog
            '      handles the dismiss event from the sub-dialog.

            Dim newValues As exportFilterValuesStructure
            newValues.proteinAndPeptidesFilter = mProteinAndPeptidesFilter2
            newValues.peptideFilter = mPeptideFilter
            RaiseEvent exportFilterDismissed( _
              aSender, New exportFilterEventArgs(newValues))

        Catch exceptionObject As Exception
            AppCommon2.displayStandardExceptionInfo( _
              exceptionObject, _
              "Could not read values dialog in dialog. " & _
              "Some numeric fields may hold letters, etc.")
            Exit Sub
        End Try

        Me.Close()
    End Sub 'btnOK_Click


    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Private Sub btnCancel_Click( _
      ByVal aSender As System.Object, ByVal anEvent As System.EventArgs) _
      Handles btnCancel.Click

        Me.Close()
    End Sub 'btnCancel_Click


    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Private Sub btnPeptideFilter_Click( _
      ByVal aSender As System.Object, ByVal anEvent As System.EventArgs) _
      Handles btnPeptideFilter.Click

        'Note: implicitly we are using global settings for the export filter.
        '      Is that what we want?

        Dim key As peptideFilterEnum = peptideFilterEnum.enumExport2
        Dim programDefaults As peptideFilterStructure = _
          quantApplication.defaultPeptideFilters2()(key)

        'Second parameter: for call-back - when OK is pressed...
        mFilterForm = New frmPeptideFilters( _
          mPeptideFilter, mApplication, True, True, programDefaults, _
          "export", _
          mRawFiles, _
          mSILACmods)
        mFilterForm.Show()
    End Sub 'btnPeptideFilter_Click


    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Public Sub updatePeptideFilterSummary2( _
      ByVal anInPeptideFilterSpecification As peptideFilterStructure)

        Dim summaryStr As String = _
          someStatic.pepFilterShortSummary( _
            anInPeptideFilterSpecification, mApplication)
        lblPeptideFilterSummary.Text = summaryStr
    End Sub 'updatePeptideFilterSummary


    'From sub-dialog, peptide filter.
    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Private Sub mFilterForm_dialogDismissed2( _
      ByVal aSender As Object, _
      ByVal anEvent As pepFilterEventArgs) _
      Handles mFilterForm.pepFilterDismissed

        mPeptideFilter = anEvent.getFilter()
        updatePeptideFilterSummary2(mPeptideFilter)
    End Sub 'mFilterForm_dialogDismissed2


    'Changed PM_PEPTIDEFILTER_GENERALISED 2007-08-29
    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Private Sub chkIncludePeptides_CheckedChanged( _
      ByVal aSender As System.Object, _
      ByVal anEvent As System.EventArgs) _
      Handles chkIncludePeptides.CheckedChanged

        'Value should also be somewhere in "anEvent"...
        Dim newValue As Boolean = chkIncludePeptides.Checked

        updatePeptideEnabledStates(newValue)
    End Sub 'chkIncludePeptides_CheckedChanged()


    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Private Sub btnExportTarget_Click( _
      ByVal aSender As System.Object, ByVal anEvent As System.EventArgs) _
      Handles btnExportTarget.Click

        'Note: implicitly we are using global settings for the target.
        '      Is that what we want?

        'Dim programDefaults As peptideFilterStructure = _
        '  quantApplication.defaultPeptideFilters2()(key)

        'Client must have checked it/set it...
        Trace.Assert( _
          mProteinAndPeptidesFilter2.exportTargetSettings4.target <> _
          targetEnum.enumExportUndefined, _
          "PIL ASSERT. <message>.")

        'Second parameter: for call-back - when OK is pressed...
        mExportTargetForm = _
          New frmExportTarget(mProteinAndPeptidesFilter2.exportTargetSettings4)
        mExportTargetForm.Show()
    End Sub 'btnExportTarget_Click()


    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Public Sub updateExportTargetSummary( _
      ByVal anInExportTargetSettings As exportTargetSettingsStruct)

        Dim summaryStr As String = _
          exportTargetSettingsStruct.exportTargetSettingsShortSummary( _
            anInExportTargetSettings)
        lblExportTargetSettingsSummary.Text = summaryStr
    End Sub 'updatePeptideFilterSummary()


    'Changed PM_BROKENEXPORT 2008-05-28
    'From sub-dialog, peptide filter.
    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Private Sub mExportTargetForm_dialogDismissed( _
      ByVal aSender As Object, _
      ByVal anEvent As exportTargetSettingsEventArgs) _
      Handles mExportTargetForm.exportTargetSettingsDismissed

        mProteinAndPeptidesFilter2.exportTargetSettings4 = anEvent.getFilter()
        updateExportTargetSummary( _
          mProteinAndPeptidesFilter2.exportTargetSettings4)
    End Sub 'mExportTargetForm_dialogDismissed()


End Class 'class frmExportFilters


'Helper class for exportFilterDismissed event.
'****************************************************************************
'*    <placeholder for header>                                              *
'****************************************************************************
Public Class exportFilterEventArgs
    Inherits System.EventArgs

    Private mExportFilterValues As exportFilterValuesStructure

    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Public Sub New(ByVal aSomeValue As exportFilterValuesStructure)
        mExportFilterValues = aSomeValue
    End Sub 'Constructor.


    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Public Function getFilter() _
      As exportFilterValuesStructure

        Return mExportFilterValues 'What about deep copy???
    End Function 'getFilter


End Class 'pepFilterDismissedEventArgs


    

    

Generated by script codePublish.pl at 2009-01-05T15:20:59.