The blog has moved to a new address. The blog is now located at http://devintelligence.com

Adsense

Wednesday, May 17, 2006

HitTestInfo Overview

Sometimes in applications you may need to recognize which element is located at the specified screen coordinates. For instance, you may have to determine which part of a DataGridView the user has clicked or double-clicked. For this purpose, DataGridView implements the HitTest method.

For demonstrative purposes on how to process data provided by a HitTestInfo object, you can make use of the following example. It handles the DataGridView.MouseMove event and shows information about a part under the mouse cursor.

private void dataGridView1_MouseMove(object sender, MouseEventArgs e)

{

System.Windows.Forms.DataGridView.HitTestInfo hitInfo = dataGridView1.HitTest(e.X, e.Y);

this.listBox1.Items.Clear();


// displaying dataGridView related information defined a point under the mouse cursor

listBox1.Items.Add("Point: " + new Point(e.X, e.Y) );

listBox1.Items.Add("Type: " + hitInfo.Type.ToString());

listBox1.Items.Add("ColumnIndex: " + hitInfo.ColumnIndex);

listBox1.Items.Add("RowIndex: " + hitInfo.RowIndex);


if (hitInfo.ColumnIndex != -1)

{

DataGridViewColumn column = dataGridView1.Columns[hitInfo.ColumnIndex];

listBox1.Items.Add("Column Caption: " + column.DataPropertyName );

}

else

{

listBox1.Items.Add("No Column");

}


}

Technorati : , , , , ,
Ice Rocket : , , , , ,

Sample of Using HitTestInfo Object

The following sample demonstrates how to implement the grid row's popup menu. This menu has only one item, which deletes the row that the menu has been called for. The HitTest method is called to obtain the row position. Selection is then moved to this row and the custom context menu called.


private void dataGridView1_MouseDown(object sender, MouseEventArgs e)

{

System.Windows.Forms.DataGridView.HitTestInfo hitInfo = dataGridView1.HitTest(e.X, e.Y);


if ( (hitInfo.Type == DataGridViewHitTestType.Cell) &&

((e.Button & MouseButtons.Right) != 0) )

{

// switch selection

DataGridViewRow selectedRow = dataGridView1.Rows[hitInfo.RowIndex];

selectedRow.Selected = true;




//show the context menu

ContextMenuStrip contextMenu = new ContextMenuStrip();

contextMenu.Items.Add("Delete Row", null, new EventHandler(DeleteSelectedRow) );

contextMenu.Items[0].Tag = selectedRow;

contextMenu.Show(this.dataGridView1, e.X, e.Y);

}

}




private void DeleteSelectedRow(object sender, EventArgs e)

{

ToolStripItem menuItem = sender as ToolStripItem;

if (menuItem != null)

{

dataGridView1.Rows.Remove(

(DataGridViewRow)menuItem.Tag

);

}

}

Technorati : , , , , ,
Ice Rocket : , , , , ,

UML Resource List

Collection of UML links


O'Reilly - Learning UML v2.0 Apr 2006
Understanding UML Wiki
Understanding UML Blog

Technorati : , , , ,
Ice Rocket : , , , ,

IDE for your thoughts - wikidPad

"wikidPad is a wiki-like notebook for storing your thoughts, ideas,
todo lists, contacts or anything else you can think of that's
important. What makes wikidPad different from other notepad or
outliner applications is the ease with which you can cross-link your
information."


WikidPad Features

  • On the fly WikiWord linking, as you type
  • WikiWord auto-completion
  • Easy WikiWord navigation
  • Wiki text styling
  • WikiWord History
  • Wiki document attributes
  • Dynamic views
  • Tree/Outline view with over 100 icons
  • Todo lists
  • Incremental search
  • Search and Replace
  • Autosave
  • Export to HTML
  • All your data is stored in plain text
  • URL and file linking
  • Intuitive keybindings
  • Help Wiki included

Visit the project homepage

Technorati : , , , , ,
Ice Rocket : , , , , ,

Tuesday, May 16, 2006

Microsoft's new open source hosting solution - CodePlex.

