You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.3 KiB
C#
40 lines
1.3 KiB
C#
using System;
|
|
using System.Windows.Forms;
|
|
|
|
namespace SymbolLibManager
|
|
{
|
|
public class SymbolManager : SymbolLibInterface.ISymbolManager
|
|
{
|
|
public DialogResult ShowSymbolEditor(string symbolPath)
|
|
{
|
|
return ShowSymbolEditor(null, symbolPath);
|
|
}
|
|
public DialogResult ShowSymbolEditor(object sender, string symbolPath)
|
|
{
|
|
FrmMarkMain frmMain;
|
|
if (!(sender is GeoSigma.UCDraw.MainView view) || view.ViewControl.Geo == null)
|
|
{
|
|
frmMain = new FrmMarkMain(symbolPath);
|
|
return frmMain.ShowDialog();
|
|
}
|
|
else
|
|
{
|
|
frmMain = new FrmMarkMain(view.ViewControl.Geo, symbolPath);
|
|
return frmMain.ShowDialog(view);
|
|
}
|
|
}
|
|
private string selectedSymbolName;
|
|
public Form CreateSymbolSelectForm(GeoSigmaDrawLib.GeoSigmaXY geo,
|
|
string symbolPath,
|
|
Func<string, string> acceptSymbolName)
|
|
{
|
|
FrmSymbolSelect frm = new FrmSymbolSelect(geo, symbolPath, ref selectedSymbolName);
|
|
frm.FormClosed += (sender, arg) =>
|
|
{
|
|
acceptSymbolName?.Invoke(frm.SelectedSymbolName);
|
|
};
|
|
return frm;
|
|
}
|
|
}
|
|
}
|