Contents tagged with .NET
-
Microsoft TechTalk zu Besuch bei "Bonn-to-Code.Net"
Am 20.11. findet an Stelle des üblichen User-Treffens der Bonner .NET User Group ein Microsoft TechTalk mit dem Titel “Übersicht zum Expression Studio” in den Räumen der Comma Soft AG statt. Anders als sonst beginnt die Veranstaltung bereits um 18:00, auch ist dieses Mal eine (kostenlose) Anmeldung erforderlich.
Anmeldung und weitere Infos bei Microsoft, eine ausführliche Beschreibung der Anfahrt gibt es auf der Website von Bonn-to-Code.Net.
Also: Anmelden nicht vergessen!
-
Vortrag über Visual Studio Extensibility in Leipzig
Am nächsten Freitag, 6.7.2007, bin ich um 19:30 bei der .NET User Group Leipzig zu Gast und halte dort einen Vortrag über Visual Studio Extensibility.
Die Themen des Vortrags an diesem Abend:
- Code Snippets
- Project/Item Templates und Wizards
- Makros
- Add-ins
Ein gewisser Schwerpunkt wird beim Thema Visual Studio Add-ins liegen, wo ich u.a. auf den einen oder anderen Fallstrick hinweisen werde, über den ich bei der Entwicklung von GhostDoc gestolpert bin.
Die Teilnahme ist kostenlos, eine Anmeldung ist erforderlich. Laut dem Organisator Torsten Weber laufen die Anmeldungen gut, noch ist aber Platz für weitere Interessierte.
-
Visual Studio Add-ins at BASTA!
I’ve received an email that I was accepted as a speaker for the BASTA! conference in September in Mainz, Germany . The topic will be the development of add-ins for Visual Studio 2005.
There’s a thing or two that I learned while working on GhostDoc that I’d like to share. My goal is to show both how easy it is to write and debug a simple add-in to be used just by yourself (and maybe your closest buddies), and what it takes to create a “production quality” add-in that runs on the various language versions of Windows and/or Visual Studio.
This will be my first “large” conference as a speaker and I’m sure it will be pretty exciting. Good thing that I’ll have a “warm-up phase” in the next months, speaking about Visual Studio extensibility in general at various .NET user groups (more on that soon).
Note to self: Things to avoid as a speaker
-
Folien für "Visual Studio anpassen und erweitern" online
Am Montag waren Jens Schaller und ich bei der .NET User Group Paderborn zu Gast, um einen Vortrag über Anpassung und Erweiterung von Visual Studio 2005 zu halten. Wir hatten ingesamt 15 Zuhörer, angesichts des tollen Wetters eine durchaus erfreuliche Zahl.
Die Folien für die Vorträge liegen nun zum Download bereit (PowerPoint 2007, PowerPoint 2003).
-
Visual Studio anpassen und erweitern - in Paderborn
Mein Kollege Jens Schaller und ich sind am 2. April 2007 bei der .NET User Group Paderborn zu Besuch, wo wir ab 18:00 einen Vortrag mit dem Titel “Visual Studio anpassen und erweitern” halten werden.
Auf der Agenda stehen:
- Code Snippets
- Project und Item Templates
- Makros
- Add-ins
- Packages
Das ist natürlich eine Menge Stoff für einen Vortrag, deshalb werden wir flexibel auf die Interessenslage der anwesenden Zuhörer reagieren. Einen gewissen Schwerpunkt wird es beim Thema “Add-ins” geben, wo wir beide auf unsere Erfahrungen aus der Entwicklung unserer jeweiligen Hobbyprojekte SonicFileFinder (Jens) bzw. GhostDoc zurückgreifen können.
-
Microsoft Community GetTogether auf der CeBIT (non-english post)
Gestern trafen sich MVPs, CLIP-Mitglieder und Leiter von INETA .NET User Groups auf der CeBIT zum “Microsoft Community GetTogether”. Die Veranstaltung bot eine Reihe von Vorträgen zu den Themen User Experience, IIS 7.0 und UI Technologien (an dieser Stelle vielen Dank an Oliver Scheer dafür, dass er für seinen Vortrag die Schriftart im Editor auf Verdana umgestellt hat ), aber ganz klar im Vordergrund stand das Knüpfen und Pflegen von Kontakten. Dafür hatten die Veranstalter auch genügend Raum eingeräumt, so z.B. durch eine zweistündige Mittagspause, die trotzdem irgendwie viel zu schnell vorbei war. Es war schön, so manchen nach endloser “Emailerei” endlich auch mal in Person zu treffen. Für mich persönlich war es auch erfreulich zu erfahren, wie viele Entwickler GhostDoc einsetzen. Und die eine oder andere Support-Anfrage konnte dann auch gleich direkt vor Ort beantwortet werden…
Nach dem offiziellen Teil der GetTogether-Veranstaltung versammelten sich schließlich die Leiter der INETA User Groups zu einem eigenen Treffen. Einer Vorstellungsrunde, in der die Gruppenleiter jeweils ein paar Worte zu ihrer Gruppe sagten, folgte ein Rückblick auf das vergangene Jahr durch Hardy Erlinger (Leiter der INETA Deutschland). Die große Zahl von neugegründeten Gruppen ist ein eindeutiges Zeichen für das stetig wachsende Interesse an .NET und den damit verbundenen Technologien.
Anschließend ging es um die weitere Entwicklung. Ohne auf die einzelnen Punkte eingehen zu wollen (vieles davon ist zum jetzigen Zeitpunkt noch nicht spruchreif), so kann man doch sagen, das es in Zukunft einen verstärkten Austausch von Know-How und Sprechern zwischen den einzelnen Gruppen geben wird. Die Bonner User Group “Bonn-to-Code.Net” wird in den nächsten Monaten Besuch aus Frankfurt erhalten, im Gegenzug wird der Vortrag von Jens Schaller und mir über “Visual Studio Extensibility” (nach Paderborn) auch in Frankfurt zu hören sein.
Alles in allem war das Microsoft Community GetTogether eine sehr gelungene Veranstaltung und ich freue mich – nicht zuletzt wegen der vielen netten Leute, die ich dort getroffen habe – schon auf zukünftige Treffen.
-
Custom Editing Behavior for DataGridView TextBox Columns
I’m currently working on a hobby project where I’m displaying a list of files in a way similar to the “details” view of Windows Explorer. For various reasons I’m using a DataGridView instead of a ListView, and while configuring the DataGridView to look like a ListView wasn’t much of a problem, there’s one thing that got on my nerves, which is the behavior of textbox cells in edit mode: It is much too easy to leave the edit mode accidentally, simply by pressing the cursor keys at the wrong time. For example when the text caret is positioned behind the last character of the textbox cell content, and you press the right arrow key: the focus then moves to the next cell. There are certainly use cases for this behavior, but for my purposes I wanted the text caret to be “captured” inside the textbox in edit mode until you press Enter, Tab or Escape (or use the mouse to click another cell).
The nice thing about the DataGridView is that you can tweak it a lot by deriving from existing classes for cells, columns and editing controls, overriding certain methods. In my case I suspected that the DataGridViewTextBoxEditingControl (derived from TextBox) would contain special code to determine when the cell should leave edit mode. As I didn’t know what to search the documentation for (and I was too impatient to read it completely, to be honest), I fired up Lutz Roeder’s Reflector and took a look at the decompiled code of the class members. With the option “Show Inherited Members” switched off it took me only a couple of seconds to come across the code of the EditingControlWantsInputKey method which looked exactly like what I was expecting (lucky me: it was the 4th member in the list ;-).
So here are the steps to change the behavior of the editing control:
First derive a class from DataGridViewTextBoxEditingControl and override the EditingControlWantsInputKey method:
public class CustomDataGridViewTextBoxEditingControl
: DataGridViewTextBoxEditingControl
{
public override bool EditingControlWantsInputKey( Keys keyData, bool dataGridViewWantsInputKey )
{
switch (keyData & Keys.KeyCode)
{
case Keys.Prior:
case Keys.Next:
case Keys.End:
case Keys.Home:
case Keys.Left:
case Keys.Up:
case Keys.Right:
case Keys.Down:
case Keys.Delete:
return true;
}
return base.EditingControlWantsInputKey( keyData, dataGridViewWantsInputKey );
}
}Then derive a class from DataGridViewTextBoxCell and override the EditType property to use the customized editing control:
public class CustomDataGridViewTextBoxCell
: DataGridViewTextBoxCell
{
public override Type EditType
{
get { return typeof( CustomDataGridViewTextBoxEditingControl ); }
}
}Finally derive a class from DataGridViewTextBoxColumn to be able to use the new cell type.
public class CustomDataGridViewTextBoxColumn
: DataGridViewColumn
{
public CustomDataGridViewTextBoxColumn()
: base( new CustomDataGridViewTextBoxCell() )
{
}
}You can now use the new column type in your code as a replacement of the stock DataGridViewTextBoxColumn (the new type appears in the drop down lists for column types in the designer dialogs of the DataGridView control).
A demo project is available here, showing a DataGridView with a normal DataGridViewTextBoxColumn and the CustomDataGridViewTextBoxColumn next to each other, so you can compare the different behaviors.
-
Need a New Year's Resolution? What about User Groups?
You are a developer by passion. You are interested in new technologies, even in your spare time. You are driven to keep your skills up-to-date. You are reading blogs, maybe you are writing a blog yourself.
But something is missing.
The developers around you are different, and you can’t even blame them. Maybe they are busy building a house, their children are keeping them on their toes, a non-computer hobby eats away their spare time – or they are simply working crazy hours and need a well-deserved rest when they get home.
You would like to get in touch with other developers. The Internet offers a huge number of possibilities to get connected to people all over the world, but let’s be honest, nothing beats meeting “real” people.
Have you thought about joining a .NET user group?
At a .NET user group, you’ll find a wide variety of people, coming from different backgrounds, with vastly different skills and experience levels, all united by the common interest in .NET technologies. Most user groups are having regular (e.g. monthly) meetings, where talks are given by members or external speakers – this is were you meet real people, not online personae.
A good place to find out whether a user group exists in your area is the website of the International .NET Association (INETA) at www.ineta.org. Choose your region and start looking for a nearby user group. If you find a group in your area, things are really easy: go to their website, get in contact and visit one of their meetings.
If you are wondering whether you are a “user group person”: Don’t be shy or too critical of your own skills – a user group meeting is not a place where you have to prove yourself in any way. If you prefer sitting quietly in the back, you can do just that. Nobody will force you to become a speaker the minute you enter the room.
Here are a few tips for your first meeting. These are pretty obvious, but being a user group leader myself I have my fair share of experience with first time visitors:
- Don’t be late (yes, duh). Note that coming late can be a major annoyance, e.g. if the meeting takes place in a company meeting room, where somebody may have to pick you up at the entrance.
- Come a bit earlier so you can talk to the user group leader or the person you had contact with, or other members. Don't be way too early as that will most likely disturb the preparations (setting up equipment etc). The best thing is to ask your contact for when other members usually start to show up.
- Prepare a short introduction you can use when talking to other people – who are you, what are you doing, what are your interests. You don’t want to drive home thinking “dang, I should have mentioned I’m very interested in technology X” given the chance that somebody else could have started a conversation “hey, I’m using X, too… what tools are you working with?”.
- Avoid being under time pressure. Depending on the user group and their meeting location, group members may go to a bar or a restaurant after the “official part” of the meeting. Plan for enough time to join them, it’s the best thing you can do to get in contact with other people.
But what if the next user group is too far away?
Have you thought about founding a .NET user group?
So you didn’t find a user group near where you live. Of course you could wait until a group is founded by somebody else. That’s what I did for almost a year before I eventually founded a group myself in Bonn, Germany called Bonn-to-Code.Net (yup, pun intended, all credits go to my buddy Jens Schaller) – that was exactly one year ago on January 1st, 2006.
A couple of tips for building a user group:
- Find a meeting location. Sure, you can found a group first and take care of the location later on (maybe hoping that somebody else has a room to offer), but obviously you are in a much better position with a proper location. I had luck that I could convince my employer (Comma Soft AG) to provide the meeting rooms complete with beamers and a sound system. To convince your employer, write up a list of
- risks, e.g.
- Developers from other companies could benefit from specific internal know-how that took a long time to develop
- Skilled employees are more visible outside the company and thus could be lured away
- and opportunities, e.g.
- Generating an influx of know-how and new ideas
- Providing a venue to show that this company is a cool place to work at, and getting it known among developers (especially developers that share a certain level of “energy” in contrast to people with a 9–5 mindset)
- risks, e.g.
- How to determine which topics of everyday work company employees can talk about at meetings (if you find it easily on Google, it's not a trade secret)
- How to make sure nobody can wander freely inside the company building (e.g. accompanying people to the restrooms)
- How to make sure no computer of an external person is hooked up to the network
- Build a website. Lots of what can be done wrong here…
- For a start, keep it simple. Don’t dream up what could be done with forums, wikis and blogs; you’d need a critical mass that’s hard to reach on the Internet, let alone in the context of a local user group.
- It’s all about content. It doesn’t matter if you start with a website consisting of a single page whipped up in FrontPage if it’s updated on a regular basis – even if it’s just a blog-style report describing the process of founding a user group. Long-term solutions can be searched for after the first meeting(s).
- Remember that user groups are about people. Too many user group websites make it hard to see that. Who are you? What are your interests?
- Don’t try to “sell” too hard. Yes, there are benefits for the members of a user group (e.g. rebates on software licenses and/or books, see the INETA website for more on that), but that shouldn’t be the focus. You are not looking for customers you have to convince, you are looking for a bunch of devs coming together and having some fun.
- Advertise the group.
Use everything at your disposal: your blog (if you have one), community websites like codezone.com/de, etc. Create flyers, posters – whatever comes to your mind. - Take a look at what INETA offers
On the website you’ll find information on how to start a .NET user group, how to apply for (free) membership, etc. Don’t expect miracles from INETA, but founding a user group and not contacting INETA is plain dumb. - Plan the first meeting. There are multiple approaches to a first meeting, two I have witnessed myself (in Bonn and at the neighbour group in Cologne, DNUG Köln) are:
- Let people introduce themselves and get to know each other
In Bonn, the first meeting consisted mainly of short introductions on two or three PowerPoint slides. Obviously, this approach doesn’t scale well beyond let’s say 15 people, but looking back this really gave the group a jump start in terms getting to know each other. The evening did not offer any technical content, but dealt with planning future meetings, deciding on topics, etc. - Start with a “big bang”
In Cologne, the first meeting had a well-known conference speaker giving a talk. There was no time for really speaking about organizational issues, and after the event, the speaker was the focus of attention. Nevertheless, the Cologne group is now running successfully. Starting “big” attracted people who otherwise wouldn’t have shown up (by their own honest account), many of them still being members.
- Let people introduce themselves and get to know each other
- Make sure you have a rough idea for the second meeting. Maybe you are lucky to you have a bunch of “natural born speakers” in your group, eager to give talks. If that is not the case (or if you don’t find enough material for a full evening), have a plan B up your sleeve, i.e. a talk that you could give. Note that your primary goal must be to get other people involved as quickly as possible, which brings us to the next point.
- Lower the entry barrier for contributions. Preparing a talk takes time and effort, which may put people off. There are things you can do to encourage contributions:
- Offer a PowerPoint template
Make it easy to author PowerPoint slides that “fit in”, i.e. have a certain “official user group feel” for those that are not comfortable developing their own design or using a stock template shouting “look at me, I’m a PowerPoint n00b”. - Introduce the concept of a “QuickTip”
Don’t require each talk to be of same length and depth. Sometimes just a hint on a single hotkey, a small tool or a cool website can be enough for the visitors of the meeting to drive back home with a positive feeling. At Bonn-to-Code.Net, a “QuickTip” consists of just a few slides: what’s the problem, what’s the solution, and a short demo (sometimes maybe even just a screenshot).
- Offer a PowerPoint template
New year’s resolutions are about changing something in your life. If you get involved in a user group, you life will change – be it just a little bit (just coming to meet other developers), a little bit more (taking the plunge and contributing a talk here and there), or a whole lot more (founding and running a user group). Whatever you do, be assured you’ll have lots of fun.
-
How to Set the CSS Class on an HtmlElement Instance from C#
I’m currently using the WebBrowser control in a WinForms application as a simple layout engine, as it’s much faster when rendering texts in front of a background image than WinForms (and I need it by the weekend, so I don’t want to take the risk of using it as a learning project for WPF). For my purposes I only need to manipulate some texts – and the CSS class of specific elements on the page.
Now let’s assume you have an DIV tag in your HTML like this:
<div class="someClass">Hello World</div>
and you want to change the CSS class from your C# code. It’s pretty easy, you just have to get a
HtmlElement
instance representing the tag and use theSetAttribute
method. What took me some time to figure out is the problem that if you callmyHtmlElement.SetAttribute("class", "anotherClass");
nothing will happen in the display of your page. The reason for this is that SetAttribute does not actually “set an attribute of a tag”, but a property (representing the attribute) on an object (representing the tag) in the Document Object Model (DOM) – and the property’s name is “className”, not “class”. So the correct code is
myHtmlElement.SetAttribute("className", "anotherClass");
(If you're wondering why SetAttribute didn't complain about using the name "class": the DOM was primarily designed to be used from Javascript, which is a language where any object can be extended by simple setting a property. Sounds a bit strange, but it’s also a feature that can be used for seriously cool stuff)
-
Article "Introduction to GhostDoc" up on DotNetSlackers
Some time ago Sonu Kapoor, webmaster of dotnetslackers.com, asked me to write an article about my Visual Studio add-in GhostDoc. It took me some time to find an empty spot in my busy schedule, but the article is now finally online. It is an introduction to GhostDoc that may be interesting for those who haven’t tried GhostDoc yet and would like to read a bit more about the features before actually downloading and installing it.