In this article, I first use a small greetingpeopleProgramI introduced the concept of delegation, what to do with delegation, and then introduced the event, and then introduced the process between delegation and event generation.CodeI made a rough
When you use C # To create a unit test run, the system automatically creates a directory, for example :"... \ waterwood source China Power Grid Monitoring System \ testresults \ waterwood source China 065_smyh065 2009-12-13 22_19_53 \ out "Run test
Let's look at the example: Hello, Baby
Code
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->Using System;
Using System. Collections. Generic;
Using System. Text;
Using System.
Code
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->Using System;
Using System. Configuration;
Using System. Data;
Using System. Linq;
Using System. Web;
Using System. Web. Security;
Using System.
Code
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->Using System;
Using System. Collections. Generic;
Using System. Linq;
Using System. Text;
Using System. Security. Cryptography;
Namespace
/// /// encryption/Decryption class /// public class EncAndDec {// encryption/decryption key const string KEY_64 = "jzw7tz8g "; // note that it is 8 characters, 64-bit const string IV_64 = "tvbzn9i7"; // note that it is 8 characters, 64-bit const
I recently modified it. It is more convenient to use it on various forms.
The code is much simpler.
However, only the top left and right sides of the window are processed.
/// /// hide the window dock class // usage // private FormDock formDock =
C # reference method parameter keywords: params, ref, and out
If you do not use ref or out when declaring a parameter for a method, the parameter can have an associated value. This value can be changed in the method, but the changed value is not
Event Origin
Let's continue to think about the above program: The above three methods are defined in the Programe class, so as to facilitate understanding. In actual application, GreetPeople is usually in a class, chineseGreeting and EnglishGreeting
Event and delegate compilation code
At this time, we have to comment out the lines with compilation errors, re-compile them, and use the reconfigurator to explore the event declaration statement to see why such errors occur:
Public event
Original article: http://blog.csdn.net/much0726/archive/2009/01/07/3725563.aspx
The Application of Log4 log component is indeed simple and practical. After comparing the log functions of the enterprise database and Log4, I personally think that Log4
In daily development, you often need to open a modal form, select an item in the modal form, and assign the ID or Name to the form that opens the modal form ......
In the Windows client, it is very simple to implement such a function, and the code
For this topic,
Delegates, Events, and Lambda Expressions can be used for in-depth analysis.
C # vs C ++: The delegate vs function pointer compares the difference between the delegate and the C ++ pointer.
The delegate in. NET is indeed very similar
Introduction
Delegation and events are widely used in. Net Framework. However, it is not easy for many people who have been in contact with C # for a long time to better understand delegation and events. They are like a hacker. People who have
Today, I mainly want to write my own recent understanding about c # delegation and events. I am not familiar with this issue. I can discuss it together. (You are welcome to give different comments and opinions ).
1. Delegate
1.. net implements the
What is an event? EVENT? Click Event? Load events? A series of vague concepts impact our weak head
Let's take a look at the more orthodox ideas:
An event is a way to provide notifications when something is concerned with it.
Generally, events
Before talking about delegation and events, I would like to ask you a very simple question. Maybe in our daily programming, we usually encounter problems every day, but often don't know anything about it, run the following code:Protected void
// Introduce the rule mode to separate work// Apply dependency injection to allow the "execution" to be completed by the injected instance.// In this way, the new work is completed independently, where to use and where to modifyUsing System;Using
Delegation is a very important part in C #. When will it be used? Or how do we understand this concept?
C # The delegate can be regarded as a method reference or a method pointer. The biggest difference between it and the function pointer used in c +
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service