Exemple #1
0
            public void GetFileBody(string filePath)
            {
                OwnerForm.InvokeOnUIThread((f) =>
                {
                    App.ExecuteInExceptionCatcher(() =>
                    {
                        // ファイル本文の抽出
                        var textExtNames   = App.GetTextExtNames();
                        var pluginExtNames = App.GetPluginExtNames();
                        var extRes         = App.ExtractFile(filePath, textExtNames, pluginExtNames);

                        var dialog = new FileBodyViewDialog
                        {
                            Body = extRes.Body
                        };
                        dialog.ShowDialog(f);
                    });
                });
            }
        /// <summary>
        /// リストダブルクリック時
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void LstFile_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (LstFile.SelectedItems.Count >= 1)
            {
                var item        = LstFile.SelectedItems[0];
                var documentKey = (string)item.Tag;

                var res = Application.GM.Select(
                    table: Table.Documents
                    , outputColumns: new[] { Column.Documents.KEY, Column.Documents.BODY }
                    , query: string.Format("{0}:{1}", Column.Documents.KEY, Groonga.Util.EscapeForQuery(documentKey))
                    );

                var body = res.SearchResult.Records[0].GetTextValue(Column.Documents.BODY);
                var f    = new FileBodyViewDialog
                {
                    Body = body
                };
                f.ShowDialog(this);
            }
        }