focus on event and delegate
- Events Made Simple
- Delegates and Events
- Complex Properties in C#
- Delegates and Events In C# .NET
- Events In C#
- Advances in .NET Event Handling
- Event Handling in C#
- Using Property Grid In C#
- A UITypeEditor for easy editing of flag enum properties in the property browser
- Creating Property Editors in DesignTime for VS.Net Easily (UITypeEditor Helper)
- Building a custom UITypeEditor
- Design Custom Editor For A Property
- UITypeEditor Classes
- C# Property Examples
- Asynchronous Method Invocation
- Static Class, Singleton and their Side Effects
- Static keyword in C#
- Classes
- Variables
- Methods
- Constructor
- Must Remember: 9 Key Concepts to Keyword ‘Static’
- Static Keyword Demystified
- Introducing C# 2.0 static classes
- Property Acccesor Modifiers
- UML definitions
- Introducing C# 2.0 Partial Types
- Understanding Static Methods and Data
- Object-Oriented Static Destructors
- Static Interfaces in C#
- Static Members vs Instance Members (Overview)
- What is the use of static variable in C#? When to use it? Why can't I declare the static variable inside method?
- Static Constructors (C# Programming Guide)
- What is the use of static constructors?
- Static Constructor In C# And Its Usages
- The static constructor for a class executes before any instance of the class is created.
- The static constructor for a class executes before any of the static members for the class are referenced.
- The static constructor for a class executes after the static field initializers (if any) for the class.
- The static constructor for a class executes at most one time during a single program instantiation
- A static constructor does not take access modifiers or have parameters.
- A static constructor is called automatically to initialize the class before the first instance is created or any static members are referenced.
- A static constructor cannot be called directly.
- The user has no control on when the static constructor is executed in the program.
- A typical use of static constructors is when the class is using a log file and the constructor is used to write entries to this file.
- C# | Difference between Static Constructors and Non-Static Constructors
- Overloading: Non-static constructors can be overloaded but not the static constructors. Overloading is done on the parameters criteria. So if you cannot pass the parameters to the Static constructors then we can’t overload it.
- Cases in which the constructor will be implicit: Every class except the static class(which contains only static members) always contains an implicit constructor if the user is not defining an explicit constructor. If the class contains any static fields then the static constructors are defined implicitly.
- Invoking an overloaded constructor using this keyword in C#
- Private Constructors in C#
- C# | Copy Constructor
- C# | Inheritance in Constructors
- Private Constructors (C# Programming Guide)
- Fun with Singletons in C# 2.0
- Generic Singleton Provider
- Implementing the Singleton Pattern in C#
- Private Constructor - C#
extremely good posts
Events made simple
People often find it difficult to see the difference between events and delegates. C# doesn't help matters by allowing you to declare field-like events which are automatically backed by a delegate variable of the same name. This article aims to clarify the matter for you. Another source of confusion is the overloading of the term "delegate". Sometimes it is used to mean a delegate type, and at other times it can be used to mean an instance of a delegate type. I'll use "delegate type" and "delegate instance" to distinguish between them, and "delegate" when talking about the whole topic in a general sense.
'Complex properties' and Size3D in C#.
other good posts
In this article, you will learn how to create and manipulate delegate types as well as C# events that streamline the process of working with delegate types.
Events are members of the class that raises them. When some thing happens a class can raise an event, which have a message that contain informations about the event (event arguments) and send them out to the rest of the application, other parts of the application can respond to the event by excuting methods called event handlers.
In this article we shall discuss the means in which event handlers are executed in .NET applications. This is a very important topic, because most .NET applications are event driven and mistakes and misunderstandings in event handling may cause them to work incorrectly. As will be shown, the order of execution of event handlers may become a major issue in event driven applications, especially when event handlers change the state of the object that has raised the event or changes the contents of the event arguments that are shared among handlers. Due to these interactions, application behavior may become unexpected and unpredictable, leading to errors that are hard to trace when debugging the application.
No GUI application is complete without enabling actions. Even though arranging components is of significant issue, applying actions is also equally important. It is these actions that instruct the program what to do when something happens, like for example Mouse click, Keyboard press etc. Before beginning our discussion let us review how different API's handle events.
Are you familiar with the window in Visual Studio .NET that lets you edit all your forms? You know, the one that you wish you could add to all your programs because it has such a cool interface? You know, the Property Window! Well guess what? You can add it to your windows form as part of your design and use it to allow users to edit class properties directly because Microsoft has provided it, they just don't display it initially in the toolbox.The control is called the Property Grid and you have full access to it. Simply right click on the toolbox
A UITypeEditor for easy editing of flag enum properties in the property browser.
This is a base class to help easily create UITypeEditors. It is used to edit control properties in a DropDown window or a Modal-Form in design mode in the Visual Studio IDE
If you are a Custom Control developer, you work hard provide a good design mode experience within Visual Studio.Net. One aspect to that experience is providing UITypeEditors for the Property window which lets the user manipulate your properties. Building a UITypeEditor is not difficult although it always helps to have something to start you out. This package defines two base classes for Drop Down List type UITypeEditors.
How to use .NET to call methods in a non-blocking mode.
static
This article questions the usage of singleton and static class and discusses about ways to avoid them.
static is a modifier in C# which is applicable for the following:
Article summarizes some of the key concepts around the keyword ‘Static’ which every developer must remember.
This article aims to clear the confusion regarding the use of the static keyword in C#.
A general discussion on C# 2.0 static classes.
General description of the new property accessor modifiers in C# 2.0.
This article can be used as a glossary of many RUP and UML elemnts
A general discussion on C# 2.0 partial types.
This article may be helpful for beginners of C#
In Delphi, there was always available initialization and finalization section for units. But have you ever wondered how to achieve the same using .NET?
Introducing a library (distributed as a Nuget package) that is compensating for the lack of static interfaces in C#
An overview on how Static and Instance Declaration works
I have searched about static variables in C#, but I am still not getting what its use is. Also, if I try to declare the variable inside the method it will not give me the permission to do this. Why?
A static constructor is used to initialize any static data, or to perform a particular action that needs to be performed only once. It is called automatically before the first instance is created or any static members are referenced.
Please explain to me the use of static constructor. Why and when would we create a static constructor and is it possible to overload one?
C# supports two types of constructors, a class constructor (static constructor) and an instance constructor (non-static constructor).
Static constructors are used to initialize the static members of the class and are implicitly called before the creation of the first instance of the class. Non-static constructors are used to initialize the non-static members of the class. Below are the differences between the Static Constructors and Non-Static Constructors.
C# provides a powerful keyword known as this keyword and this keyword has many usages. Here we use this keyword to call an overloaded constructor from another constructor.
Private Constructor is a special instance constructor present in C# language. Basically, private constructors are used in class that contains only static members. The private constructor is always declared by using a private keyword.
A constructor that creates an object by copying variables from another object or that copies the data of one object into another object is termed as the Copy Constructor. It is a parameterized constructor that contains a parameter of the same class type. The main use of copy constructor is to initialize a new instance to the values of an existing instance. Normally, C# does not provide a copy constructor for objects, but if you want to create a copy constructor in your program you can create according to your requirement.
In C#, both the base class and the derived class can have their own constructor. The constructor of a base class used to instantiate the objects of the base class and the constructor of the derived class used to instantiate the object of the derived class. In inheritance, the derived class inherits all the members(fields, methods) of the base class, but derived class cannot inherit the constructor of the base class because constructors are not the members of the class. Instead of inheriting constructors by the derived class, it is only allowed to invoke the constructor of base class.
A private constructor is a special instance constructor. It is generally used in classes that contain static members only. If a class has one or more private constructors and no public constructors, other classes (except nested classes) cannot create instances of this class.
This article will show you how to create generic singletons that honor all of their properties and at the same time are extensible enough to handle not so obvious scenarios.
An article describing how to use Generics to create a singleton provider.
This article describes about design pattern namely Singleton Pattern.
Here, I have described private constructor and its usage in C#. This article will be useful to both beginners and professional C# developers.
No comments:
Post a Comment