In C# there is support for Covariance in arrays from C# version 1.0 itself. With C# 2.0 release the support for covariance and contravariance in C# has extended to delegates also. Covariance And Contravariance In C# Delegates offer benefits such as passing methods as parameters to other methods, Single delegate for multiple functions, and callback […]
How to handle File access IO exception in C#
If you are a .net programmer you may be familiar with the below-shown exception which says IO exception was unhandled, the process cannot access the file because it is being used by another process. In this article, I explain the sample code to get rid of this exception. At times, when you try to access […]
Differences Between Finalize and Dispose Methods in C# and VB.NET
This article is to give a clear understanding of the differences between Finalize and Dispose Methods in C#.This post is answer to following topics, – Finalize in C# and VB.NET – Dispose in C# and VB.NET – Finalize Vs Dispose in C# and VB.NET Managed resources are .NET objects and that are under the direct […]
Properties With Multiple Access Modifiers in C# 2.0 | Asymmetric Accessor Accessibility
In C# the member variables will be exposed by means of Properties. The get and set portions of a property are called accessors. A normal property definition in C# is as below privateintproperty1; publicintProperty1 { get { returnproperty1; } set { property1 = value; } } Here the property is public and by default, the accessors […]
What is the use of Application.EnableVisualStyles()?
The Entry point method of C# Winform application looks as below, Here [STAThread] attribute decoration is essential to mark your application state as single-threaded apartment style.For details of STAThread attribute read What STAThread Attribute does? Also check what is SetCompatibleTextRenderingDefault(false) ? Here we look into Application.EnableVisualStyles() What is EnableVisualStyles()? Application.EnableVisualStyle() method empowers the app’s visual presentation […]