Example #1
0
        /// <summary>
        /// This method will initiate a custom user selection by showing the export
        /// selection dialog, then parse the selections and return the sequence object.
        /// This method is for any sequence data other than BED.
        /// </summary>
        /// <param name="callbackAfterComplete">
        /// Method to call after the selection and parsing process is complete.
        /// </param>
        /// <param name="argsForCallback">Callback arguments</param>
        public void GetSequencesForExport(
            SequenceSelectionComplete callbackAfterComplete,
            params object[] argsForCallback)
        {
            this.inputSequenceSelectionComplete = callbackAfterComplete;
            this.argsForCallback = argsForCallback;

            Globals.ThisAddIn.Application.Cursor = XlMousePointer.xlWait;
            ExportSelectionDialog selectionDialog = new ExportSelectionDialog(ShowSelectionHelper, maxSeqCount);

            selectionDialog.Activated            += new EventHandler(OnWPFWindowActivated);
            selectionDialog.IsSequenceNameVisible = true;

            if (argsForCallback[0] is Bio.IO.FastA.FastAFormatter)
            {
                selectionDialog.IsMetadataVisible = false;
            }
            else if (argsForCallback[0] is Bio.IO.FastQ.FastQFormatter)
            {
                selectionDialog.IsQualityScoresVisible = true;
            }
            else
            {
                selectionDialog.IsMetadataVisible = true;
            }

            selectionDialog.Initialize();

            selectionDialog.SelectedItem.SequenceAddress = GetRangeAddress(Globals.ThisAddIn.Application.Selection);
            System.Windows.Interop.WindowInteropHelper helper = new System.Windows.Interop.WindowInteropHelper(selectionDialog);
            helper.Owner = (IntPtr)Globals.ThisAddIn.Application.Hwnd;
            selectionDialog.InputSelectionDialogSubmitting += new SequenceSelectionDialogSubmit(OnExportSequenceDialogSubmit);
            selectionDialog.ShowDialog(); // this call will exit when selection window is shown as this dialog will be hidden.
        }
Example #2
0
        /// <summary>
        /// This method will initiate a custom user selection by showing the input
        /// selection dialog, then parse the selections and return the sequence object.
        /// This method is for any sequence data other than BED.
        /// </summary>
        /// <param name="callbackAfterComplete">
        /// Method to call after the selection and parsing process is complete.
        /// </param>
        /// <param name="intersectOperation">Is this an Intersect Operation</param>
        /// <param name="argsForCallback">Callback arguments</param>
        public void GetInputSequences(
            SequenceSelectionComplete callbackAfterComplete,
            bool intersectOperation,
            params object[] argsForCallback)
        {
            this.PromptForSequenceName          = true;
            this.inputSequenceSelectionComplete = callbackAfterComplete;
            this.argsForCallback = argsForCallback;

            Globals.ThisAddIn.Application.Cursor = XlMousePointer.xlWait;
            InputSelectionDialog selectionDialog = new InputSelectionDialog(
                ShowSelectionHelper,
                minSeqCount,
                maxSeqCount,
                intersectOperation,
                false,
                false,
                SequenceLabels);

            selectionDialog.Activated            += new EventHandler(OnWPFWindowActivated);
            selectionDialog.IsSequenceNameVisible = this.PromptForSequenceName;
            selectionDialog.Initialize();
            selectionDialog.SelectedItem.SequenceAddress = GetRangeAddress(Globals.ThisAddIn.Application.Selection);
            System.Windows.Interop.WindowInteropHelper helper = new System.Windows.Interop.WindowInteropHelper(selectionDialog);
            helper.Owner = (IntPtr)Globals.ThisAddIn.Application.Hwnd;
            selectionDialog.InputSelectionDialogSubmitting += new SequenceSelectionDialogSubmit(OnInputSequenceDialogSubmit);
            selectionDialog.ShowDialog(); // this call will exit when selection window is shown as this dialog will be hidden.
        }
