Solution for Designer error when opening WorldWind.cs in WW1.4.0
2008-06-11 08:44
441 查看
When I load the WW project in my Visual C# 2005 Express Edition , I get the following error when I open WorldWind.cs. I can open the code but the designer refuses to open it.
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)
at Microsoft.VisualStudio.Design.Serializat ion.CodeDom.XML.CodeDomXmlProcessor.Pars e(XmlReader reader)
at Microsoft.VisualStudio.Design.Serializat ion.CodeDom.XML.CodeDomXmlProcessor.Pars eXml(String xmlStream, CodeStatementCollection statementCollection, String fileName, String methodName)
at Microsoft.VisualStudio.Design.Serializat ion.CodeDom.VSCodeDomParser.OnMethodPopu lateStatements(Object sender, EventArgs e)
at System.CodeDom.CodeMemberMethod.get_Stat ements()
at System.ComponentModel.Design.Serializati on.TypeCodeDomSerializer.Deserialize(IDe signerSerializationManager manager, CodeTypeDeclaration declaration)
at System.ComponentModel.Design.Serializati on.CodeDomDesignerLoader.PerformLoad(IDe signerSerializationManager manager)
at Microsoft.VisualStudio.Design.Serializat ion.CodeDom.VSCodeDomDesignerLoader.Perf ormLoad(IDesignerSerializationManager serializationManager)
at Microsoft.VisualStudio.Design.Serializat ion.CodeDom.VSCodeDomDesignerLoader.Defe rredLoadHandler.Microsoft.VisualStudio.T extManager.Interop.IVsTextBufferDataEven ts.OnLoadCompleted(Int32 fReload)
Is this a limitation of C# 2005 Express Edition and should I try VS 2005 or an equivalant. Any suggestions ?
Solution:在WorldWind.cs 文件中加一个函数InitializeWorldWindows();函数体主要由InitializeComponent()中去掉的语句组成,实现加载WorldWindows窗口并显示地球的功能,InitializeWorldWindows()加在构造函数MainApplication()中的InitializeComponent()函数的调用之后;InitializeWorldWindows函数如下:
private void
InitializeWorldWindows()
{
//
// splitContainer
//
this.splitContainer.Orientation = getWebBrowserOrientationFromSetting(World.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.Panel2.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;
}
在worldwind.cs的InitializeComponent()函数中注释掉下面的代码,使用Ctrl+F进行查找然后注释。
this.worldWindow = new WorldWind.WorldWindow();
this.toolBarButtonLatLonLines = new System.Windows.Forms.ToolBarButton();
this.splitContainer.Orientation = getWebBrowserOrientationFromSetting(World.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.Panel2.Width, splitContainer.Panel2.Height);
this.worldWindow.TabIndex = 0;
this.worldWindow.Text = "worldWindow";
//
// splitContainer1.Panel2
//
this.splitContainer.Panel2.Controls.Add(this.worldWindow);
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)
at Microsoft.VisualStudio.Design.Serializat ion.CodeDom.XML.CodeDomXmlProcessor.Pars e(XmlReader reader)
at Microsoft.VisualStudio.Design.Serializat ion.CodeDom.XML.CodeDomXmlProcessor.Pars eXml(String xmlStream, CodeStatementCollection statementCollection, String fileName, String methodName)
at Microsoft.VisualStudio.Design.Serializat ion.CodeDom.VSCodeDomParser.OnMethodPopu lateStatements(Object sender, EventArgs e)
at System.CodeDom.CodeMemberMethod.get_Stat ements()
at System.ComponentModel.Design.Serializati on.TypeCodeDomSerializer.Deserialize(IDe signerSerializationManager manager, CodeTypeDeclaration declaration)
at System.ComponentModel.Design.Serializati on.CodeDomDesignerLoader.PerformLoad(IDe signerSerializationManager manager)
at Microsoft.VisualStudio.Design.Serializat ion.CodeDom.VSCodeDomDesignerLoader.Perf ormLoad(IDesignerSerializationManager serializationManager)
at Microsoft.VisualStudio.Design.Serializat ion.CodeDom.VSCodeDomDesignerLoader.Defe rredLoadHandler.Microsoft.VisualStudio.T extManager.Interop.IVsTextBufferDataEven ts.OnLoadCompleted(Int32 fReload)
Is this a limitation of C# 2005 Express Edition and should I try VS 2005 or an equivalant. Any suggestions ?
Solution:在WorldWind.cs 文件中加一个函数InitializeWorldWindows();函数体主要由InitializeComponent()中去掉的语句组成,实现加载WorldWindows窗口并显示地球的功能,InitializeWorldWindows()加在构造函数MainApplication()中的InitializeComponent()函数的调用之后;InitializeWorldWindows函数如下:
private void
InitializeWorldWindows()
{
//
// splitContainer
//
this.splitContainer.Orientation = getWebBrowserOrientationFromSetting(World.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.Panel2.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;
}
在worldwind.cs的InitializeComponent()函数中注释掉下面的代码,使用Ctrl+F进行查找然后注释。
this.worldWindow = new WorldWind.WorldWindow();
this.toolBarButtonLatLonLines = new System.Windows.Forms.ToolBarButton();
this.splitContainer.Orientation = getWebBrowserOrientationFromSetting(World.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.Panel2.Width, splitContainer.Panel2.Height);
this.worldWindow.TabIndex = 0;
this.worldWindow.Text = "worldWindow";
//
// splitContainer1.Panel2
//
this.splitContainer.Panel2.Controls.Add(this.worldWindow);
相关文章推荐
- [SharePoint 2010] 关于 "Error message when view or edit in browser for Word or PowerPoint Web Apps” 错误
- Error 1603 when trying to deploy packages in Deployment Solution
- 严重: Exception fixing docBase for context [/post] java.util.zip.ZipException: error in opening zip fi
- SharePoint Portal Server 2003 Search does't like .Net Framework 2.0!!! (for Error in PortalCrawl Web Service solution)
- Solution for When browse http://xxx/ReportServer Show Error (rsAccessDenied)
- Error when save view in Web Query Designer
- ERROR: opening port for MGR MGR (Connection refused).
- An explicit value for the identity column in table 'users' can only be specified when a column list
- 显存不够----ResourceExhaustedError (see above for traceback): OOM when allocating tensor with shape[4096]
- 安装光盘出现“error opening file for writting ”?????????????????????????
- Android linux下重新打包apk 报错 java.util.zip.ZipException: error in opening zip file
- A LNK2005 error occurs when the CRT library and MFC libraries are linked in the wrong order in Visual C++
- CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 9.2'
- CodeSign error: code signing is required for product type Application in SDK iOS XXX的解决办法
- Neutron数据库同步错误 NotImplementedError: No support for ALTER of constraints in SQLite dialect
- Error in DB connect for DB2, DB4 and MS-SQL-Server
- IPAD真机调试CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 8.0'
- Android development - 'missing theme error' in eclipse ide for layout xml files
- SharePoint Designer Check In and Check Out Error – Cannot perform this operation.The file is no longer check out or has been del
- react native Exception in thread "main" java.util.zip.ZipException: error in opening zip file