Category Archives: C#

C#. Shared assembly

Lets use Carlib.dll from One file Assembly 1. Strong name Properties – > Signing – > Sign the assembly -> New – > SomeName (for ex. myKeyPair.snk) 2.  Install assembly to GAC (Global Assembly Cache) go to C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Visual Studio … Continue reading →

Posted in C# | Comments Off on C#. Shared assembly

С#. Assembly theory

Assembly – versioned (for ex. 1.0.0.0), self described( has manifest, links to other external assemblies, info about all types) binary, supported by CLR (Common Language Runtime). One EXE is divided in may exe, dll files. Assembly defines type borders.  Example. … Continue reading →

Posted in C# | Comments Off on С#. Assembly theory

C#. Creating one file assembly. Example

Lets create CarLibrary.dll assembly File NewProject ClassLibrary

In other file Derived.cs 2 derived classes ClassView – addReference – System.Windows.Forms

Now lets create new project CarClient ClassView – addReference – Browse –  CarLibrary.dll

 

Posted in C# | Comments Off on C#. Creating one file assembly. Example

C#. Namespace examples

123

Circle.cs

Hexagon.cs

Square.cs

 

Posted in C# | Comments Off on C#. Namespace examples

C#. Delegates, Func, Action

Ну, есть ключевое слово delegate — это описание сигнатуры функции, т. е., её списка параметров и типа возвращаемого значения. Используется так:

Им можно пользоваться так:

С другой стороны, есть готовые, предопределённые сигнатуры функций (Func<TArg1, TArg2, …, TResult> с возвращаемым … Continue reading →

Posted in C# | Comments Off on C#. Delegates, Func, Action

C#. Func template for delegates

123

 

Posted in C# | Comments Off on C#. Func template for delegates

C#. Syntax simple examples

123

 

Posted in C# | Comments Off on C#. Syntax simple examples

C#.OfTypeAsFilter

Non generic collections may have different stuff, we can filter them

 

Posted in C# | Comments Off on C#.OfTypeAsFilter

C#. Linq and Non generic collections, using OfType

Main idea is to use OfType<T> to cast to generic variant

 

Posted in C# | Comments Off on C#. Linq and Non generic collections, using OfType

C#. LinqAndCollections

123

 

Posted in C# | Comments Off on C#. LinqAndCollections