Quick Notes for easy understanding. Chapters are on C#.Net,Linq,OOPS,Design Patterns,UML,Tools for development, Databases and many others. - Sid
Tuesday, May 24, 2016
MongoDB
Monday, May 23, 2016
partial (Method)
A partial method has its signature defined in one part of a partial type, and its implementation defined in another part of the type. Partial methods enable class designers to provide method hooks, similar to event handlers, that developers may decide to implement or not. If the developer does not supply an implementation, the compiler removes the signature at compile time. The following conditions apply to partial methods:
Signatures in both parts of the partial type must match.
The method must return void.
No access modifiers are allowed. Partial methods are implicitly private.
namespace PM { partial class A { partial void OnSomethingHappened(string s); } // This part can be in a separate file. partial class A { // Comment out this method and the program // will still compile. partial void OnSomethingHappened(String s) { Console.WriteLine("Something happened: {0}", s); } } }
Saturday, May 21, 2016
Database Answer
--
With Regards-
Siddu
Please consider the environment before printing this e-mail
Wednesday, May 18, 2016
Filter an ObservableCollection with a CollectionView in C#
http://jacobmsaylor.com/?p=1270
Monday, May 16, 2016
How do you pass arguments to a Thread that you create
- static void Main()
- {
- String m = "yeahh!";
- Thread thread = new Thread ( () => PrintToConsole (m) );
- thread.Start();
- }
- static void PrintToConsole (string message)
- {
- Console.WriteLine (message);
- }
In the above example we have effectively passed m into the thread function. Any number of parameters can be passed this way.
2. Another way is to use the overloaded Thread.Start function which accepts ParamterizedThreadStart.
- string parameter = "xyz";
- Thread thread = new Thread(new ParameterizedThreadStart(PrintToConsole));
- thread.Start(parameter);
- private void PrintToConsole(object o)
- {
- String m = (String) o;
- Console.WriteLine(m);
- }
3. This is the same as (1) but the example is for .Net 4.0 Tasks
- Task.Factory.StartNew(() => SomeMethod(p1,p2,p3));
Thread Pool
Code Formater
Paste Here Your Source Code | ||||||||||||||
Source Code Formatting Options | ||||||||||||||
|
||||||||||||||
Copy Formatted Source Code | ||||||||||||||
Preview Of Formatted Code |