Tutorial by Topics: ion

public static ReturnType MyExtensionMethod(this TargetType target) public static ReturnType MyExtensionMethod(this TargetType target, TArg1 arg1, ...) ParameterDetailsthisThe first parameter of an extension method should always be preceded by the this keyword, followed by the identifier wi...
The only requirement for an object to be initialized using this syntactic sugar is that the type implements System.Collections.IEnumerable and the Add method. Although we call it a collection initializer, the object does not have to be an collection.
$"content {expression} content" $"content {expression:format} content" $"content {expression} {{content in braces}} content}" $"content {expression:format} {{content in braces}} content}" String interpolation is a shorthand for the string.Format() ...
Reflection is a C# language mechanism for accessing dynamic object properties on runtime. Typically, reflection is used to fetch the information about dynamic object type and object attribute values. In REST application, for example, reflection could be used to iterate through serialized response ob...
There are several kinds of collection: Array List Queue SortedList Stack Dictionary
Related: MSDN: Exceptions and Exception Handling (C# Programming Guide) MSDN: Handling and Throwing Exceptions MSDN: CA1031: Do not catch general exception types MSDN: try-catch (C# Reference)
X?.Y; //null if X is null else X.Y X?.Y?.Z; //null if X is null or Y is null else X.Y.Z X?[index]; //null if X is null else X[index] X?.ValueMethod(); //null if X is null else the result of X.ValueMethod(); X?.VoidMethod(); //do nothing if X is null else call X.VoidMethod(); Note that w...
A lambda expression is a syntax for creating anonymous functions inline. More formally, from the C# Programming Guide: A lambda expression is an anonymous function that you can use to create delegates or expression tree types. By using lambda expressions, you can write local functions that can ...
SpeechRecognitionEngine() SpeechRecognitionEngine.LoadGrammar(Grammar grammar) SpeechRecognitionEngine.SetInputToDefaultAudioDevice() SpeechRecognitionEngine.RecognizeAsync(RecognizeMode mode) GrammarBuilder() GrammarBuilder.Append(Choices choices) Choices(params string[] choices) Grammar(G...
Expression Trees are Expressions arranged in a treelike data structure. Each node in the tree is a representation of an expression, an expression being code. An In-Memory representation of a Lambda expression would be an Expression tree, which holds the actual elements (i.e. code) of the query, but ...
The process of overload resolution is described in the C# specification, section 7.5.3. Also relevant are the sections 7.5.2 (type inference) and 7.6.5 (invocation expressions). How overload resolution works will probably be changed in C# 7. The design notes indicate that Microsoft will roll out ...
Objects of type Throwable and its subtypes can be sent up the stack with the throw keyword and caught with try…catch statements. void someMethod() throws SomeException { } //method declaration, forces method callers to catch if SomeException is a checked exception type try { someMethod();...
The collections framework in java.util provides a number of generic classes for sets of data with functionality that can't be provided by regular arrays. Collections framework contains interfaces for Collection<O>, with main sub-interfaces List<O> and Set<O>, and mapping collectio...
Lambda expressions provide a clear and concise way of implementing a single-method interface using an expression. They allow you to reduce the amount of code you have to create and maintain. While similar to anonymous classes, they have no type information by themselves. Type inference needs to happ...
The NavigationView represents a standard navigation menu for application. The menu contents can be populated by a menu resource file. Before using the NavigationView you must add the design support library dependency in the build.gradle file: dependencies { compile 'com.android.support:de...

Page 1 of 78