Tuesday, 13 August 2019

Ek: Collections in C#


C# (pronounced "See Sharp") is a simple, modern, object-oriented, and type-safe programming language. C# has its roots in the C family of languages and will be immediately familiar to C, C++, Java, and JavaScript programmers. This tour provides an overview of the major components of the language. If you want to explore the language through interactive examples, try our introduction to C#tutorials.
C# is an object-oriented language, but C# further includes support for component-oriented programming. Contemporary software design increasingly relies on software components in the form of self-contained and self-describing packages of functionality. Key to such components is that they present a programming model with properties, methods, and events; they have attributes that provide declarative information about the component; and they incorporate their own documentation. C# provides language constructs to support directly these concepts, making C# a very natural language in which to create and use software components.
Several C# features aid in the construction of robust and durable applications: Garbage collection automatically reclaims memory occupied by unreachable unused objects; exception handling provides a structured and extensible approach to error detection and recovery; and the type-safe design of the language makes it impossible to read from uninitialized variables to index arrays beyond their bounds, or to perform unchecked type casts.
C# has a unified type system. All C# types, including primitive types such as int and double, inherit from a single root object type. Thus, all types share a set of common operations, and values of any type can be stored, transported, and operated upon in a consistent manner. Furthermore, C# supports both user-defined reference types and value types, allowing dynamic allocation of objects as well as in-line storage of lightweight structures.



Ek:

It's a dynamic collection of objects of a given type. It allows programmers to receive changes to collections example add, remove or update objects without an additional refresh to UI.

Example: Window with a Button, two TextBoxes and a ListView, clicking the button will add the text of the textBox to the Collection and the ListView is updated automatically.

private ObservableCollection<Object> demoCollection;

public MainWindow(){

demoCollection;= new ObservableCollection<Object>()
}

3 comments:

  1. what it helps us to achieve?

    ReplyDelete
  2. ek ke bad koi update ni ki kya?

    ReplyDelete
  3. yaha comment kr k bta do ke mere comment are hai ya nahi

    ReplyDelete