Contents tagged with English
-
GhostDoc - The Movie ;-)
I just submitted my video for the PDC 05 “Show Off” session. Producing this video was much more work than I expected, which means that I won’t be able to release the final of 1.3.0 before the PDC (I’m already leaving on Thursday, as I’ll take a little detour on my way to L.A).
The hardest part of the video was speaking English and presenting GhostDoc – either I mis-pronounced a word or stumbled over a wicked combination of “s” and “th” (which I wouldn’t care about in a real-life situation), or I made a mistake during the presentation. Fortunately with some editing, many things can be fixed.
If the video is accepted, it will be shown at the “Show off” session and will be made available after the PDC. Sorry, I can’t post a download link before the PDC.Update: The video was accepted and shown at the PDC, and is now up on Channel 9.
-
GhostDoc 1.3.0 Beta 2 Released
Beta 2 of GhostDoc 1.3.0 has been released, which in terms of features should be pretty close to the release version. The documentation has made a major step forward, but stills needs some work (proofreading, more and better Howtos, especially tutorials for defining custom rules).
What’s new in 1.3.0 beta 2 compared to beta 1:
- Added: New options for determining what should be the representation of the C# language keywords "true", "false" and "null" in a documentation comment.
- Added: New Macros $(True), $(False) and $(Null) to be used in text templates.
- Added: New Macros for the current date, the name of the current user, etc. ("environment macros").
- Added: New custom text that will be added once to a newly added documentation comment. As this text will not be updated, can be used for e.g. marking the date and time when a class member was added.
- Added: New summary template for default property rule (text generation was hard-coded in previous versions).
- Added: Template for methods with parameters for SingleWordMethodRule (text generation was hard-coded in previous versions).
- Added: Preliminary documentation for the dialogs.
- Changed: Default textual representation of "null", "true" and "false" back to the values of version 1.2.1 (<c>null</c>, <c>true</c> and <c>false</c>)
- Changed: Value text of the default property rule is no longer empty by default.
- Changed: Macros: Words.AsSentence -> Words.AllAsSentence
- Fixed: Various bugs related to customization features.
For those who missed the release of beta 1 and still work with 1.2.1:
1.3.0 Beta 1 compared to 1.2.1:
- Added: New rules for using "inherited" documentation, including base class members and members of implemented interfaces. The inherited documentation will be cleaned from single <para> tags and the texts will be tweaked (e.g. when the summary for an interface method starts with "When implemented by a class....", and the summary is inherited by the method that is an implementation).
- Added: GhostDoc updates existing documentation. Empty tags (<summary>, <returns>, <param>) will be filled according to the generation rules, existing text remains unchanged. The update reorders the parameter documentation if the order of the parameter changes, and removes documentation for parameters that no longer exist.
- Added: User defined ("custom") rules using e.g. regular expressions for matching names and/or types.
- Added: New rule for "On..." methods -- no more "Ons the click" ;-)
- Added: Rule for static constructors.
- Added: Rule for the Finalize method (destructor syntax in C#).
- Added: Rule for event handler methods as they are created by the WinForms designer.
- Added: Rule for boolean properties.
- Added: Rules (both custom and built-in) can now be customized by editing templates that are used by the text generation rules.
- Added: Export of partial configurations is now possible (e.g. for exporting only a single custom rule).
- Changed: Summary text of the default constructor rule is now 'Initializes a new instance of the <see cref="ClassName" /> class.', i.e. uses the wording in the Microsoft documentation. The old "Creates a new <see cref="ClassName" /> instance" is debatable - is it the constructor that actually creates the instance, or is the constructor called when the instance is created? Thus the Microsoft wording is preferrable.
- Changed: The configuration is now stored in the ApplicationData\Weigelt\GhostDoc directory. Old configurations in the installation directory (versions before 1.3.0) will be upgraded and stored in the new location.
- Fixed: <returns> tag no longer disappears if the return type is an array.
- Fixed: Overall handling of array types.
FAQ
- When is the final coming out?
Before the PDC. - What about VS2005 support?
After the PDC.
-
"Show Off" at PDC 2005 ?
Michael Swanson writes: “Show Off at PDC 2005”:
We propose a PDC 2005 2-hour session called Show Off. The concept: "Why demo your cool application to a few friends, when you can Show Off to thousands of your peers at the PDC?" […] You and/or your team put together a single WMV file that shows off something cool about your application, tool, technique (or whatever). […] Videos are limited to 5 minutes. […] So, what do you think? Would you participate? We're trying to gauge interest before we spend a bunch of time on this.I think that’s a good idea. Hey, I’m actually thinking about making my own video (guess about what ;-), even though I’m not quite sure how speaking English in front of a camera works out for me – but I’d give it a try…
-
GhostDoc 1.3.0 Beta 1 Released
I’m pleased to announce that beta 1 of GhostDoc 1.3.0 has been released. A big “Thank You” to the steadily growing number of testers who helped me testing a couple of preview builds, pointed out a few minor issues and gave me an overall “Thumbs up”.
What’s New
- New: New rules for using "inherited" documentation, including base class members and members of implemented interfaces. The inherited documentation will be cleaned from single <para> tags and the texts will be tweaked (e.g. when the summar for an interface method starts with "When implemented by a class....", and the summary is inherited by the method that is an implementation).
- New: GhostDoc updates existing documentation. Empty tags (<summary>, <returns>, <param>) will be filled according to the generation rules, existing text remains unchanged. The update reorders the parameter documentation if the order of the parameter changes, and removes documentation for parameters that no longer exist.
- New: User defined ("custom") rules using e.g. regular expressions for matching names and/or types.
- New: New rule for "On..." methods -- no more "Ons the click" ;-)
- New: Rule for static constructors.
- New: Rule for the Finalize method (descructor syntax in C#).
- New: Rule for event handler methods as they are created by the WinForms designer.
- New: Rule for boolean properties.
- New: Rules (both custom and built-in) can now be customized by editing templates that are used by the text generation rules.
- New: Export of partial configurations is now possible (e.g. for exporting only a single custom rule).
What’s Missing
There are a couple of small features I’d like to see in 1.3.0 final. And then there’s a huge update of the help file waiting to be done.
FAQ
- When is the final coming out?
My personal deadline is end of August. - What about VS2005 support?
I guess i’ll wait for the PDC bits of VS2005
-
GhostDoc: Looking for Testers
I’m planning a first public beta of GhostDoc 1.3.0 towards the end of July. A couple of private builds have already been released to colleagues and people on the net who offered their help. So far feedback has been pretty good. People like the new features, some issues have been found, most of them could be fixed in the following builds.
Now I would like to have a couple more people to test the current build. If you’re interested, contact me via the contact form. Please tell me about your system (e.g. which other Add-ins are installed), since when you have been using GhostDoc and how often you use it. I’ll then send you an email with the download link (when waiting for a reply, please take time zone differences into account ;-).
Here are the new features you can try out in the preview:
- New rules for using "inherited" documentation, including base class members and members of implemented interfaces. The inherited documentation will be cleaned from single <para> tags and the texts will be tweaked (e.g. when the summary for an interface method starts with "When implemented by a class....", and the summary is inherited by the method that is actually the implementation).
- GhostDoc now updates existing documentation. Empty tags (<summary>, <returns>, <param>) will be filled according to the generation rules, existing text remains unchanged. The update reorders the parameter documentation if the order of the parameter changes, and removes documentation for parameters that no longer exist.
- User defined ("custom") rules using e.g. regular expressions for matching names and/or types.
- New rule for "On..." methods -- no more "Ons the click" ;-)
- Rule for static constructors.
- Rule for the Finalize method (destructor syntax in C#).
- Rule for event handler methods as they are created by the WinForms designer.
- Rule for boolean properties.
- Rules (both custom and built-in) can now be customized by editing templates that are used by the text generation rules.
A few words about the quality of this preview: Answering the obvious question “does it fry my data and/or my Visual Studio installation?”, I can say that the Visual Studio integration and installation/uninstallation are at least as good as in version 1.2.1, so I wouldn’t hesitate to run the setup on production machines. The current problems are mostly missing features, some usability issues and the online help that hasn’t been updated yet.
-
Two Years of Blogging
Oops, so I missed my blog’s anniversary (by a day). My first entry was on July, 2nd 2003 and it’s incredible how fast the time has passed. A lot has happened since the last anniversary – most of it could be summarized into one word: GhostDoc. After my articles about Visual Inheritance, this little add-in has put me high up on Google. Right now I’m still working on version 1.3.0 which is pretty late as I’m not working on it in the same frantic pace as for 1.0.0 (which got ready 11 minutes before the deadline).
But this year hasn’t been only about GhostDoc. Other blog posts – besides the occasional rant – included:
- LinkBox - Fun with Panels, LinkLabels and AutoScroll
- Splitter Control with Drag Handle
- ReadOnlyRichTextBox
- LastBoxStanding (a Windows service that pings a configurable list of machines in your LAN to determine whether at least one of them is still running. If no machine responds, the service performs a custom action, e.g. a shutdown.)
Let's see what the next year brings…
-
PDC 05: I'll be there / GhostDoc goes Redmond
YES! It’s official! I’ll be at the PDC in L.A., together with two other colleagues from the infonea product development team at Comma Soft AG. As flying from Germany to the West Coast of the USA is nothing I do on a weekly basis, I’ll take the opportunity to finally claim one of the prizes I won for GhostDoc in Roy Osherove’s add-in contest in August 2004 – a tour of MS offices in Redmond (which didn’t include transportation to Redmond ;-). I asked Josh Ledgard whether I could bring my colleagues, he replied “no problem”, so we’ll all take a little detour on our way to L.A. and visit the campus on Friday, 9th. before continuing our journey to L.A. on Saturday.
-
Cool: Bold Fonts in Visual Studio 2005's Text Editor
Sometimes it’s the simple things that can make you happy.
As I’ve already mentioned in my blog, I switched to a proportional font for editing source code long time ago, and I’m always looking how to improve my “source code viewing experience”. One thing I tried in Visual Studio .Net 2003 was bold text for keywords, but things were not working correctly. For example when typing “public”, you would see something like this:
- When you start typing, the keyword is not complete and thus the “publi” is rendered as normal text:
- After you type the “c”, Visual Studio detects the keyword “public” and renders it in bold text. Unfortunately, the cursor is not moved immediately…
- …but about 1 second later:
Well, maybe I could have lived with the delay, and the cursor position didn’t affect the typing of the next characters, but behind the bold keyword, the cursor display didn’t match the actual position. So I more or less forgot about it.
Now guess what I found out when I tried Visual Studio 2005: Not only that the bug regarding the cursor position is fixed, but “user types” (e.g. classes, interfaces) can now be styled individually, too. So now I’m able to have something like this:
Cool… The only problem is that I still have to use VS.Net 2003 for my daily work (man, I want that final out soooo bad!)
- When you start typing, the keyword is not complete and thus the “publi” is rendered as normal text:
-
LinkBox - Fun with Panels, LinkLabels and AutoScroll
Remark: This is a spin-off of my work on GhostDoc. As the control I wrote for GhostDoc is highly specific to the actual problem I wanted to solve, I’ll only explain the basic idea and provide the source for the “LinkBox” control which I use as a base class. For some basic use cases this control may already be sufficient, for other use cases you’ll have to add some code.
Situation: I need something like this in one of my dialogs:
(Note this is a mockup inspired by an Outlook dialog,
not related to my work on GhostDoc)Clicking a link raises an event, the event arguments provide information about which link was clicked.
If necessary, scrollbars appear:
Question: How do I implement this?
First thought: Web browser control. Why? Because of the links. Hmm… Do I need any other feature of HTML? No, just the links.
Second thought: In this case, a web browser control smells like overkill. So what else gives me multi-line text, links and scrolling? A RichTextBox control. While using a RichTextBox for text input (its main purpose) can be a bit frustrating, I’ve had good success in the past using it for output (see this and this post). And you can have links in rich text. By default, only http and mailto links are supported, but that’s a limitation that can be circumvented (see this CodeProject article by “mav.northwind”). Unfortunately, the RichTextBox control’s LinkClicked event only provides the text of the link — which can be a problem when trying to identify which link was clicked.
Third thought: If I’m able to crank out a user control for my specific needs with little effort, I’d definitely prefer that to using a web browser control. So what’s the simplest thing that would work for me? Do I need multiple links in one line? No. OK, so I can use a LinkLabel control for each individual line (which makes identifying which link was clicked pretty easy).
The solution: A user control completely filled with a panel (to get the sunken borders), link labels are added dynamically (with auto-sizing enabled) and are docked to the top, so I don’t have to take care of positioning. Scrolling is taken care of by the panel (AutoScroll), the AutoScrollMinSize is easy to determine as the labels are auto-sized (so width = largest width and height = y-coordinate of the last label’s bottom border).
The code can be downloaded here, complete with a demo project:
linkBox1.AddText("This is some fixed text");
linkBox1.AddLink("The quick brown {0}", "fox");
linkBox1.AddLink("jumps over the lazy {0}", "dog");
linkBox1.AddLink("This is a {0} with a tag object", "test", "Some tag object");As already mentioned, the LinkBox control may be sufficient for simple use-cases. For more complicated use-cases (where you may need updating/refreshing), the control offers a SetText and an UpdateAutoScrollSize method (which in the GhostDoc source are called by a derived control). If you use LinkBox purely as a base class, you should think about making the methods protected — in a derived, application-specific control, you typically specify some sort of “data source” object and the control takes care of keeping the display up-to-date.
Implementation detail: This control uses docking for its layout, so the z-order of the LinkLabel controls is important. In general, when you add controls docked to the top in the forms designer and look at the resulting code, you’ll notice that the controls are added in reverse order. This reversed order is necessary because of the z-order that influences the docking. To achieve the correct z-order without the adding the controls in reversed order (which would make things a bit more complicated when adding controls programmatically like LinkBox does), you have to set the child index of the control:
thePanel.Controls.Add(theLinkLabel);
thePanel.Controls.SetChildIndex(theLinkLabel, 0);
In the case of the LinkBox control, this leads to the situation that
thePanel.Controls[0]
does not contain the LinkLabel control representing the first line. This is nothing you usually have to care about, I just mentioned it to avoid confusion in case you dig a little bit deeper in the debugger e.g. when running the demo. -
"Visual Studio Hacks" Book: Excerpts Online
Excerpts from the “Visual Studio Hacks” book by James Avery have been published on the OnDotNet web site.
- Master the Command Window
- Create Comments Faster (this one is about GhostDoc and was written by me)
- Run Unit Tests Inside of Visual Studio
- Hack the Project and Solution Files
- Refactor Your Code
Unfortunately I didn’t have much time to read the book in the previous weeks. Yesterday was the first day of the year that the local “Freibad” (public outdoor swimming pool) was open, so I took it with me to read it while sunbathing. And I must say that “Visual Studio Hacks” passed my personal “Freibad test”, i.e. it was interesting enough to be read in a noisy environment, with interruptions (kids playing soccer in the sunbathing area), and without a computer nearby. Other books that passed this test in previous years are “C# Unleashed” by Joseph Mayo, “Code Complete 2” by Steve McConnell and the “Extreme Programming Pocket Guide” by chromatic.
Back to “Visual Studio Hacks”: I consider myself an advanced user of Visual Studio, so many of the hacks are not really new to me, but most of those hacks contained some bit of information I didn’t know yet or completely forgot about. What I really liked about the book is that it’s not a simple collection of tips that the author barely tried himself. You notice that in the little details like the solutions to problems you may not encounter immediately, but will run into sooner or later in your daily work (e.g. the infamous “Call rejected by callee” error). So far I’ve read the first half of the book and I couldn’t find anything that I would consider of little value – I wish could say that about many other computer books.