public void InitDataUpdateUnitSetting()
{
InitFormBiz(frm =>
{
if (ucIndexLayer == null)
{
GwWaitForm.Start("正在启动……");
ucIndexLayer = new UCIndexLayer();
ucIndexLayer.SetDB(ref _dbHelper);
ucIndexLayer.Initialize();
ucIndexLayer.Dock = DockStyle.Fill;
frm.Size = new Size(ucIndexLayer.Size.Width + 10, ucIndexLayer.Size.Height + 10);
ucIndexLayer.Dock = DockStyle.Fill;
GwWaitForm.Stop();
}
frm.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
frm.FormBorderStyle = FormBorderStyle.FixedSingle;
frm.MaximizeBox = false;
frm.MinimizeBox = false;
frm.ShowIcon = false;
frm.ShowInTaskbar = false;
frm.Text = "设置";
frm.Size = new Size(600, 400);
frm.Controls.Add(ucIndexLayer);
});
}
private void InitFormBiz(Action<Form> initUCFunc)
{
try
{
Form frm = new Form();
initUCFunc(frm);
frm.ShowDialog();
}
catch (Exception ex)
{
LogHelper.Error.Append(ex);
}
}