TechyMedia

A .NET Technology blog | .NET,C# Progamming,C# tutorials,WPF WCF|Software Engineer

NAVIGATION - SEARCH

C# 2.0, Covariance And Contravariance In Delegates

Basic rule of thumb for a delegates is that the referenced method’s argument types and return type should match the delegate’s argument types and return types.But this rule is little relaxed with the covariance-contravariance support for delegates.
Basic rule of thumb for a delegates is that the referenced method’s argument types and return type should match the delegate’s argument types and return types.But this rule is little relaxed with the covariance-contravariance support for delegates. [More]

Friend Assembly In C#, InternalsVisibeTo attribute

If you need one assembly to access non public types defined in another assembly and even though physically separated as two assemblies for some logical reasons you can make the first assembly as the friend of the second assembly.Then the second assembly can access all the non public types of the first assembly.
If you need one assembly to access non public types defined in another assembly and even though physically separated as two assemblies for some logical reasons you can make the first assembly as the friend of the second assembly.Then the second assembly can access all the non public types of the first assembly. [More]

C# Fixed Size Buffer

In .NET normally arrays are reference types and any array declared as part of a structure doesn't physically exist inside the C# struct.Hence declaring a C++ style fixed-size structure was difficult in earlier versions of c#.In C# 2.0, it's now possible declare arrays in structure as fixed-sized inside unsafe code blocks.
In .NET normally arrays are reference types and any array declared as part of a structure doesn't physically exist inside the C# struct.Hence declaring a C++ style fixed-size structure was difficult in earlier versions of c#.In C# 2.0, it's now possible declare arrays in structure as fixed-sized inside unsafe code blocks. [More]

External Assembly Alias in C#, extern alias

If two different versions of the same assembly to be referenced or if you need to reference two assemblies that have a class which shares same fully qualified name then extern alias is used.Extern alias is an extra level of naming.
If two different versions of the same assembly to be referenced or if you need to reference two assemblies that have a class which shares same fully qualified name then extern alias is used.Extern alias is an extra level of naming. [More]

C# Namespace Alias Qualifier

Namespaces are used for logical separation of your classes and structures.In bigger projects, chances are high that same class name or structure name comes under multiple namespaces .To get rid of these ambiguity issues Namespace alias qualifier introduced in C# 2.0 which improves the readability of your code.
Namespaces are used for logical separation of your classes and structures.In bigger projects, chances are high that same class name or structure name comes under multiple namespaces .To get rid of these ambiguity issues Namespace alias qualifier introduced in C# 2.0 which improves the readability of your code. [More]

Anonymous Methods in C# 2.0, An Overview

As the name says Anonymous Method is a method without a name.Delegates are used to connect handler methods to events.Anonymous method enables you to hook the handler directly to the event without declaring and defining a delegate separately.
As the name says Anonymous Method is a method without a name.Delegates are used to connect handler methods to events.Anonymous method enables you to hook the handler directly to the event without declaring and defining a delegate separately. [More]

Properties With Multiple Access Modifiers in C# 2.0, Asymmetric Accessor Accessibility

In C# 2.0 it is possible to provide separate access specifier for get and set.For example if you only want to make a property read only from out side then you can simply make the setter as private.All available access modifiers (private,internal,protected and protected internal) can be applied as desired.
In C# 2.0 it is possible to provide separate access specifier for get and set.For example if you only want to make a property read only from out side then you can simply make the setter as private.All available access modifiers (private,internal,protected and protected internal) can be applied as desired. [More]

Nullable Types In C#

Generally value types can't have a null value assigned to it.This is always problamatic in occassons like fetching value directly from a databse to value types if the underlying value in database is null.To overcome this limit in C# 2.0 the Nullable types are introduced.Apart from its normal range of values a nullable type can have an additional null value.
Generally value types can't have a null value assigned to it.This is always problamatic in occassons like fetching value directly from a databse to value types if the underlying value in database is null.To overcome this limit in C# 2.0 the Nullable types are introduced.Apart from its normal range of values a nullable type can have an additional null value.
[More]

An Introduction To Generics In C#

Generics are type Safe,strongly typed Collections like normal arrays.Means it allows only one type of object to be stored in it and avoids the common type casting hassles of Arraylist.Also Generic collections improve the performance by overcoming the boxing/unboxing requirement.
Generics are type Safe,strongly typed Collections like normal arrays.Means it allows only one type of object to be stored in it and avoids the common type casting hassles of Arraylist.Also Generic collections improve the performance by overcoming the boxing/unboxing requirement. [More]

Iterators And Enumeration in C#

Collections(Array,List,ArrayList etc.) and traversing through collections are inevitable in software develoment. An iterator provides a means to loop through items in a collection.The iterator tells the for each loop in what sequence you get the elements.The sequence of elements is given by the implementations of the IEnumerator interface.
Collections(Array,List,ArrayList etc.) and traversing through collections are inevitable in software
develoment. An iterator provides a means to loop through items in a collection.The iterator tells the for each loop in what sequence you get the elements.The sequence of elements is given by the implementations of the IEnumerator interface. [More]