CodePlex is an online software development environment for open and shared source developers to create, host and manage projects throughout the project lifecycle. It has been written from the ground up in C# using .NET 2.0 technology with Team Foundation Server on the back end.

Features:

  • Release Management
  • Work Item Tracking
  • Source Code Dissemination
  • Wiki-based Project Team Communications
  • Project Forums
  • News Feed Aggregation

Visit CodePlex

Technorati : , , , ,
Ice Rocket : , , , ,

Universal Debugger Visualizer in Visual Studio 2005.

Visual Studio 2005 shipped with a very helpful feature called debugger visualizers.Debugger visualizers allow you to view useful information about objects during debug.This visualizer is helpful for anyone writing an application and want to view or change objects properties during runtime.


using System;

using System.Collections.Generic;

using System.Diagnostics;

using System.Text;

using Microsoft.VisualStudio.DebuggerVisualizers;

using System.Windows.Forms;

using System.Drawing;



namespace Devintelligence.Debug

{


/// <summary>

/// Visual Studio visualizer for viewing objects

/// in PropertyGrid during debug.

/// </summary>

public class UniversalVisualizer : DialogDebuggerVisualizer

{

protected override void Show(IDialogVisualizerService windowService,

IVisualizerObjectProvider objectProvider)

{


object data = objectProvider.GetObject();

using (Form form = new Form())

{

form.Text = data.GetType().FullName;

form.ClientSize = new Size(230, 300);

form.FormBorderStyle = FormBorderStyle.FixedToolWindow;


PropertyGrid propGrid = new PropertyGrid();

propGrid.SelectedObject = data;

propGrid.Parent = form;

propGrid.Dock = DockStyle.Fill;


windowService.ShowDialog(form);

objectProvider.ReplaceObject( propGrid.SelectedObject );

}

}


// TODO: Add the following to your testing code to test the visualizer:

//

// UniversalVisualizer.TestShowVisualizer(new SomeType());

//

/// <summary>

/// Tests the visualizer by hosting it outside of the debugger.

/// </summary>

/// <param name="objectToVisualize">

/// The object to display in the visualizer.</param>

public static void TestShowVisualizer(object objectToVisualize)

{

VisualizerDevelopmentHost visualizerHost =

new VisualizerDevelopmentHost(objectToVisualize,

typeof(UniversalVisualizer));

visualizerHost.ShowVisualizer();

}

}

}


I overrode the method Show. This method gets two parameters: objectProvider holds a serialized copy of the debugged object we want to view or change properties, windowService allows us to show a dialog form under the context of the Visual Studio IDE. In this method, I created a form with a property grid and loaded the object into it.

Here's screenshot of the Universal Visualizer in action.
Universal Visualizer

Technorati : , , , , , ,
Ice Rocket : , , , , , ,

PS Hot Launch

PS Hot Launch

PS Hot Launch lets you open multiple programs, documents, folders, and web sites with the click of your mouse or by defining keyboard shortcuts.

This type of program is perfect if you find that you always need to launch multiple applications when you are getting started with different tasks.




Features:

  • Quick launch of programs from the menu in the system tray.
  • Quick launch of programs using hot keys.
  • Logical grouping of commands.
  • Using separators to make the menu handier.
  • Quick and handy set-up using drag&drop


Download PS Hot Launch

[Via LifeHacker]

Technorati : , , ,
Ice Rocket : , , ,

Monday, May 15, 2006

Easy Picture2Icon

Easy Picture2Icon is a wonderful tool for converting images or digital photos in to Windows icons. Easy Picture2Icon make it possible to use any graphical editor to produce icons.Easy Picture2Icon has support for making transparent icons and the user can choose which color to make transparent. With this picture to icon converter it is possible to make icon files that contain multiple icons of different sizes.

Features:

  • Images formats that can be converted to Windows icons (.ico files) are:
    BMP, GIF, JPEG, PNG
  • True color icons.
  • Single image icon file.
  • Multiple icons in one Windows icon file.
  • Transparent color icons.
  • User choused transparent color.
  • Image edge cutting to fit icon function.
  • Image resize to fit icon function.
  • The supported icon sizes are 16x16, 32x32 and 48x48

Download Easy Picture2Icon

