bulding demos

Topics: CompactFramework, SharpMap Project, SharpMap v2.0, Web Controls, WinForms Controls
Jun 2, 2008 at 9:47 PM
Hello, All!
Did build SharpMap libraries (no errors but ~4000 warnings! in msvc 8.0)
Got errors building DemoWinForm started with warning:

warning : The referenced project '..\..\GeoAPI\src\GeoAPI\GeoAPI.Net.csproj' does not exist.

Moving DemoWinForm folder to SharpMap (one level up from Demos) produced another build error:

Microsoft.Common.targets(481,9): error : The OutputPath property is not set for this project. Please check to make sure that you have specified a valid Configuration/Platform combination. Configuration='Debug' Platform='AnyCPU'

Done building project "GeoAPI.Net.csproj" -- FAILED.

Also, for some reasong WebSite folder is empty. My goal was to try web publishing feature.


Could somebody help to figure out what is wrong?
Coordinator
Jun 3, 2008 at 1:17 AM
Hi gok -

Sorry for the news, but DemoWinForm isn't part of the working set of projects yet. We also don't have anything done on the web side of SharpMap for v2.0 (started, but not done).

I hope to take a look at DemoWinForm soon, but I can't promise anything in a given timeframe. If you get it working, your feedback would be most helpful! Getting a number of working demos is a major goal of v2.0...
Coordinator
Jun 3, 2008 at 9:23 AM
Hi gok I have just uploaded the beginnings of a V2 desktop app to the patches page. It is incomplete and buggy - but you should see a map!
I am also working on the web side so there should be some progress there in the near future..
 hth jd
Jun 3, 2008 at 7:35 PM
Hi, John.
Did try patch:
"Unable to read the project file 'MapViewer.csproj'"
...
The imported project "c:\Microsoft.CSharp.targets" was not found ..."
How to fix it?
Coordinator
Jun 3, 2008 at 7:46 PM
This problem comes from the project being created in VS 2008 and being loaded in VS 2005.

The solution is to replace the line:

  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

with 

  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />

in the .csproj file.
Jun 4, 2008 at 12:22 AM
Edited Jun 4, 2008 at 12:23 AM
Yes, codekaizen, it works!
Now getting error messages for this line:

 

CommandControlSourceBase.cs, 37: protected CommandEnabledChangedDelegate<TControl> _enabledChangedAction

 =

new CommandEnabledChangedDelegate<TControl>((o, b) => o.Enabled = b);



 

 

C:\my_Projects\src\wwwProjects\sharpMap\patches\SharpMapWinFormsDemo\Commands\CommandControlSourceBase.cs(38,61): error CS1026: ) expected

C:\my_Projects\src\wwwProjects\sharpMap\patches\SharpMapWinFormsDemo\Commands\CommandControlSourceBase.cs(38,67): error CS1525: Invalid expression term '>'

C:\my_Projects\src\wwwProjects\sharpMap\patches\SharpMapWinFormsDemo\Commands\CommandControlSourceBase.cs(38,69): error CS1002: ; expected

C:\my_Projects\src\wwwProjects\sharpMap\patches\SharpMapWinFormsDemo\Commands\CommandControlSourceBase.cs(38,79): error CS1519: Invalid token '=' in class, struct, or interface member declaration

C:\my_Projects\src\wwwProjects\sharpMap\patches\SharpMapWinFormsDemo\Commands\CommandControlSourceBase.cs(38,82): error CS1519: Invalid token ')' in class, struct, or interface member declaration

 

First message about comma

Coordinator
Jun 4, 2008 at 10:57 AM

Hi Gok, sorry I didnt make it clear it was a vs2008 project. The next error you have come across is because vs 2005 doesn't understand c# 3.0 syntax.

(o,b) => o.Enabled = b

is symantically equivalent to

delegate (TControl a, bool b) {a.Enabled = b}

(note that in the first expression the compiler still knows and checks the types of o and b)

If you want to delve a bit deeper into lambda expressions [url:http://msdn.microsoft.com/en-us/library/bb397687.aspx] may be useful. Or you could try running it with vc# express 2008 which you can download for free from here : [url:http://www.microsoft.com/express/vcsharp/]

In the future I may go back over the code and revert it to c#2.0 syntax - but it is unlikely to be soon...

 

 

Coordinator
Jun 6, 2008 at 11:06 AM
@JohnDiss:
In the description of your patch you stated:

>Very _Quick and Dirty_ taster app showing _V2_ "in action". Highlights some known bugs - and possibly some unknown ones..
>Known bugs include:
>Only able to show one shapefile.
>Error on resize
>These are being inestigated...

I've had similar problems with resizing/zooming/panning. For me it helped to modify the "Read"-Method of the ShapeFileDataReader to the following:

public Boolean Read()
{
checkDisposed();

Boolean reading = _objectEnumerator.MoveNext();

if (reading)
{
_currentFeature = _shapeFile.GetFeatureByOid(_objectEnumerator.Current);
}
else
{
Dispose(false);
}

return reading;
}


I don't if that is the best way to get the reader disposed after it is done reading, but it works.


Coordinator
Jun 6, 2008 at 11:07 AM
@JohnDiss:
In the description of your patch you stated:

>Very _Quick and Dirty_ taster app showing _V2_ "in action". Highlights some known bugs - and possibly some unknown ones..
>Known bugs include:
>Only able to show one shapefile.
>Error on resize
>These are being inestigated...

I've had similar problems with resizing/zooming/panning. For me it helped to modify the "Read"-Method of the ShapeFileDataReader to the following:

public Boolean Read()
{
checkDisposed();

Boolean reading = _objectEnumerator.MoveNext();

if (reading)
{
_currentFeature = _shapeFile.GetFeatureByOid(_objectEnumerator.Current);
}
else
{
Dispose(false);
}

return reading;
}


I don't if that is the best way to get the reader disposed after it is done reading, but it works.


Coordinator
Jun 6, 2008 at 11:15 AM
@FObermaier, thanks for the tip.. cheers jd
Coordinator
Sep 4, 2008 at 7:32 PM
 I have uploaded the source for the demo app to http://sharpmapv2aspnet.googlecode.com/svn/trunk/SharpMapWinFormsDemo/ I have converted all the lambda expressions to delegates (and changed the namespaces to better match the structure) to make it easier for people without vs2008 to build and run the app but the csproj file will still need editing - see above. Also make a note of FObermaier's tip also above. It has no extra functionality and most of the buttons still dont do anything...