| Mutable and Immutable string in C# |
|
Mutable and Immutable string in C#
Labels:
C#.Net
14 Principles on Total Quality Management
| Professional Development – Dr W. Edwards Deming’s 14 Principles on Total Quality Management Dr. Demings’s 14 principles |
|
Labels:
General
Event In C#
| Event |
| Event is a kind of Notification(Information) giving one by one object to perform task. Event handling is not possible without delegate because it is delegate who will be responsible to call Event handler which even is fired. |
Labels:
C#.Net
Partial Class In C#
| Partial Class |
| we can break a large class code into small pieces by specifying more than one class with same but with partial keyword. In that case those same name classes will not be treated as different classes so when we will made the object of the class, we will get all the method and member for all same name class. |
Method Hiding in C#
| Method Hiding |
| We can predefined the method of parent class in child class by implementing the concept of method hiding. In method hiding the base(parent) class method is predefined in child class by specify new keyword. |
Types of delegates in c#
| Types of delegates |
Single cast delegate One delegate object can call only one method, is known as single cast delegate. Double cast delegate In c# One delegate object can call more than one method in sequence ,is known as multicast delegate. |
Labels:
C#.Net
Method Parameters in C#
| Method of Parameters |
Value Parameters in C# The Value Parameters are used to pass for passing parameters into method by value. Reference Parameters in C# Reference parameters are used to pass parameters into Method by reference. Output Parameters in C# The Output parameters are used to pass results back to the calling Method. Use of Parameter arrays in C# A Method that can handle variable number of arguments,is known as parameter arrays.Parameter arrays are declared using the keyword param. Method Overloading in C# To create More than one Method with same class name but with the different parameter lists and different definitions,is known as Method Overloading. |
Labels:
C#.Net
Solve Unknown Device Issue
| Please follow the step by step procedure |
|
Labels:
.Net Framework,
.Net Framework and Tools
keyword var and dynamic
var:
var essentially asks the compiler to figure out the type of the variable based on the expression on the right hand side of the assignment statement. The variable is then treated exactly as if it were explicitly declared as the type of the expression. For example the following two statements are equivalent
Dynamic:
Dynamic is in many ways the exact opposite of var. Using dynamic is essentially eliminating all type safety for that particular variable. It many ways it has no type. When you call a method or field on the variable, the determination on how to invoke that field occurs at runtime. For example
var essentially asks the compiler to figure out the type of the variable based on the expression on the right hand side of the assignment statement. The variable is then treated exactly as if it were explicitly declared as the type of the expression. For example the following two statements are equivalent
var a = "foo";
string a = "foo";
The key to take away here is that "var" is 100% type safe and is a compile time operation.string a = "foo";
Dynamic:
Dynamic is in many ways the exact opposite of var. Using dynamic is essentially eliminating all type safety for that particular variable. It many ways it has no type. When you call a method or field on the variable, the determination on how to invoke that field occurs at runtime. For example
dynamic d = SomeOperation();
d.Foo(); // Will this fail or not? Won't know until you run the program
The key to take away here is that "dynamic" is not type safe and is a runtime operation.d.Foo(); // Will this fail or not? Won't know until you run the program
Labels:
.Net Framework,
.Net Framework and Tools
Set the process priority
Set the process priority, we can set the Process.PriorityClass property. PriorityClass is captured in the ProcessPriorityClass enumeration, which lets us set the process priority to Idle, Normal, High, AboveNormal, BelowNormal, or RealTime. Process.BasePriority is an integer value property and is read-only.
The following table shows the relationship between the BasePriority and PriorityClass values:
Note:
In Windows 98, and the Windows Millennium Edition Platform, setting the priority class to AboveNormal or BelowNormal causes an exception to be thrown.
How do I capture a screenshot of a process’s main window?
Here is one method to take a process screenshot. We will use the process “notepad” for this example. Please follow these steps:
1. Use System.Diagnostics.Process.MainWindowHandle to get the process information we require to take a screenshot.
2. Use the Windows API, SetForegroundWindow, to activate the target process.
3. Pass the window handle to the first parameter of the Windows API GetWindowRect, to get the location information of the target process.
4. Define the coordinates of the process window on the screen with the location information in step 3.
5. Use the coordinates in step 4 and Graphics.CopyFromScreen to take the screenshot.
The following table shows the relationship between the BasePriority and PriorityClass values:
| S.No | BasePriority | PriorityClass |
| 1 | 4 | Idle. |
| 2 | 8 | Normal. |
| 3 | 13 | High. |
| 4 | 24 | RealTime. |
Note:
In Windows 98, and the Windows Millennium Edition Platform, setting the priority class to AboveNormal or BelowNormal causes an exception to be thrown.
How do I capture a screenshot of a process’s main window?
Here is one method to take a process screenshot. We will use the process “notepad” for this example. Please follow these steps:
1. Use System.Diagnostics.Process.MainWindowHandle to get the process information we require to take a screenshot.
2. Use the Windows API, SetForegroundWindow, to activate the target process.
3. Pass the window handle to the first parameter of the Windows API GetWindowRect, to get the location information of the target process.
4. Define the coordinates of the process window on the screen with the location information in step 3.
5. Use the coordinates in step 4 and Graphics.CopyFromScreen to take the screenshot.
Labels:
.Net Framework,
.Net Framework and Tools