使用vs2005 打开工程 , 首先发现 一些 小的错误, 应该是因为 使用IDE版本不同的原因。 在缺少‘ 或者 “的地方加上 引号,很快 就把十几个错误改过来了,接着 用设计器 打开 worldwind.cs 会发现 设计器显示错误。无法显示界面。
显示错误如下:
The designer cannot process the code at line 1070: this.splitContainer.Panel1Collapsed = !World.Settings.BrowserVisible; The code within the method 'InitializeComponent' is generated by the designer and should not be manually modified. Please remove any changes and try opening the designer again.
at Microsoft.VisualStudio.Design.Serializat ion.CodeDom.XML.CodeDomXmlProcessor.Crea teQuoteExpression(XmlElementData xmlElement)
at Microsoft.VisualStudio.Design.Serializat ion.CodeDom.XML.CodeDomXmlProcessor.XmlE lementData.get_CodeDomElement()
at Microsoft.VisualStudio.Design.Serializat ion.CodeDom.XML.CodeDomXmlProcessor.EndE lement(String prefix, String name, String urn)
.....
就是这个错误,害我弄了好几天,查 baidu google 都找不到答案,最会 在一个worldwind 英文论坛里看见如下 解决方法 :
Step one:
IN worldwind.cs file InitializeComponent() function delete some code in as follows list:
(就是说删除下面的代码)
this.worldWindow = new WorldWind.WorldWindow();
this.toolBarButtonLatLonLines = new System.Windows.Forms.ToolBarButton();
this.splitContainer.Orientation = getWebBrowserOrientationFromSetting(Worl d.Settings.BrowserOrientationHorizontal) ;
this.splitContainer.Panel1Collapsed = !World.Settings.BrowserVisible;
//
// worldWindow
//
this.worldWindow.AllowDrop = true;
this.worldWindow.Cache = null;
this.worldWindow.Caption = "";
this.worldWindow.CurrentWorld = null;
this.worldWindow.Dock = System.Windows.Forms.DockStyle.Fill;
this.worldWindow.IsRenderDisabled = false;
this.worldWindow.Location = new System.Drawing.Point(0, 0);
this.worldWindow.Name = "worldWindow";
this.worldWindow.ShowLayerManager = false;
this.worldWindow.Size = new System.Drawing.Size(splitContainer.Panel 2.Width, splitContainer.Panel2.Height);
this.worldWindow.TabIndex = 0;
this.worldWindow.Text = "worldWindow";
//
// splitContainer1.Panel2
//
this.splitContainer.Panel2.Controls.Add( this.worldWindow);
Step Two:
IN WorldWind.cs file add one function InitializeWorldWindows();the InitializeWorldWindows function is as follows:
(添加如下函数)
private void InitializeWorldWindows()
{
//
// splitContainer
//
this.splitContainer.Orientation = getWebBrowserOrientationFromSetting(Worl d.Settings.BrowserOrientationHorizontal) ;
this.splitContainer.Panel1Collapsed = !World.Settings.BrowserVisible;
//
// worldWindow
//
this.worldWindow = new WorldWind.WorldWindow();
this.worldWindow.AllowDrop = true;
this.worldWindow.Cache = null;
this.worldWindow.Caption = "";
this.worldWindow.CurrentWorld = null;
this.worldWindow.Dock = System.Windows.Forms.DockStyle.Fill;
this.worldWindow.IsRenderDisabled = false;
this.worldWindow.Location = new System.Drawing.Point(0, 0);
this.worldWindow.Name = "worldWindow";
this.worldWindow.ShowLayerManager = false;
this.worldWindow.Size = new System.Drawing.Size(splitContainer.Panel 2.Width, splitContainer.Panel2.Height);
this.worldWindow.TabIndex = 0;
this.worldWindow.Text = "worldWindow";
//
// splitContainer1.Panel1
//
this.splitContainer.Panel1.Controls.Add( this.webBrowserPanel);
this.splitContainer.Panel1.Name = "webBrowserPanel";
//
// splitContainer1.Panel2
//
this.splitContainer.Panel2.Controls.Add( this.worldWindow);
this.splitContainer.TabIndex = 0;
}
Step three:
Add InitializeWorldWindows() at MainApplication() function behind InitializeComponent() function.
(在MainApplication() 中,调用InitializeWorldWindows() ;的后面 调用InitializeComponent() )
ok,现在重新生成 worldwind 工程 ,再次 打开 worldwind.cs 就可以看见设计界面了,呵呵~
解决方法From :
http://forum.worldwindcentral.com/showthread.php?t=9555
我只是转载,希望有同样问题的人,可以看见我的转载~
小发现:
使用google 中文 网站 与 英文网站搜索结果是不一样的! 使用英文搜索,可以找到不一样的结果。呵呵~ 才发现原来自己这么小白。