// -------------------------------------------------------------------- // イベントハンドラー // -------------------------------------------------------------------- private void TextBoxTargetExt_TextChanged(Object oSender, EventArgs oEventArgs) { try { UpdateButtonAddExt(); } catch (Exception oExcep) { NklCommon.ShowLogMessage(TraceEventType.Error, "拡張子入力時エラー:\n" + oExcep.Message); NklCommon.ShowLogMessage(TraceEventType.Verbose, " スタックトレース:\n" + oExcep.StackTrace); } }
// -------------------------------------------------------------------- // イベントハンドラー // -------------------------------------------------------------------- private void ListBoxTargetExts_SelectedIndexChanged(Object oSender, EventArgs oEventArgs) { try { UpdateButtonRemoveExt(); } catch (Exception oExcep) { NklCommon.ShowLogMessage(TraceEventType.Error, "拡張子選択時エラー:\n" + oExcep.Message); NklCommon.ShowLogMessage(TraceEventType.Verbose, " スタックトレース:\n" + oExcep.StackTrace); } }
// -------------------------------------------------------------------- // イベントハンドラー // -------------------------------------------------------------------- private void ButtonAddExt_Click(Object oSender, EventArgs oEventArgs) { try { AddExt(); } catch (Exception oExcep) { NklCommon.ShowLogMessage(TraceEventType.Error, "拡張子追加ボタンクリック時エラー:\n" + oExcep.Message); NklCommon.ShowLogMessage(TraceEventType.Verbose, " スタックトレース:\n" + oExcep.StackTrace); } }
// -------------------------------------------------------------------- // イベントハンドラー // -------------------------------------------------------------------- private void ListBoxAddedItems_SelectedIndexChanged(Object oSender, EventArgs oEventArgs) { try { UpdateOutputItemButtons(); } catch (Exception oExcep) { NklCommon.ShowLogMessage(TraceEventType.Error, "追加項目リスト選択時エラー:\n" + oExcep.Message); NklCommon.ShowLogMessage(TraceEventType.Verbose, " スタックトレース:\n" + oExcep.StackTrace); } }
// -------------------------------------------------------------------- // イベントハンドラー // -------------------------------------------------------------------- private void CheckBoxEnableNew_CheckedChanged(Object oSender, EventArgs oEventArgs) { try { UpdateTextBoxNewDays(); } catch (Exception oExcep) { NklCommon.ShowLogMessage(TraceEventType.Error, "新着チェックボックスクリック時エラー:\n" + oExcep.Message); NklCommon.ShowLogMessage(TraceEventType.Verbose, " スタックトレース:\n" + oExcep.StackTrace); } }
// -------------------------------------------------------------------- // イベントハンドラー // -------------------------------------------------------------------- private void RadioButtonOutputItems_CheckedChanged(Object oSender, EventArgs oEventArgs) { try { UpdateOutputItemListBoxes(); UpdateButtonAddItem(); UpdateOutputItemButtons(); } catch (Exception oExcep) { NklCommon.ShowLogMessage(TraceEventType.Error, "出力項目タイプ選択時エラー:\n" + oExcep.Message); NklCommon.ShowLogMessage(TraceEventType.Verbose, " スタックトレース:\n" + oExcep.StackTrace); } }
// -------------------------------------------------------------------- // イベントハンドラー // -------------------------------------------------------------------- private void ButtonRemoveExt_Click(Object oSender, EventArgs oEventArgs) { try { // 選択されていない場合はボタンが押されないはずだが念のため if (ListBoxTargetExts.SelectedIndex < 0) { throw new Exception("削除したい拡張子を選択してください。"); } // 削除 ListBoxTargetExts.Items.RemoveAt(ListBoxTargetExts.SelectedIndex); } catch (Exception oExcep) { NklCommon.ShowLogMessage(TraceEventType.Error, "拡張子削除ボタンクリック時エラー:\n" + oExcep.Message); NklCommon.ShowLogMessage(TraceEventType.Verbose, " スタックトレース:\n" + oExcep.StackTrace); } }
// -------------------------------------------------------------------- // イベントハンドラー // -------------------------------------------------------------------- private void ButtonUpItem_Click(Object oSender, EventArgs oEventArgs) { try { Int32 aOrgIndex = ListBoxAddedItems.SelectedIndex; if (aOrgIndex <= 0) { return; } String aItem = (String)ListBoxAddedItems.Items[aOrgIndex]; ListBoxAddedItems.Items.RemoveAt(aOrgIndex); ListBoxAddedItems.Items.Insert(aOrgIndex - 1, aItem); ListBoxAddedItems.SelectedIndex = aOrgIndex - 1; } catch (Exception oExcep) { NklCommon.ShowLogMessage(TraceEventType.Error, "上へボタンクリック時エラー:\n" + oExcep.Message); NklCommon.ShowLogMessage(TraceEventType.Verbose, " スタックトレース:\n" + oExcep.StackTrace); } }
// -------------------------------------------------------------------- // イベントハンドラー // -------------------------------------------------------------------- private void ButtonRemoveItem_Click(Object oSender, EventArgs oEventArgs) { try { Int32 aRemoveItem = Array.IndexOf(NklCommon.OUTPUT_ITEM_NAMES, (String)ListBoxAddedItems.Items[ListBoxAddedItems.SelectedIndex]); if (aRemoveItem < 0) { return; } ListBoxAddedItems.Items.RemoveAt(ListBoxAddedItems.SelectedIndex); ListBoxRemovedItems.Items.Add(NklCommon.OUTPUT_ITEM_NAMES[aRemoveItem]); ListBoxRemovedItems.SelectedIndex = ListBoxRemovedItems.Items.Count - 1; } catch (Exception oExcep) { NklCommon.ShowLogMessage(TraceEventType.Error, "項目削除ボタンクリック時エラー:\n" + oExcep.Message); NklCommon.ShowLogMessage(TraceEventType.Verbose, " スタックトレース:\n" + oExcep.StackTrace); } }
// ==================================================================== // public メンバー関数 // ==================================================================== // -------------------------------------------------------------------- // リスト出力 // -------------------------------------------------------------------- public override void Output() { base.Output(); // ゆかり検索用データベース作成 NklCommon.ShowLogMessage(Common.TRACE_EVENT_TYPE_STATUS, "ゆかり検索用データベース作成中..."); using (SQLiteConnection aConnection = NklCommon.CreateDbConnection(YukariDbPath())) { NklCommon.CreateFoundDbTables(aConnection); using (DataContext aContext = new DataContext(aConnection)) { Table <TFound> aTable = aContext.GetTable <TFound>(); IQueryable <TFound> aQueryResult = from x in TableFound select x; aTable.InsertAllOnSubmit(aQueryResult); aContext.SubmitChanges(); } } }