Documente Academic
Documente Profesional
Documente Cultură
Value type
8:04 PM
Stack
Array Method
Collection Method
Size ( Byte )
S&H
Convert.
ToCharArray() Length
Sort()
ArrayList
Sort()
Stack
ToInt32()
Clean()
Queue
Clear()
Double
Stack
IsFixedSize GetLength()
Stack
Add()
String
Variable
Heap
IsReadOnly GetValue()
Hashtable Remove()
Dynamic
Array
Rank
IndexOf()
Inset()
TrimToSize()
Reverse()
Syntax:
Using <filename>;
Using system;
Namespace <name>
{
<access specified> struct <name> // Stack
{
// Method & Variable
}
<access specified>[static] enum <name> { <variable name> = <default value>, } // Enum stack
/* Generic -> Reusability , Type Safety, Performence */
<access specified> [ [ [ abstract | sealed ] class ] | [ interface] ] <name> : <class | interface name> < generic_name > /* Class Reference Type heap */
{
/*Member Function*/
<access specifier> [static] [abstract ] <data type> <variable name> = <default value>;
/* Property */
<access specifier>[static] [abstract | virtual | sealed ] <data type> <property name>
{
Get
{
return <variable name | value>;
}
Set
{
<variable name>=value;
}
}
/* Indexer */
<access specifier> [<data type> | < generic_name > ] this [<data type> <index variable name>]
{
Get
{
return <variable name>[<index variable name>];
}
Set
{
<variable name>[<index variable name>] = value;
}
}
Public <constructor > ():base()
{
This.<variable name not parameter name>;
}
Public ~<destructor>()
{
}
C sharp Page 1
}
Public ~<destructor>()
{
}
/* Operator Overloading */
<access specifier> <class | interface name> operator <operator> (<data type> <parameter name>, )
/*Member Function*/
<access specifier>[static] [override | abstract | virtual | sealed] [<return type> | < generic_name > ] <method name> ([params] [ref | out ] <data type> <parameter name>, )
{
}
public static void Main(string[] args)
{
//Instance Class
<class name> < generic_name > <object name> = new <class | struct | enum name> < generic_name >();
<object name>.<method name>( <argument name>:<value>,)
/* Array */
<data type> [ , ] <array name> = [ new <data type>[ n ] | { <value optional>, } ]
/* Array List */
ArrayList <variable name> = new ArrayList();
Console.WriteLine();
Console.ReadLine();
}
}
}
C sharp Page 2
C#
Thursday, February 27, 2014
5:15 PM
OOPC
OOPC models real-world systems
OOPC is representation of real-world entity or object
Class made of attributes and methods
Consolidation of objects
Modularity object/class exists independent from each other via message and methods
Object can be modified without effecting the function of other object
ExtensibilityChange can be incorporated in existing system.
Makes program flexible to change
Helps in easy maintenance of software
C sharp Page 3
<Exception name>
Exception Handeling
Wednesday, April 9, 2014
11:05 PM
SystemException
ApplicatioException
Try
{
}
Catch ( <Exception name> <exception allies>, )
{
Throw caught;
Throw( new <exception class name>( <variable name> ) );
}
Catch ( Exception <E Name>)
{
}
Finally
{
}
C sharp Page 4
Exception Concept
Thursday, April 10, 2014
2:22 PM
C sharp Page 5
12:08 AM
<access specifier> delegate <return type> <D Name> ( <data type> <parameter>, );
Covariance
Contra variance
C sharp Page 6
12:28 AM
Custom Attribute
[AttributeUsage
(
AttributeTargets.Class
|.Constructor
|.Field
|.Method
|.Property
,
AllowMultiple = True | Inherited | Validon
)]
Public class <PName> : System.Attribute
{
<parameter variables>
<Constructor>(<parameters variable>){}
<property>
}
[<name>(<parameters>,<property>=<value>)]
Type <Tname> = typeof(<class or element name>);
Foreach()
Object <OAName> in <T Name>.GetCustomeAttributes(false)
MethodInfo <Mname> in <T Name>.GetMethods()
Attribute <OAName> in type.GetCustomeAttributes(true)
C sharp Page 7
Multithreading
Wednesday, April 9, 2014
11:20 PM
Monitor.Enter(<function name>|this);
<statemant>
Monitor.Exit(<function name>|this);
Lock (<function name>|this);
{
<statement>
}
C sharp Page 8
Unstarted
Runnable
Not Runnable
Dead
System.ApplicationDomain
Multithreading Method
Exception
Start()
Abort()
ThreadAbortException
Sleep()
Interrupt()
Wait()
Pulse()
Suspend()
Resume()
Threading Output
Friday, March 21, 2014
Without
Lock & monitor
12:34 AM
With Lock
With both
Waite
C sharp Page 9
With all
11:03 PM
FileStream
Method
FileInfo
Method
Attributes
Create()
Attributes
Create()
CreationTime
Delete()
CreationTime
Delete()
Text File
FileMode.
FileShare. Close()
Close()
Append
Inheritable
BaseStream. BaseStream.
Close()
Create
None
CreateNew
Read
Seek()
Open
ReadWrite
SeekOrigin.
Close()
Peek()
Seek()
CreateSubdirectory() Directory
Open()
Exists
GetDirectories()
Exists
OpenRead()
Extension
GetFiles()
Extension
AppendText()
OpenorCreate Write
ReadBoolean Begin
FullName
FullName
Truncate
ReadInt32()
LastAccessTime
LastAccessTime
FileAccess.
ReadDouble() End
Read
ReadWrite
Current
LastWriteTime
Flush()
Read()
Write()
Write
Flush()
Read()
Write()
ReadLine()
WriteLine()
Length
Name
C sharp Page 10
Name
3:44 AM
A
Stream Reader
C sharp Page 11
2q
C sharp Page 12
Theory
Thursday, April 10, 2014
5:05 AM
C sharp Page 13
2:30 PM
CH14
C sharp Page 14