1/53
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Delegate
This is a class in .Net that encapsulates a method. It is also a reference type data type that holds a reference method.
delegate
This keyword is used in declaring a Delegate on a class
<access modifier> delegate <return type> <delegate-name> (<parameters>)
Delegate Syntax
New Keyword
This is used to instantiate the delegate
Generic Delegates
This are not bound to any specific type. These can reference a method that returns and takes parameters of different types
public delegate X DisplayOutput
Generic Delegate Syntax
Event
This is a member of a class that is fired whenever a specific action takes place.
Event Handlers
The methos that invoked when an event occurs.
public event delegate_name event_name.
Event syntax
event_name += delegate_instance;
This is the syntax for adding a delagate to an event
+=
This operator allows adding an event to the class
Add and Remove
Two event accessors that are similar to get and set accessors
Add Accessor
This registers a new subscription to an event
Remove Accessor
This unregister the subscription to an event
Collections
This is a group of objects that provides a standard set of types for storing and managing objects, this usually contains lists, linked lists, dictionaries, and arrays
Standard collections
These are found in the System.Collections namespace
Generic collections
These are found in the System.Collections.Generic namespace
ArrayList
This is a collecitons class that is known for an ordered collection of objects.
Hashtable
This class stores key or value pairs where the key represent the value in the collection.
SortedList
This class stores key or value pairs where the key values sort values
Capacity
This gets or sets the capacity of the SortedList
Count
It gets the count of the number of elements in the SortedList
Item
It gets and sets the value associated with a specific key in the SortedList
Keys
These carry the keys in the SortedLIst
Values
These carry the values in the SortedList
void Add(object key, object value)
This adds an item with the specified key and value into the SortedList
void Clear()
This is used to remove all the items in the SortedList
bool ContainsValue(object value)
If the SortedLIst contains the specified value, then it will return the boolean value true.
bool ContainsValue(object value)
If the SortedList contains the specified values, then it will return the Boolean value true.
object GetByIndex(int index)
This method returns the value of the specified index.
object GetKey(int index)
This method returns the key of the specified index
void Remove(object key)
In the SortedLIst, a key that is specified will remove its element
void RemoveAt(int index)
This is an index that is specified will remove its element in the SortedList
Stack
This represents a Last In, First Out collection of Objects
Queue
This class represents a First In, First Out collection of Objects
IEnumberable
This is an interface that allows you to loop through elements in a collection
ICollection
This is an interface that allows you to determine the number of elements in a collections and copy them in a simple array type.
IDictionary
This is an interface that provides a list of elements that are accesible via a key or value rather than an index.
List
This is a generic collection that provides an efficient and dynamically allocated array, which is commonly used to store a list of duplicate objects
List
Syntax of List
Add()
This list collection method is used to add items and is placed to the end of a list.
Remove()
This list collection method removes the specified item from the list of objects
IndexOf()
This list collection method is used to check the specified element in the specified list object
Sort()
This list collection methos is used to sort the element in the list object
Queue
This is a generic collection that represents a First In, First Out collection of objects
Queue
Syntax of Queue
Enqueue()
This method adds an element to the end of the queue.
Peek()
This will return the element at the beginning of the queue without removing it.
Dequeue()
This method removes and returns the value at the beginning of the queue
Stack
This generic collection represents the Last In, First Out collection of instances.
Stack
Syntax of Stack
Push()
This methos adds an element at the top in the stack
Peek()
This will return the element at the top of the stack without removing it.
Pop()
This method removes and returns the value at the top of the stack.