MapWindow 4 - ActiveX Control Programming : MapWindow Discussion Forum
Hello all, Many people who post to this forum paste code snippets in their postings. This is great, but unfortunately, the code always looks pretty bad unformatted on the forum. Well, thanks to team member Shade1974, we have now learned that code can be formatted to look good in a
How to format your code snippet on the forum...
Posted by: danames ()
Date: December 01, 2005 02:41PM

Hello all,

Many people who post to this forum paste code snippets in their postings. This is great, but unfortunately, the code always looks pretty bad unformatted on the forum. Well, thanks to team member Shade1974, we have now learned that code can be formatted to look good in a posting using the commands (code) (/code) and (color) (/color) in your posting. Note that instead of using the open and closed parentheses () you use the open and closed SQUARE BRACKETS. I can't indicate that here. In any case, Shade1974 wrote some code in .net 2003 that automatically takes your color formatted RTF text and formats it in Phorum-friendly style.

To put it another way, if you are going to post a code sample and you don't want it to look like this:

Private Sub btnZoomOut_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
'set the map cursor mode to zoom out
Map.CursorMode = MapWinGIS.tkCursorMode.cmZoomOut
End Sub

But would rather have it look like this:

        Private Sub btnZoomOut_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        'set the map cursor mode to zoom out
        Map.CursorMode = MapWinGIS.tkCursorMode.cmZoomOut
    End Sub

Then, use this program to format your code snippet:

[svn.mapwindow.org]

The source code to this tool is also available from our Subversion repository: [svn.mapwindow.org]

Dan

**********************************************

Daniel P. Ames, Ph.D. P.E.
MapWindow Project Team Lead
Civil and Environmental Engineering
Brigham Young University



Edited 5 time(s). Last edit at 07/25/2007 03:07AM by Dan Ames.

Options: ReplyQuote
Re: How to format your code snippet on the forum...
Posted by: kayoumt ()
Date: August 18, 2009 12:12PM

I wanted to use that tool for pasting C# code in a post.

But, I need to know how to :

- convert my C# code in RTF
- and "disassemble" the RTF in a forum-parsable format

There's certainly tools or Visual Studio plugings for doing those conversions ? Adding that information to this post will make that feature more useful and interesting.

Thanks for any contribution.

Options: ReplyQuote
Re: How to format your code snippet on the forum...
Posted by: geofran80 ()
Date: August 18, 2009 12:27PM

Friend, I don't understand your question but Dan put the executable in the last post:

[svn.mapwindow.org]

You only need to copy the code and then convert to phorum format.

Copy the result code and paste into the message.

Hope it serves you.

Francisco J.

Options: ReplyQuote
Re: How to format your code snippet on the forum...
Posted by: kayoumt ()
Date: August 18, 2009 04:01PM

Hi Friend Geofran80,

I did download the tool's executable and tried it.

If you don't have your source code transformed with (color)... (/color) commands for keeping the colors of your code, all the tool does is adding a (code) command at the beginning of your source code and (/code) command at the end of your source code, when you run the transformation.

I think before pasting your code, you need to put (by tool or by hand) the color commands and other commands you need for making your code feel nice.

Options: ReplyQuote
Re: How to format your code snippet on the forum...
Posted by: pmeems ()
Date: August 19, 2009 12:23AM

All the color commands are made by the formatter tool.
You need to copy the code from VS2005/2008 and past in in the top frame.
Next you hit the convert button and the code is converted and shown in the bottom frame.
Copy the code from the bottom frame in your post and you'll get source code with coloring.
If it is still not clear, mail me at bontepaarden [AT] gmail [D0T] com and I'll make some screenshots and mail it to you.

--
Paul

--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Options: ReplyQuote
[New functionality] GIS Toolbox
Posted by: Sergei ()
Date: July 12, 2011 05:04PM

oops, technical problems...



Edited 1 time(s). Last edit at 07/12/2011 05:05PM by Sergei.

Options: ReplyQuote


Sorry, only registered users may post in this forum.





Banner Exchange




GISCP.com




Send us your banner logo (160x120) for the space above, and add this MapWindow banner ad to your site:

Just paste this text in your page: