Beispiel #1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// For some reason, this is safer to do in a Disposed delegate than in an override
        /// of the Dispose method. Putting this in an override of Dispose sometimes throws
        /// a "Parameter is not valid" exception.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        void SearchResultView_Disposed(object sender, EventArgs e)
        {
            Disposed -= SearchResultView_Disposed;

            if (_grid != null)
            {
                _grid.Dispose();
                _grid = null;
            }

            if (_errorControl != null)
            {
                _errorControl.Dispose();
                _errorControl = null;
            }
        }
Beispiel #2
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        ///
        /// </summary>
        /// ------------------------------------------------------------------------------------
        protected bool OnCAESort(object args)
        {
            if (m_view.ResultViewManger == null || m_view.ResultViewManger.CurrentViewsGrid == null)
            {
                return(true);
            }

            PaWordListGrid grid = m_view.ResultViewManger.CurrentViewsGrid;

            if (grid.IsGroupedByField)
            {
                grid.GroupByField = null;
            }

            return(true);
        }
Beispiel #3
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        ///
        /// </summary>
        /// ------------------------------------------------------------------------------------
        protected bool OnAfterWordListGroupedByField(object args)
        {
            try
            {
                PaWordListGrid grid = args as PaWordListGrid;

                if (grid != null && !m_grids.Contains(grid) &&
                    grid.Cache != null && grid.Cache.IsForSearchResults)
                {
                    m_grids.Add(grid);
                    m_numPhonesBefore[grid]      = WordListGroupingBuilder.NumberOfBeforePhonesToMatch;
                    m_numPhonesAfter[grid]       = WordListGroupingBuilder.NumberOfAfterPhonesToMatch;
                    grid.HandleDestroyed        += grid_HandleDestroyed;
                    grid.ColumnHeaderMouseClick += grid_ColumnHeaderMouseClick;
                    OnWordListGridSorted(grid);
                }
            }
            catch { }

            return(false);
        }
Beispiel #4
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// RtfExportDlg constructor.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public RtfExportDlg(PaWordListGrid grid)
        {
            InitializeComponent();

            m_grid = grid;
            SetUiFonts();

            rbToFile.Tag      = RtfCreator.ExportTarget.File;
            rbToFileOpen.Tag  = RtfCreator.ExportTarget.FileAndOpen;
            rbToClipboard.Tag = RtfCreator.ExportTarget.Clipboard;
            rbFmtTable.Tag    = RtfCreator.ExportFormat.Table;
            rbFmtTabDelim.Tag = RtfCreator.ExportFormat.TabDelimited;

            // Load saved window settings
            m_rtfEditor           = Properties.Settings.Default.RTFExportOptionRTFEditor;
            rbToFile.Checked      = Properties.Settings.Default.RTFExportOptionToFile;
            rbToFileOpen.Checked  = Properties.Settings.Default.RTFExportOptionToFileAndOpen;
            rbToClipboard.Checked = Properties.Settings.Default.RTFExportOptionToClipboard;
            rbFmtTable.Checked    = Properties.Settings.Default.RTFExportOptionToTable;
            rbFmtTabDelim.Checked = Properties.Settings.Default.RTFExportOptionTabDelimited;

            App.InitializeForm(this, Properties.Settings.Default.RTFExportDlg);
        }
Beispiel #5
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Initializes a wordEntry list grid with the specified cache and adds it to the form.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public void Initialize(WordListCache cache)
        {
            m_cache = cache;

            if (WordListGrid != null)
            {
                WordListGrid.Cache = m_cache;
            }
            else
            {
                WordListGrid                       = new PaWordListGrid(cache, GetType(), false);
                WordListGrid.BorderStyle           = BorderStyle.None;
                WordListGrid.RowHeadersBorderStyle = DataGridViewHeaderBorderStyle.None;
                WordListGrid.TMAdapter             = m_tmAdapter;

                // Even thought the grid is docked, setting it's size here prevents the user
                // from seeing that split second during which time the grid goes from it's
                // small, default size to its docked size.
                WordListGrid.Size = new Size(splitOuter.Panel1.Width, splitOuter.Panel1.Height);

                WordListGrid.Name = Name + "Grid";
                WordListGrid.LoadSettings();
                WordListGrid.RowEnter += m_grid_RowEnter;
                WordListGrid.Visible   = false;
                pnlGrid.Controls.Add(WordListGrid);
                WordListGrid.Visible  = true;
                WordListGrid.TabIndex = 0;
                WordListGrid.Focus();
                WordListGrid.SortOptions           = Project.DataCorpusVwSortOptions;
                WordListGrid.IsCurrentPlaybackGrid = true;
                WordListGrid.UseWaitCursor         = false;
                WordListGrid.Cursor = Cursors.Default;
            }

            // This will enforce an update of the record pane.
            _recView.UpdateRecord(WordListGrid.GetRecord(), true);
        }
Beispiel #6
0
        /// ------------------------------------------------------------------------------------
        public FindDlg(PaWordListGrid grid)
        {
            Debug.Assert(grid != null);
            m_grid = grid;

            InitializeComponent();

            Properties.Settings.Default.FindDlg = App.InitializeForm(this, Properties.Settings.Default.FindDlg);
            SetUiFonts();

            var fieldsInList = from field in App.Project.Fields
                               where field.VisibleInGrid && field.DisplayIndexInGrid >= 0 && m_grid.Columns[field.Name] != null
                               orderby field.DisplayIndexInGrid
                               select field;

            if (s_checkedFields == null)
            {
                s_checkedFields = fieldsInList.Select(f => f.Name).ToList();
            }

            fldSelGridSrchCols.Load(fieldsInList.Select(f =>
                                                        new KeyValuePair <PaField, bool>(f, s_checkedFields.Contains(f.Name))));

            // Load the cbFindWhat comboBox with past searches
            foreach (string searchPattern in s_findWhatItems)
            {
                cboFindWhat.Items.Add(searchPattern);
            }

            LoadSettings();
            btnFind.Enabled = (fldSelGridSrchCols.CheckedItemCount > 0);
            chkSrchCollapsedGrps.Enabled = (grid.IsGroupedByField || grid.Cache.IsMinimalPair || grid.Cache.IsSimilarEnvironment);

            // Will prevent opening more than one FindDlg instance.
            FindInfo.FindDlgIsOpen = true;
        }
 /// ------------------------------------------------------------------------------------
 public static new bool ToWordXml(PaProject project, string outputFileName,
                                  PaWordListGrid grid, bool openAfterExport)
 {
     return(Process(project, outputFileName, OutputFormat.WordXml, grid, openAfterExport,
                    Properties.Settings.Default.AppThatOpensWordXml, Pipeline.ProcessType.ExportToWord));
 }