Please enable JavaScript.
Coggle requires JavaScript to display documents.
ADVANCED_1 - Coggle Diagram
ADVANCED_1
GENERICS
Using
System
Collections
Generic
Creating
class GenericList<T> {}
void Add(T value} {}
T this[int index] {}
MultipleParams
class SomeClass<TKey, TValue> {}
Method
NonGeneric-Cls
void Add<T>(T value)
Constraints
Method
void Add(T val) where T :
IComparable, IOther {..}
Class
class GenericList<T> where T :
IComparable {..}
Types
Interface
IComparable
ClassOrChild
SampleClass
ValueType
struct
RefType
class
WithDefault
Constructor
new()
EXTENSION-MTHD
Adding
ExistingClass
Methods
Create
static Class
StringExtensions
Method
string Shorten(..)
this String str
int numOfWords
public static
Static
Trick
Store-In
Namespace
Which-Is
Extended
System
For
StringExtensions
Trouble
Not-works
When
Method
Created
In-Update
Suggestion
Change
SourceCode
Create
ChildClass
AddMethod
AtLast
Use
ExtensionMthd
Storing
In-Scope
SameNamespace
Import-It
LAMBDA
Syntax
args => expression
No-Args
() => exp
1 arg
x => exp
ManyArgs
(x,y,z) => exp
Assign
To-Delegate
Func<int, int> square =
num => num*num
Predicate
Is-Delegate
Pointing
ToMethod
Returns
Boolean
obj.FindAll(..)
b => b.Price < 10
DELEGATES
EVENTS