Files
Unimarc/unimarc/unimarc/마크/Marc_memo.cs
SeungHo Yang 3e2b676aa2 =====* UniMarc [0.0124] 버전 업데이트 내용 *=====
1. 목록등록
ㄴ> 등록이나 삭제할 경우 오류메시지 표출되는 버그 수정.

2. 마크 정리
ㄴ> 드래그 앤 드랍으로 행이동 하는 함수 추가 (현재 활용면에서 의견 논의 필요하므로 사용은 중단)
  ㄴ> 활성화 방법 - dataGridView1의 AllowDrop을 True로 변경.

3. 마크 작성
ㄴ> Ctrl+H 오류나는 버그 수정.
ㄴ> 최신 마크 표출되지 않는 버그 수정.
2022-02-11 10:57:20 +09:00

117 lines
3.0 KiB
C#

using ExcelTest;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace UniMarc.
{
public partial class Marc_memo : Form
{
Marc marc;
public Marc_memo(Marc _marc)
{
InitializeComponent();
marc = _marc;
}
private void Marc_memo_Load(object sender, EventArgs e)
{
string[] com_List =
{
"하나막", "코리스"
};
cb_List.Items.AddRange(com_List);
}
private void btn_ReturnMarc_Click(object sender, EventArgs e)
{
string text = richTextBox1.Text;
string result = "";
int idx = cb_List.SelectedIndex;
if (idx < 0)
return;
try
{
switch (idx)
{
case 0:
result = Hana(text);
break;
case 1:
result = Kolis(text) + "\n";
break;
default:
break;
}
}
catch { }
richTextBox1.Text = "";
marc.richTextBox1.Text = result.Replace("↔", "");
}
#region
string Hana(string text)
{
string[] arr = text.Split('\n');
for (int a = 0; a < arr.Length - 1; a++)
{
arr[a] = arr[a].Insert(5, "\t");
arr[a] = arr[a].Insert(3, "\t");
}
return string.Join("▲\n", arr);
}
string Kolis(string text)
{
string[] arr = text.Split('\n');
for (int a = 0; a < arr.Length; a++)
{
string[] tag = arr[a].Split('\t');
if (arr[a] == "") break;
if (tag[1].Length == 0)
tag[1] = " ";
else if (tag[1].Length == 1)
tag[1] += " ";
arr[a] = string.Join("\t", tag);
}
return string.Join("\n", arr);
}
#endregion
private void richTextBox1_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control)
{
switch (e.KeyValue)
{
case 72: // h
findNchange fnc = new findNchange(this);
fnc.TopMost = true;
fnc.Show();
break;
default:
break;
}
}
if (e.KeyCode == Keys.Escape)
{
this.Close();
}
}
private void btn_Close_Click(object sender, EventArgs e)
{
this.Close();
}
}
}