Example #3
0
        /// <summary>
        /// This method will initiate a custom user selection by showing the export 
        /// selection dialog, then parse the selections and return the sequence object.
        /// This method is for any sequence data other than BED.
        /// </summary>
        /// <param name="callbackAfterComplete">
        /// Method to call after the selection and parsing process is complete.
        /// </param>
        /// <param name="argsForCallback">Callback arguments</param>
        public void GetSequencesForExport(
                SequenceSelectionComplete callbackAfterComplete,
                params object[] argsForCallback)
        {
            this.inputSequenceSelectionComplete = callbackAfterComplete;
            this.argsForCallback = argsForCallback;

            Globals.ThisAddIn.Application.Cursor = XlMousePointer.xlWait;
            ExportSelectionDialog selectionDialog = new ExportSelectionDialog(ShowSelectionHelper, maxSeqCount);
            selectionDialog.Activated += new EventHandler(OnWPFWindowActivated);
            selectionDialog.IsSequenceNameVisible = true;

            if (argsForCallback[0] is Bio.IO.FastA.FastAFormatter)
            {
                selectionDialog.IsMetadataVisible = false;
            }
            else if (argsForCallback[0] is Bio.IO.FastQ.FastQFormatter)
            {
                selectionDialog.IsQualityScoresVisible = true;
            }
            else
            {
                selectionDialog.IsMetadataVisible = true;
            }

            selectionDialog.Initialize();

            selectionDialog.SelectedItem.SequenceAddress = GetRangeAddress(Globals.ThisAddIn.Application.Selection);
            System.Windows.Interop.WindowInteropHelper helper = new System.Windows.Interop.WindowInteropHelper(selectionDialog);
            helper.Owner = (IntPtr)Globals.ThisAddIn.Application.Hwnd;
            selectionDialog.InputSelectionDialogSubmitting += new SequenceSelectionDialogSubmit(OnExportSequenceDialogSubmit);
            selectionDialog.ShowDialog(); // this call will exit when selection window is shown as this dialog will be hidden.
        }
Example #4
0
        /// <summary>
        /// This method will initiate a custom user selection by showing the input 
        /// selection dialog, then parse the selections and return the sequence object.
        /// This method is for any sequence data other than BED.
        /// </summary>
        /// <param name="callbackAfterComplete">
        /// Method to call after the selection and parsing process is complete.
        /// </param>
        /// <param name="intersectOperation">Is this an Intersect Operation</param>
        /// <param name="argsForCallback">Callback arguments</param>
        public void GetInputSequences(
                SequenceSelectionComplete callbackAfterComplete,
                bool intersectOperation,
                params object[] argsForCallback)
        {
            this.PromptForSequenceName = true;
            this.inputSequenceSelectionComplete = callbackAfterComplete;
            this.argsForCallback = argsForCallback;

            Globals.ThisAddIn.Application.Cursor = XlMousePointer.xlWait;
            InputSelectionDialog selectionDialog = new InputSelectionDialog(
                    ShowSelectionHelper,
                    minSeqCount,
                    maxSeqCount,
                    intersectOperation,
                    false,
                    false,
                    SequenceLabels);
            selectionDialog.Activated += new EventHandler(OnWPFWindowActivated);
            selectionDialog.IsSequenceNameVisible = this.PromptForSequenceName;
            selectionDialog.Initialize();
            selectionDialog.SelectedItem.SequenceAddress = GetRangeAddress(Globals.ThisAddIn.Application.Selection);
            System.Windows.Interop.WindowInteropHelper helper = new System.Windows.Interop.WindowInteropHelper(selectionDialog);
            helper.Owner = (IntPtr)Globals.ThisAddIn.Application.Hwnd;
            selectionDialog.InputSelectionDialogSubmitting += new SequenceSelectionDialogSubmit(OnInputSequenceDialogSubmit);
            selectionDialog.ShowDialog(); // this call will exit when selection window is shown as this dialog will be hidden.
        }