|
|
Browse by Tags
All Tags » C# (RSS)
-
You may have to written code that checks if an object is null before you use it. For example:
Rexx.Lexer.RexxCodeStatementList list = null;string name;if (list != null){ if (list.Count > 1) name =list[1].Name;}else{ name = ''-NA-'';}
This can be abbreviated into the following code using the && ...
-
Knowing all the classes in the CodeDOM namespace isn't very useful unless one knows how to appy them. This blog entry will serve as a cheat sheet for the most commonly used expressions and statements. This page is a work in progress.
MyClass.Method(''value'', 4)
System.CodeDom.CodeExpression expr = new ...
-
The other day, in discussing the virtues of automated continuous integration with a client, I came across a few excuses for not adapting the process. The argument goes like this:
“We don’t have enough hardware resource for a build server.” “I am the sole developer so I don’t need it.”
My response for the first excuse is one ...
-
Here is a code snippet for writing information to the EventLog. This code will work in a BizTalk Expression Shape as well as in a .NET application.
if (!System.Diagnostics.EventLog.SourceExists(''BizTalkDev.Assembly.Namespace'')){ System.Diagnostics.EventLog.CreateEventSource(''BizTalkDev.Assembly.Namespace'', ...
-
Here is some code snippet to see if a user belongs to a certain security group. The code below will work with local group as well as AD groups:
Works in ASP.NET:
//Case Insensitivebool t1 = Page.User.IsInRole(''Everyone'');Works Everywhere://Case Sensitivestatic bool IsInRole(string ...
-
If you are logging information to the EventLog and getting an access error, make sure you have the following registry setting:
Launch RegEdit and navigate to: \\MyComputer\HKLM\SYSTEM\CurrentControlSet\Services\
Right Click on EventLog and click permissions.
Add the service account (application pool ID or BizTalk host ...
-
Despite its flaws and bugs, Visual Source Safe continues to be the most popular source control program in the Microsoft realm. Many poeple I talk to are not aware some of its more useful functions such as ''Pinning''. Understanding the use of pinning can be very useful in a multi-developer environment.
Use of Pinning:
Assume there are 10 ...
-
When declaring complex types in XML schema definition, I have grown accustomed to suffix the type name with ''_Type''. This allows me to easily distinguish a complex type from a global type when viewing the definition in a graphical design tool such as XML Spy. However, it has unintended consequences when incorporating such schema into a web ...
|
|
|