DotSpatial.Symbology.Forms - Designer errors

Developer
Dec 2, 2010 at 9:21 PM

We're trying to open the designer view of some controls in DotSpatial.Symbology.Forms in Visual Studio 2010. Many of the controls and forms display an error when trying to open the Visual Studio Designer. For example,

SelectByAttributes.cs gives an error: The designer cannot process the code at line 156: this.btnClose.DialogResult = DialogResult.Cancel;...

StrokeCollectionControl.cs gives an error: The designer cannot process the code at line 168: this._btnDown.Image = SymbologyFormsImages.down as Image; 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.

Is anybody else experiencing these errors? Is there any quick workaround how to open the forms in the designer?

Developer
Dec 2, 2010 at 9:55 PM

Jiri this appears to be standard, but is more or less a one time deal for each form.  So as I have been using forms, I have been removing the conflicting lines, and then it will work in both.  Also, when you save in 4.0, it will save all references in the resx file as 4.0.0.0.  These have to be manually changed back to 2.0.0.0, or else you will no longer be able to compile in 3.5.

Ted

 

Developer
Dec 2, 2010 at 10:20 PM

Thanks Ted for the advice.

I did a trial with StrokeCollectionControl.cs:

  1. Comment out all lines which were causing the designer errors
  2. Open the control in the designer
  3. Re-add the button images using the designer
  4. Open the code of StrokeCollectionControl.resx and replace Version=4.0.0.0 by Version=2.0.0.0 (using the find&replace tool)

This approach seems to work. There are multiple forms in DotSpatial.Symbology.Forms with this issue. I'll make the fix in the other forms too.

Developer
Dec 2, 2010 at 10:34 PM
Sounds great if you want to tackle that Jiri. I have been taking the approach that these can be dealt with as the form needs editing for other reasons, but if you want to update the forms that works very well.

Ted

On Thu, Dec 2, 2010 at 3:20 PM, jirikadlec2 <notifications@codeplex.com> wrote:

From: jirikadlec2

Thanks Ted for the advice.

I did a trial with StrokeCollectionControl.cs:

  1. Comment out all lines which were causing the designer errors
  2. Open the control in the designer
  3. Re-add the button images using the designer
  4. Open the code of StrokeCollectionControl.resx and replace Version=4.0.0.0 by Version=2.0.0.0 (using the find&replace tool)

This approach seems to work. There are multiple forms in DotSpatial.Symbology.Forms with this issue. I'll make the fix in the other forms too.

Read the full discussion online.

To add a post to this discussion, reply to this email (DotSpatial@discussions.codeplex.com@discussions.codeplex.com)

To start a new discussion for this project, email DotSpatial@discussions.codeplex.com@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Dec 2, 2010 at 10:45 PM

Ted, I remember there were some kind of switch in the Mapwindow which can build different language version, Is that possible for you to add this kind of function in DotSpatial(which make all the sources build in default setting)?

Ping

Developer
Dec 2, 2010 at 11:04 PM

It is a .Net setting and doesn't need to be added per say.  That is, the framework to support it is already there.  But you do need to store the Globalization.CultureInfo of the culture you want to use to override the existing culture setting on their machine.  This could be anywhere from a registry key to an xml file.  Be careful if you use the registry to keep track of information, since I don't think that will work correctly in Linux or Mac.  It might be better to use an XML settings file in the users directory or something.

Ted

Developer
Dec 4, 2010 at 5:12 AM

I have updated all forms and controls in DotSpatial.Controls, DotSpatial.Data.Forms and DotSpatial.Symbology.Forms to open correctly in the Visual Studio designer. I've committed my changes.

There still seem to be some small problems in DotSpatial.Modeling.Forms (the toolbox dialog elements).