private void BTN_LoadDef_Click(object sender, EventArgs e)
{
try
{
this.Cursor = Cursors.WaitCursor;
SplitContainer splitcon = this.Parent.Parent as SplitContainer;
if (splitcon != null)
{
scentrol = splitcon.Panel2.Controls[0] as SceneControl;
scentrol.Scene.Layers.Clear();
m_workspace.Close();
if (scentrol != null)
{
WorkspaceConnectionInfo wksconinfo = new WorkspaceConnectionInfo();
wksconinfo.Server = System.Environment.CurrentDirectory + @"\Data\阜新市\10.smwu";
wksconinfo.Type = WorkspaceType.SMWU;
vertor = "10";
CADName = "shiyan";
if (m_workspace.Open(wksconinfo))
{
vectorCAD = m_workspace.Datasources[1].Datasets[CADName] as DatasetVector;
scentrol.Scene.Workspace = m_workspace;
scentrol.Scene.Open(vertor);
}
}
}
}
catch (System.Exception ex)
{
Console.WriteLine("error:" + ex.Message + ex.StackTrace);
}
this.Cursor = Cursors.Arrow;
}
上面是代码,在if (m_workspace.Open(wksconinfo))
{
vectorCAD = m_workspace.Datasources[1].Datasets[CADName] as DatasetVector;之前都挺正常的,但是这步出现了问题
想知道是什么原因引起的
工作空间结构如下