Technorati : , , , , ,
Ice Rocket : , , , , ,

Sunday, May 14, 2006

Google Co-op

"Google Co-op is about sharing expertise. You can contribute your expertise and benefit when others do the same. Help other users find information more easily by creating "subscribed links" for your services and labeling webpages around the topics you know best."

Google Co-op Features:

  • Personalized search results, where you can subscribe to content providers like Digg
  • "Free AdWords" from Google for those who help refine searches
  • The "onebox" for the masses
  • Finally, cluster search results
  • A sort of semantic web, only that some of the data is stored not on your webserver, but on Google's server (an important distinction, I think - the competition can't access this meta-data, and it's a bit of a Google lock-in!)
  • Google becoming a meta search engine, an aggregator of other specialized search engines
  • Meta-keywords 2.0 - the trust is build into Google's account system to prevent spamming
  • Social bookmarking and tagging a la del.icio.us

[Via Philipp Lenssen]


Technorati : , , , , , ,
Ice Rocket : , , , , , ,

Thursday, May 11, 2006

Windows Firewall Site

A new Windows Firewall Site has been published, providing a central location for all the published resources on the Windows Firewall provided with Windows XP , Windows Server 2003, Windows Vista and Windows Server "Longhorn".

[Via Joe Davies's WebLog]

Technorati : , , ,
Ice Rocket : , , ,

Wednesday, May 10, 2006

Wait control for ASP.NET

BusyBoxDotNet is a very useful ASP.NET user control for your web pages.

"BusyBoxDotNet is an ASP.NET web control library. It is built for ASP.NET 1.1 but it is fully compatible with ASP.NET 2.0 and will soon be written especially for it.
The main control is the BusyBox control, which can be used to show a customizable box inside web pages during time consuming activities, a very useful behavior especially during long processing tasks, in order to inform the user that something is actually happening. Typical time consuming tasks are file uploads, complex queries against databases, heavy load operations in application code, or heavy pages which require some time to be rendered by the browser.
Among the new features, there's the option to show it on page loads, in case the pages takes a while to load and you want to notify the user that the loading process is still going."

BusyBoxDotNet Features:

  • Ease of integration: no need to write javascript code, stylesheets or HTML, everything is embedded in a simple drag and drop control.
  • Cross browser compatibility . Tested with actual versions of Firefox/Mozilla, Internet Explorer, Opera, Netscape Navigator.
  • Many customization options.

Get BusyBoxDotNet

Download animated images to use with BusyBoxDotNet. (1) (2)

Generate animated gifs on the fly, customizing shape, fore color and background color to use with BusyBoxDotNet. (1)

Technorati : , , , ,
Ice Rocket : , , , ,

Tuesday, May 09, 2006

Microsoft Bloggers List

[Via Blake Handler's Blog]

Technorati : , , , ,
Ice Rocket : , , , ,

Internet Logger v1.1

Save both incoming and outgoing Internet traffic (all data sent or received by browser: Internet Explorer, FireFox, Opera; email client: Outlook, Thunderbird; instant messenger: MSN, Yahoo, AOL, ICQ, Skype; media player and etc.) on the hard drive for future use.

Download Internet Logger(124 Kb)

Technorati : , ,
Ice Rocket : , ,

HTTP Debugger

Capture, analyze and debug all HTTP communications between the web browser on the client side and the web server on the other side. Internet software developers can use HTTP Debugger to analyze the communication between their programs and Internet.

Each HTTP transaction can be examined to see the HTTP header parameter values, cookies, query strings, error codes and etc. All captured network traffic can be saved either in RAW network format or decoded (how browsers see it) format.

HTTP Debugger works with all today's alternative browsers and their plugins, as well as with your own software. You can even monitor and debug ICQ, MSN, Yahoo Messenger and other popular Internet programs.

  • Monitor and debug all outgoing HTTP requests from a browser (or any other selected program) and corresponding responses from a server.
  • See the full header and content data of both: HTTP requests and responses.
  • Catch when the browser performs automatic redirects.
  • Capture requests from all of the installed plugins (Flash, ActiveX, etc.) in addition to requests sent by a browser directly. Analyze the same page in all modern browsers simultaneously.
  • Measure the size and downloading time of your web pages to optimize the performance of your web site.
  • The gzip and chunked encodings will be automatically processed by the program.
  • View information supplied by each web browser or any program when you visit a site.
  • Analyze how other sites work and how they implement certain features.
  • Learn about how HTTP works (useful for programming and web design cases).


Download HTTP Debugger (240 Kb)

Technorati : , , , , ,
Ice Rocket : , , , , ,

Monday, May 08, 2006

Refactoring Databases Website

The newly updated Refactoring Databases Website by Scott W. Ambler and Pramodkumar J. Sadalage is a excellent resource for DB developer.The authors introduce powerful refactoring techniques specifically designed for database systems.The authors demonstrate how small changes to table structures, data, stored procedures, and triggers can significantly enhance any database design-without changing semantics. You'll learn how to evolve database schemas in step with source code-and become far more effective in projects relying on iterative, agile methodologies .


DB Refactoring techniques and strategies

Add CRUD Methods
Add Foreign Key Constraint
Add Lookup Table
Add Mirror Table
Add Read Method
Add Trigger for Calculated Column
Apply Standard Codes
Apply Standard Type
Consolidate Key Strategy
Drop Column
Drop Column Constraint
Drop Default Value
Drop Foreign Key Constraint
Drop Non Nullable
Drop Table
Drop View
Encapsulate Table With View
Introduce Calculated Column
Introduce Calculation Method
Introduce Cascading Delete
Introduce Column Constraint
Introduce Common Format
Introduce Default Value
Introduce Hard Delete
Introduce Index
Introduce Read Only Table
Introduce Soft Delete
Introduce Surrogate Key
Introduce Trigger for History
Make Column Non Nullable
Merge Columns
Merge Tables
Migrate Method From Database
Migrate Method To Database
Move Column
Move Data
Rename Column
Rename Table
Rename View
Replace LOB With Table
Replace Column
Replace Method(s) With View
Replace One-To-Many With Associative Tables
Replace Surrogate Key With Natural Key
Replace Type Code With Property Flags
Replace View With Methods(s)
Split Column
Split Table
Use Official Data Source

Technorati : , , , , , , ,
Ice Rocket : , , , , , , ,

Saturday, May 06, 2006

Visual Studio 2005 Code Snippets

Code Snippets are reusable, task-oriented blocks of code.You can download the Visual C# code snippets by clicking on the categories below.


Technorati : , , , , , ,
Ice Rocket : , , , , , ,

Thursday, May 04, 2006

CSS Layout Resource

This is a collection of 40 valid CSS layouts,without hacks nor workaround and tested to work in IE, FireFox, Safari and Opera.

Technorati : , , , , , , ,

The Microsoft Consolas Font Family

The Microsoft Consolas Font Family is a set of highly legible fonts designed for ClearType. It is intended for use in programming environments and other circumstances where a monospaced font is specified.All characters have the same width, like old typewriters, making it a good choice for personal and business correspondence. Optimizing the font specifically for ClearType allowed a design with proportions closer to normal text than traditional monospaced fonts like Courier. This allows for more comfortable reading of extended text on-screen.


Download Consolas Font Pack for Microsoft Visual Studio 2005

Technorati : , , ,


Wednesday, May 03, 2006

Download the video you are watching .

Special plugin for Firefox Browser makes possible to save video from the online services to the hard disk for the local watching.

Services supported:
Youtube, Google Video, iFilm, Metacafe, Dailymotion, Myspace, Angry Alien, AnimeEpisodes.Net, Badjojo, Blastro, Blennus, Blip.tv, Bofunk, Bolt, Break.com, Castpost, CollegeHumor, Current TV, Dachix, Danerd, DailySixer.com, DevilDucky, Double Agent, eVideoShare, EVTV1, FindVideos, Free Video Blog, Grinvi, Grouper, Hiphopdeal, Kontraband, Lulu TV, Midis.biz, Music.com, MusicVideoCodes.info, MySpace Video Code, Newgrounds, NothingToxic, PcPlanets, Pixparty, PlsThx, Putfile, Revver, Sharkle, SmitHappens, StreetFire, That Video Site, TotallyCrap, VideoCodes4U, VideoCodesWorld, VideoCodeZone, vidiLife, Vimeo, vSocial, Yikers, ZippyVideos... and any other webpage with embedded objects.

Get VideoDownloader

Technorati : , , , , , ,

Software modeling platform - StarUML

StarUML is a software modeling platform that supports UML (Unified Modeling Language). It is based on UML version 1.4 and provides eleven different types of diagram, and it accepts UML 2.0 notation. It actively supports the MDA (Model Driven Architecture) approach by supporting the UML profile concept. StarUML excels in customizability to the user's environment and has a high extensibility in its functionality. Using StarUML, one of the top leading software modeling tools, will guarantee to maximize the productivity and quality of your software projects.

UML Tool that Adapts to the User

StarUML provides maximum customization to the user's environment by offering customizing variables that can be applied in the user's software development methodology, project platform, and language.

True MDA Support

Software architecture is a critical process that can reach 10 years or more into the future. The intention of the OMG (Object Management Group) is to use MDA (Model Driven Architecture) technology to create platform independent models and allow automatic acquisition of platform dependent models or codes from platform independent models. StarUML truly complies with UML 1.4 standards, UML 2.0 notation and provides the UML Profile concept, allowing creation of platform independent models. Users can easily obtain their end products through simple template document.

Excellent Extensibility and Flexibility

StarUML provides excellent extensibility and flexibility. It provides Add-In frameworks for extending the functionality of the tool. It is designed to allow access to all functions of the model/meta-model and tool through COM Automation, and it provides extension of menu and option items. Also, users can create their own approaches and frameworks according to their methodologies. The tool can also be integrated with any external tools.

Download Now! (StarUML 5.0 Official Stable)

Technorati : , , , , ,

Tuesday, May 02, 2006

GmailSync - command line backup utility

GmailSync is a command line backup utility synchronize files on your PC to your gmail.GmailSync keeps track of the backed up files therefore it only does the differential backup.

Download GmailSync

Technorati : , , , , ,

Monday, May 01, 2006

Data paging in the database (an Gentle.NET approach)

This post will show you how to do really simple data paging in Gentle.Net ORM Framework
Lets say you have 1000 rows of data and you only want to view 100 rows at a time ,
you will need to page trough the data a 10 times, each time you page you view a set of records.

User Table
The table in my example is presented in script below.This table will contain the data which will be paged.

CREATE TABLE [Users] (
[UserId] [numeric](18, 0) IDENTITY (1, 1) NOT NULL ,
[UserName] [varchar] (25) ,
) ON [PRIMARY]
GO

User class
The User class is taken from Gentle.Net manual

[TableName("Users")]

public class User

{

private int userId;

private string userName;


public User(int userId, string userName)

{

this.userId = userId;

this.userName = userName;

}


[TableColumn("UserId"), PrimaryKey]

public int Id

{

get

{

return userId;

}

set

{

userId = value;

}

}


[TableColumn(NotNull=true)]

public string Name

{

get

{

return userName;

}

}

}

Our final function will looks like this:


/// <summary>

/// Reads the user entries from underline datastore.

/// </summary>

/// <param name="pageRecords">Amount of records in the page</param>

/// <param name="page">Current page namber</param>

/// <param name="totalRecords">Total records.</param>

/// <returns></returns>

public static IList ReadUser( int pageRecords, int page, ref int totalRecords)

{


// create count query

SqlBuilder sb = new SqlBuilder(

StatementType.Count,

typeof (User));




// get total row count

SqlStatement stmt = sb.GetStatement(true);


totalRecords = stmt.Execute().Count;



// create select query

sb = new SqlBuilder(

StatementType.Select,

typeof (User));


// add sorting by UserName if nessesary

//sb.AddOrderByField(true, "UserName");

sb.SetRowLimit(pageRecords);



stmt = sb.GetStatement(true);



SqlResult sqlResult = stmt.Execute();


IList list =

ObjectFactory.GetCollection(typeof (User), sqlResult.Page(page));



return list;

}

Technorati : , , , , ,