Ejemplo n.º 1
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 particularly for BED files.
        /// </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="isOverlappingIntervalVisible">Is Overlapping interval visible</param>
        /// <param name="isMinimumOverlapVisible">Is Minimum overlap visible</param>
        /// <param name="argsForCallback">Callback arguments</param>
        public void GetInputSequenceRanges(
            InputSequenceRangeSelectionComplete callbackAfterComplete,
            bool intersectOperation,
            bool isOverlappingIntervalVisible,
            bool isMinimumOverlapVisible,
            params object[] argsForCallback)
        {
            inputSequenceRangeSelectionComplete = callbackAfterComplete;
            this.argsForCallback = argsForCallback;

            Globals.ThisAddIn.Application.Cursor = XlMousePointer.xlWait;
            InputSelectionDialog dialog = new InputSelectionDialog(
                ShowSelectionHelper,
                minSeqCount,
                maxSeqCount,
                intersectOperation,
                isOverlappingIntervalVisible,
                isMinimumOverlapVisible,
                SequenceLabels);

            dialog.IsSequenceRangeSelection = true;
            dialog.IsSequenceNameVisible    = this.PromptForSequenceName;
            dialog.Activated += new EventHandler(OnWPFWindowActivated);
            dialog.Initialize();
            dialog.SelectedItem.SequenceAddress = GetRangeAddress(Globals.ThisAddIn.Application.Selection);
            System.Windows.Interop.WindowInteropHelper helper = new System.Windows.Interop.WindowInteropHelper(dialog);
            helper.Owner = (IntPtr)Globals.ThisAddIn.Application.Hwnd;
            dialog.InputSelectionDialogSubmitting += new SequenceSelectionDialogSubmit(OnInputSequenceRangeDialogSubmit);
            dialog.ShowDialog(); // this call will exit when selection window is shown as this dialog will be hidden.
        }
Ejemplo n.º 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 particularly for BED files.
        /// </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="isOverlappingIntervalVisible">Is Overlapping interval visible</param>
        /// <param name="isMinimumOverlapVisible">Is Minimum overlap visible</param>
        /// <param name="argsForCallback">Callback arguments</param>
        public void GetInputSequenceRanges(
                InputSequenceRangeSelectionComplete callbackAfterComplete,
                bool intersectOperation,
                bool isOverlappingIntervalVisible,
                bool isMinimumOverlapVisible,
                params object[] argsForCallback)
        {
            inputSequenceRangeSelectionComplete = callbackAfterComplete;
            this.argsForCallback = argsForCallback;

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