- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 34494 Articles for Programming
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
116 Views
To provide properties to other components, the extender provider is used. Let’s consider an example of a TooTtip component.You add the component to a form. This sets a ToolTip property to every control. The same property is not under the attacked PropertyGrid control.myTooltip1.SetToolTip(btn1, "This is ToolTip!");Let us see how to implement extender provider component −Firstly, define a component −public class MyExtender : IExtenderProvider {...}IExtenderProvider definition −public interface IExtenderProvider { bool newExtend(object extendeNew); }Now you need to implement the newExtend method. This is done to return true for every related component or control.
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
1K+ Views
A delegate that holds a reference to more than one method is called multicasting delegate.Let us see an example −Exampleusing System; delegate void myDelegate(int val1, int val2); public class Demo { public static void CalAdd(int val1, int val2) { Console.WriteLine("{0} + {1} = {2}", val1, val2, val1 + val2); } public static void CalSub(int val1, int val2) { Console.WriteLine("{0} - {1} = {2}", val1, val2, val1 - val2); } } public class Program { static void Main() { myDelegate d = new myDelegate(Demo.CalAdd); ... Read More
![Chandu yadav](https://www.tutorialspoint.com/assets/profiles/22330/profile/60_142811-1519038104.jpg)
410 Views
Increment OperatorsTo increment a value in C#, you can use the increment operators i.e. Pre-Increment and Post-Increment Operators.The following is an example −Exampleusing System; class Demo { static void Main() { int a = 250; Console.WriteLine(a); a++; Console.WriteLine(a); ++a; Console.WriteLine(a); int b = 0; b = a++; Console.WriteLine(b); Console.WriteLine(a); b = ++a; Console.WriteLine(b); Console.WriteLine(a); ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
4K+ Views
Thread pool in C# is a collection of threads. It is used to perform tasks in the background. When a thread completes a task, it is sent to the queue wherein all the waiting threads are present. This is done so that it can be reused.Let us see how to create a thread pool.Firstly, use the following namespace −using System.Threading;Now, call the threadpool class, using the threadpool object. Call the method QueueUserWorkItem −ThreadPool.QueueUserWorkItem(new WaitCallback(Run)); Iterate this in a loop and compare it with a normal Thread object.
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
1K+ Views
On Windows, the best IDE to run C# programs is Visual Studio. On Linux, the best IDE can be considered as Monodevelop. It is an open source IDE that allows you to run C# on multiple platforms i.e. Windows, Linux and MacOS. Monodevelop is also known as Xamarin Studio. It has a C# compiler to run C# programs.Monodevelop has the following features −Multi-platform IDESupports Linux, Windows and macOS.Supports multiple languagesMonoDevelop supports multiple languages such as C#, F#, Visual Basic .NET, etc.Integrated DebuggerIt comes with an integrated debugger for debugging Mono and native applications.Code CompletionCode completion support for C#, code templates, ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
1K+ Views
In a Dictionary collection, store any data type. Dictionary is a collection of keys and values in C#. Dictionary is included in the System.Collection.Generics namespace.Let us now see the best way to iterate over a Dictionary in C# −Firstly, let us create a dictionary −var d = new Dictionary(5);Now add the key and value −// add key and value d.Add("car", 25); d.Add("bus", 28); d.Add("motorbike", 17);Use orderby to order by values −var val = from ele in d orderby ele.Value ascending select ele;We have set ascending above to sort the dictionary in ascending order. You can also use descending.Display the values ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
1K+ Views
The alternative for Visual Studio IDE to run C# programs −SharpDevelopIt is an open source IDE to run C# programs but works only Microsoft Windows. SharpDevelop was developed as an alternative to Visual Studio. It is written in C#. Supports Git, SVN, NuGet, LINQPadIt is a utility that allows you to run C# programs without having an IDE. Some of the features in LINQ Pa d is paid like autocomplete and allows the user to access it only after the payment.MonodevelopIt is an open source IDE that allows you to run C# on multiple platforms i.e. Windows, Linux, and MacOS. ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
2K+ Views
Generic List is a generic collection in C#. The size can be dynamically increased using List, unlike Arrays.Let us see an example −We have set the List first −List myList = new List()Now add elements in the list −List myList = new List() { "mammals", "reptiles", "amphibians" }Now using a property let us count the number of elements added −Exampleusing System; using System.Collections.Generic; class Program { static void Main() { List myList = new List() { "mammals", "reptiles", "amphibians" }; Console.WriteLine(myList.Count); } }
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
2K+ Views
Dictionary is a collection of keys and values in C#. Dictionary is included in the System.Collection.Generics namespace.To declare and initialize a Dictionary −IDictionary d = new Dictionary();Above, types of key and value are set while declaring a dictionary object. An int is a type of key and string is a type of value. Both will get stored in a dictionary object named d.Let us now see an example −Exampleusing System; using System.Collections.Generic; public class Demo { public static void Main() { IDictionary d = new Dictionary(); d.Add(1, 97); d.Add(2, ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
237 Views
The best IDE for C# on Windows is Microsoft Visual Studio. It is an IDE to develop websites, web apps, mobile apps, etc.The following are the features of Visual Studio IDE−Code Editor − Visual Studio has a code editor supporting syntax highlighting and code completion using IntelliSense.Breakpoints − Set breakpoints and allow monitoring the variable values as the execution progress.Extend Capability − With Visual Studio, you can extend the functionality of the IDE. The extension includes macros, packages, etc.Built-in-languages − Visual Studio supports more than 30 programming languages, including C#, F#, JavaScript, TypeScript, etc.