Feeds:
Posts
Comments

Archive for the ‘Uncategorized’ Category

Since ASP.NET 2.0 compilation is different than the previous ASP.NET 1.x model, it is not obvious for web developers where are the DLLs to which the FxCop should be pointing to for analysis.

I have recently found this simple and effective solution posted  http://www.madskristensen.dk/blog/Use+FxCop+With+ASPNET+20.aspx.

In the post you will see steps of how to do it.

What he suggests in simple words is to publish the web site to a folder which will make the visual studio copy the DLL files there and then point the FxCop to the DLLs there.

Note: if using the Visual studio team suite, no need to worry about this as the built in code analysis tool handles this issue transparently.

FxCop home page and downloads can be found at http://www.gotdotnet.com/Team/FxCop/

Read Full Post »

It is not allowed to have overloaded web methods. Trying to do so will not result in compile error but will generate a runtime error saying something like “Error: two methods having name”.

 

A possible workaround for this situation is to use the MessageName Property for the webmethod Attribute.

Example:

The following Code will cause errors

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

[WebMethod]

public string GetStatus(string username)

{

return “status1”;

}

[WebMethod]

public string GetStatus(int userId)

{

return “status1”;

}

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

 

A possible solution could be :

 

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

[WebMethod(MessageName=”GetStatusByName”)]

public string GetStatus(string username)

{

return “status1”;

}

[WebMethod(MessageName=”GetStatusById”)]

public string GetStatus(int userId)

{

return “status1”;

}

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

Read Full Post »

In order to automatically scroll to the end of a text box in a windows forms, simply add the following code.

this.txtResults.Text += “\r\n” + newLineData; // newLineData is string added as new line
this.txtResults.Select(this.txtResults.Text.Length, 0);
this.txtResults.ScrollToCaret();

where txtResults is the textbox in question.

Also you need to make sure that the textbox is a multiline AND it has a vertical scroll bar.

That simple code will make the text automatically scroll to the end of the text box.

Read Full Post »

VS 2005 SP1 released

Visual studio Service Pack 1 has been released.

http://msdn.microsoft.com/vstudio/support/vs2005sp1/default.aspx

You can find service pack for visual studio professional, Express and Team suite Editions.

Read Full Post »

working with my windows forms controls framework, I discoverd a very weird thing about numericUpDown controls.

In my framework, to make sure that all controls are “valid” according to certain criterias, I used a recursive method to get all the controls inside the form.

N.B. If you have a windows form holding 1 panels , each panel has 10 controls. If on the form object you use
this.controls.count , you will get ONE not 11. As the controls.count gets ONLY the controls in the first level and it is not recursive.

so back to the numericupdown control. I discovered that the numericupdown is a “composite” control. meaning it is a combination of a textbox and another control called updownbase.

Unlike textbox, combobox, radio buttons, etc. , the numericupdown is tricky in this part.
If you have a recursive function getting the controls in a form: for a numericupdown you will get TWO controls not just one.

So I think this control needs to be treated carefully in any case where you need to loop on the controls in a form.

Read Full Post »

According to Steve McConnell famous book “rapid Development” he stated that:

“Uncontrolled problem employees. Failure to deal with problem personnel also threatens development speed. This is a common problem and has been well-understood at least since Gerald Weinberg published Psychology of Computer Programming in 1971. Failure to take action to deal with a problem employee is the most common complaint that team members have about their leaders (Larson and LaFasto 1989). In Case Study 3-1, the team knew that Chip was a bad apple, but the team lead didn’t do anything about it. The result—redoing all of Chip’s work—was predictable.”

From my experience, i found that the problem is much more than that. It has a very bad phsycological effect on all team players. they feel all their hard work is washed away by this person(s).

Read Full Post »

I was looking for a way to read from MANY configuration Files rather than only one as provided by .NET framework(appName.exe.config). this is because i wanted to make a configuration file to set the Colors and fonts of the Forms, another to hold the system Messages and so on.

Looking in codeproject.com http://www.codeproject.com/csharp/AnyConfig.asp?df=100&forumid=29847&exp=0&select=706263 i found this great code about how to do this with ease.

This class extends System.Configuration.AppSettingsReader and works very simply: just give him the config file name and then read the element you want.

Read Full Post »

NUnit

I have started making some unit tests to test some advanced combinations of Rules.

Showing this handy tool to the QA team made them quite excited.

Read Full Post »

« Newer Posts