Tuesday, December 26, 2006

u can't connect the dots looking forward, u can only connect them looking backwords

Watch Apple CEO Steve Jobs talking about his story:


Monday, September 18, 2006

Organize your Settings

The trick that might not been famous, is that we can add multiple settings to a single VS2005 project; this will make organizing settings into groups more useful from a programming point of view or an administration point of view.

Let's say that we have a project with more than 30 entries in its Settings designer, managing this huge number of settings might lead to some errors.

Why not split those settings into groups, for example AdminSettings and OperationSettings.

By default a VS2005 project ca have one settings class auto-generated by the settings designer; this class will get the name Settings. We can get rid of this class or leave it and add one or two other by Selecting New Item from the Add menu.

Then we can select the Settings File and name it what ever we want.

We can then use drag and drop to move the newly added settings to the Properties folder

Doing this, we will maintain all settings in the Properties folder,hence to get the name space Properties for all our settings.

Sunday, July 16, 2006

Using the AutoComplete feature in .net 2.0 with a custom source

The .net 2.0 Windows forms TextBox control introduces a new auto complete feature, like that in IE when we try to type a recently visited URL

This feature allow for auto complete of strings from a certain standard sources like File System and IE History List, but it also allow for a custom source to be used as the source of strings to be auto completed

The custom source can be a list of strings added in runtime by setting the AutoCompleteCustomeSource property, or at runtime by setting this property to an AutoCompleteStringCollection instance.

We should set the AutoCompleteSource to CustomSource first and then set the AutoCompleteCustomeSource property.

private void Form1_Load(object sender, EventArgs e)

AutoCompleteStringCollection names = new AutoCompleteStringCollection();

textBox1.AutoCompleteSource = AutoCompleteSource.CustomSource;
textBox1.AutoCompleteCustomSource = names;


Saturday, July 15, 2006

Viewing Shape files using GoogleEarth

I had some shape files and I wanted to show them on GoogleEarth, I couldn't do this directly as GoogleEarth supports only KML (Keyhole Markup Language) file format.

I thought that it will be easy to convert shape files to KML, and I was right, … thanks to Tim Beermann.

He developed a tool to convert a shape file to KML file, he used completely open-source tools to develop his converter, and also he sharing it freely.

Download Shape2Earth Beta 2

Tuesday, July 04, 2006

Happy new year to me in ITWorx

I am now 1 year old in ITWorx, Am I happy? Or what … here is my feelings

I am happy for:
  • The new people I worked with.
  • The new methodology of development I am getting used to.
  • The new technologies I have learned: .net 2.0 ,VS2005, Third party UI libraries, Windows Services, RSS, SharePoint, Exchange Server WebDAV and CDO development, Telephony APIs, Remoting , MSMQ , XSLT, Unit Testing, Build management …
  • ITWorx itself :I am more than happy and proud of myself joing it,why not and others name it Most Exciting Company

While I have some other feelings because:

  • Working in a large company exposes you to a wide competition: who you are in 400+ employees!!
  • Working in dynamic projects with fast moving feature set and adaptation to more and more new technologies put you in a stress: running for new information, learning very fast, how to decide if you need to scratch the surface of a topic or go deeply into details.
  • Being in situations which not only your technical level that decide your career future; it is your personality, your skills in communicating with people, your ability to show up your self and being able to negotiate and debate.

    More feelings coming soon …

Friday, June 23, 2006

[DotNetNuke] : Conusme your own RSS feeds

DotNetNuke has the ability to generate RSS feeds for many of its modules, just by enabling the Syndication option in the module settings, although this will not guarantee that the RSS feeds will not be up-to-date. [*]

Those feeds are important for many users who will be interested to get updates only without visit your site regularly.

RSS feeds can be useful for the site itself; in situations when you need to show the same information with different views, for example; an announcement module show its contents in a list, but doesn’t show the headlines as a marquee.

One solution is to consume the RSS feeds generated by the announcement module, and transform it into a marquee using a simple XSLT template, thanks to the XML/XSL module.

So, you are consuming your own feeds to show a piece of information into different views without the need to develop new modules.

Note: RSS feeds are not up-to-date.

I have faced the problem of RSS feeds are not uptodate,or not generated completely , but I have found a solution on dotNetNuke forums. I am not sure which of the following steps are the real cause of the problem, I have done them all.

  • The Page that host the module should be View ALL for Users
  • The module : should allow syndication, has no expiration date [not just set to 9999]
  • The Re-index command from Host\Search Admin ; should be called after you place the module on the page
  • The following task should be running and enabled :
    - DotNetNuke.Services.Cache.PurgeCache, DOTNETNUKE
    - D
    otNetNuke.Services.Search.SearchEngineScheduler, DOTNETNUKE
DotNetNuke Forum post

Wednesday, January 25, 2006

A VS2005 macro to measure the length of string laterals in the code editor

The following macro, is a Visual Studio macro to measure the length of string laterals in the code editor.

Highlight the string and run the macro, a message box will show the length

Sub MeasureStringLength()
Dim ts AsTextSelection = DTE.ActiveDocument.Selection
Dim msg As String
msg = String.Format("{0}{1}{2} char(s)", ts.Text, ,vbCrLf ts.Text.Length)


End Sub

How to use
1. Select a string in the Code Editor

2.Run the Macro

3.See the Msessage Box with the length

It is also easy to assign the macro to a custome toolbar button in VS2005, or give it a Keyboard short cut

Tuesday, January 17, 2006

RTF to HTML using C#

I have searched for a code snippet or an (.net) open source utility to convert an RTF string into an HTML string

Many stuff are there, but all has some limitations to what I need exactly.

Here is some of the search result

ExRichtextBox with lite HTML

Use IRichEditOle from C#

Insert Plain Text and Images into RichTextBox at Runtime


The HtmlEditor - a C# control that wraps MSHTML

MSWord Automation Converting RTF to TXT format

Copy as Html (VS Add-in)

VB.net function to convert rtf to html