Solution for Designer Error while opening WorldWind.cs in WW1.4.0
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 line1070: This. splitcontainer.panel1collapsed =! World.Settings.BrowserVisible; The code within the method'InitializeComponent' isGenerated by the designer and should not being manually modified. Remove any changes andtry Opening the designer again.at Microsoft.VisualStudio.Design.Serializat ion. CodeDom.XML.CodeDomXmlProcessor.Crea Tequoteexpression_r (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: Add a function initializeworldwindows () to the WorldWind.cs file , and the function body consists mainly of statements removed from the InitializeComponent (), Implement load Worldwindows window and show the function of Earth,initializeworldwindows () plus in constructor mainapplication () InitializeComponent After the call to the function (), theinitializeworldwindows function is as follows:
Private voidinitializeworldwindows () {// //SplitContainer// This. splitcontainer.orientation =getwebbrowserorientationfromsetting (World.Settings.BrowserOrientationHorizontal); This. splitcontainer.panel1collapsed =!World.Settings.BrowserVisible; // //Worldwindow// This. Worldwindow =NewWorldwind.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. worldwindows.isrenderdisabled =false; This. worldwindow.location =NewSystem.Drawing.Point (0,0); This. Worldwindow.name ="Worldwindow"; This. Worldwindow.showlayermanager =false; This. worldwindow.size =NewSystem.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;}
comment out the following code in Worldwind.cs's InitializeComponent () function, and use Ctrl+f to find and then comment.
This. Worldwindow =NewWorldwind.worldwindow (); This. Toolbarbuttonlatlonlines =NewSystem.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. worldwindows.isrenderdisabled =false; This. worldwindow.location =NewSystem.Drawing.Point (0,0); This. Worldwindow.name ="Worldwindow"; This. Worldwindow.showlayermanager =false; This. worldwindow.size =NewSystem.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);
Original link: Solution for Designer Error while opening WorldWind.cs in WW1.4.0
[Go] workaround for WorldWind1.4 worldwind.cs window designer Open Error