Find out how classes are defined and new instances are created, how to define Properties, and how to both set values and get values for a given instance of the class. A class is a construct that enables you to create your own custom types by grouping together variables of other types, methods and events. A class is like a blueprint. It defines the data and behavior of a type. If the class is not declared as static, client code can use it by creating objects or instances which are assigned to a variable.
Abstract class provides a common definition of a base class that many derived classes can share.
The abstract keyword enables you to create classes and class members that are incomplete and must be implemented in a derived class.
- An abstract class cannot be instantiated.
- Derived classes of the abstract class must implement all abstract methods
Abstract class can be declared in C# using the keyword abstract as shown in the example below:
There are different ways in C# to convert a String variable to an Integer. Following are the different methods you can use to convert String to Int. One is you can use the ToInt32 method from the Convert Class to do this conversion.
An attached property is a concept defined by Extensible Application Markup Language (XAML). An attached property is intended to be used as a type of global property that is settable on any object.
Represents a property that can be set through methods such as, styling, data binding, animation, and inheritance
Partial Class is a cool feature in C# which enables you to split you implementation of a class, struct or an interface over two or more source files.
When do you want to use a Partial Class?
I had to create a Setup Project to be able to deploy the our .Net Application to the SIT environment. Had to decide between the Default Installer that comes with Visual Studio and the Install Shield Limited Edition, which also comes free with Visual Studio 2010. Personally I think Install Shield is better than the default Windows Setup Project that comes with Visual Studio, but for some reason I had to choose the Visual Studio Setup project .
If you develop in .Net using C# and wondered if you can have a tool which will help you in logging, here is a list of tools available. Having a good logging for your application will help you to avoid many headaches. It will help you to troubleshoot when things go wrong. Here are some Logging Tool for C#. Hope you find it useful.
Checking a String value to see if it is Empty or null is something you will come across a lot during your day to day work using C#. There are different ways to doing this check in C#. Basically there are different ways you can do this. String is a reference type so you can check if it is null. Also you can check for an empty string (“”) or check the length of the string and see if it is zero.
How to Check null in C# (C Sharp)
If you have been developing application using C#, I am sure you would have come across a situation where you have to find the Application Directory Path.
There are many ways to get the Application Directory in your C# Application. I have listed below some of the ways you can accomplish this.