using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Windows.Forms;
|
|
namespace Yw.WinFrmUI.Phart
|
{
|
/// <summary>
|
/// 曲线UI剪切板辅助类
|
/// </summary>
|
public class ClipboardCurveTextUIHelper
|
{
|
/// <summary>
|
/// 复制字符串
|
/// </summary>
|
/// <param name="list"></param>
|
/// <returns></returns>
|
public static bool CopyString(out List<List<string>> list)
|
{
|
var dlg = new ClipboardCurveTextSelDlg();
|
if (dlg.ShowDialog() == DialogResult.OK)
|
{
|
if (dlg.Separator == ClipboardCurveTextSelDlg.eSeparator.单元)
|
{
|
if (dlg.Direction == ClipboardCurveTextSelDlg.eDirection.横向)
|
{
|
list = ClipboardCurveTextHelper.GetRowTextList("\t");
|
}
|
else
|
{
|
list = ClipboardCurveTextHelper.GetColTextList("\t");
|
}
|
}
|
else
|
{
|
if (dlg.Direction == ClipboardCurveTextSelDlg.eDirection.横向)
|
{
|
list = ClipboardCurveTextHelper.GetRowTextList(",");
|
}
|
else
|
{
|
list = ClipboardCurveTextHelper.GetColTextList(",");
|
}
|
}
|
return true;
|
}
|
list = null;
|
return false;
|
}
|
|
/// <summary>
|
/// 复制数值
|
/// </summary>
|
/// <param name="list"></param>
|
/// <returns></returns>
|
public static bool CopyDouble(out List<List<double?>> list)
|
{
|
var dlg = new ClipboardCurveTextSelDlg();
|
if (dlg.ShowDialog() == DialogResult.OK)
|
{
|
if (dlg.Separator == ClipboardCurveTextSelDlg.eSeparator.单元)
|
{
|
if (dlg.Direction == ClipboardCurveTextSelDlg.eDirection.横向)
|
{
|
list = ClipboardCurveTextHelper.GetRowDoubleText(dlg.NeglectList, "\t");
|
}
|
else
|
{
|
list = ClipboardCurveTextHelper.GetColDoubleList(dlg.NeglectList, "\t");
|
}
|
}
|
else
|
{
|
if (dlg.Direction == ClipboardCurveTextSelDlg.eDirection.横向)
|
{
|
list = ClipboardCurveTextHelper.GetRowDoubleText(dlg.NeglectList, ",");
|
}
|
else
|
{
|
list = ClipboardCurveTextHelper.GetColDoubleList(dlg.NeglectList, ",");
|
}
|
}
|
return true;
|
}
|
list = null;
|
return false;
|
}
|
}
|
}
|