using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using GeoSigmaDrawLib; namespace SymbolLibManager { public partial class FrmSymbolSelect : Form { public string LibPath { get; set; } public string SelectedSymbolName { get; set; } = string.Empty; GeoSigmaXY Geo; public FrmSymbolSelect() { InitializeComponent(); } public FrmSymbolSelect(GeoSigmaXY geo, string symbolPath, ref string selectedSymbolName) :this() { SelectedSymbolName = selectedSymbolName; //selectedSymbolName = SelectedSymbolName; this.LibPath = symbolPath; this.Geo = geo; } private void FrmSymbolSelect_Load(object sender, EventArgs e) { if (string.IsNullOrEmpty(LibPath)) { string strPath = Path.GetDirectoryName(Application.StartupPath); LibPath = Path.Combine(strPath, "Symbol"); } FrmMarkMain frmSymbol = new FrmMarkMain(Geo, LibPath); frmSymbol.ShowInSelectMode = true; // 设置窗体最大化 frmSymbol.Dock = DockStyle.Fill; frmSymbol.FormBorderStyle = FormBorderStyle.None; frmSymbol.TopLevel = false; // viewerCur = mainView; // 指定当前子窗体显示的容器 frmSymbol.Parent = this; frmSymbol.BringToFront(); frmSymbol.Show(); frmSymbol.FormClosed += FrmSymbol_FormClosed; } private void FrmSymbol_FormClosed(object sender, FormClosedEventArgs e) { SelectedSymbolName = ((FrmMarkMain)sender).SelectedSymbolName; this.Tag = SelectedSymbolName; this.DialogResult = ((FrmMarkMain)sender).DialogResult; this.Close(); } } }