Category Archives: C#

Lina Rich Text Editor

Lina Rich Text Editor

Our new product – Lina Rich Text Editor

Free for all non-commercial users. Write formatted text, insert graphics and build complicated tables. It’s easy to work with files.

 

 Available to download at:

https://www.dropbox.com/sh/05e2r6mifw4m6ze/AACnt_8KfUGEzXhLZNF1Bb5Ya?dl=0

“The Type or Namespace ‘GTK’ could not be found” error – MonoDevelop on Linux

“The Type or Namespace ‘GTK’ could not be found” error – MonoDevelop on Linux

MonoDevelop 3.0.6
GTK# 2.12
openSuse 13.1

When you press F5 to build and get this error in MonoDevelop, just go to:

Project -> Your Project name Options -> Build -> General

You probably see:

Target Framework: Mono /.Net 3.5

Change it to:

Target Framework: Mono /.Net 4.0

Do all what MonoDevelop wants from you. Now, your project has no errors during building.

Zombie Soldiers from Swamps, I — maybe better than Battlefield and Call of Duty

Zombie Soldiers from Swamps, I — maybe better than Battlefield and Call of Duty

ZSFS-9

Because I’m working over more advanced projects, I made a decision to make my game “Zombie Soldiers From Swamps – I” available for free for all people. You can play and copy it, but you can’t sell it or get money in other ways from this software. If you want to use it for commercial purposes, please contact me.

Here are some links on my game on YouTube:

http://youtu.be/f2gD8YyP_-8

http://youtu.be/2kGvK8jkUy8

http://youtu.be/qEJgFOwxeqA

To test the previous version of my game for free, please go to the links:

http://tomaszzackiewicz.wix.com/lina-it-technologies#!zsfs-i-demo/c1za9

http://tomaszzackiewicz.wix.com/lina-it-technologies#!zsfs-i—shootTo purchase our

To download the full version of my game (upgraded):

https://yadi.sk/d/ax9eta7pgZZwV

If any problems, doubts and questions, just contact me at:

pogtoma@gmail.com

Thank you!

Tomasz “Tomza” Zackiewicz

Lina IT Technologies

My First Game — “Zombie Soldiers from Swamps, I”

My First Game — “Zombie Soldiers from Swamps, I”

ZSFS-4

It’s a good time for me and my company — I’ve just finished my first game “Zombie Soldiers from Swamps, I”. You can buy the game sending a request at email:

pogtoma@gmail.com

The cost of the game is $10.

Please look for more information on my website and in the Internet. or just contact me.

Best wishes!

Arrays in C#

Arrays in C#

using System;

class Tabl
{
public static void Main()
{
int[] Oken = new int[10];
Oken[0] = 1;
Oken[1] = 2;
Oken[2] = 3;
Oken[3] = 4;
Oken[4] = 5;
Oken[5] = 6;
Oken[6] = 7;
Oken[7] = 8;
Oken[8] = 9;
Oken[9] = 10;

Console.WriteLine(Oken[5]);
Console.WriteLine(Oken[9]);
Console.WriteLine(Oken[0]);
Oken[5] = 122222;
Console.WriteLine(Oken[5]);
}
}

We have the result:

D:\SharpDevelop Projects\CSharp>cs17
6
10
1
122222

D:\SharpDevelop Projects\CSharp>

goto in C#

goto in C#

goto label;
label:

using System;
class Ok
{
public static void Main()
{
Console.WriteLine(“Let’s check ‘goto'”);
goto pak;
Console.WriteLine(“It’s not displayed”);
pak:
Console.WriteLine(“It’s displayed”);
}
}

We have the result:

D:\SharpDevelop Projects\CSharp>csc cs15.cs
Microsoft (R) Visual C# 2010 Compiler version 4.0.30319.1
Copyright (C) Microsoft Corporation. All rights reserved.

cs15.cs(8,1): warning CS0162: Unreachable code detected

D:\SharpDevelop Projects\CSharp>cs15
Let’s check ‘goto’
It’s displayed

D:\SharpDevelop Projects\CSharp>

It’s not good to use goto too often. We should avoid it, but sometimes we need that.

Class in C#

Class in C#

Let’s write a simple class in C#:

/* A simple class for adding two integers */

using System;

class Moro
{
public int a;
public int b;
}

class Poro
{
public static void Main()
{
int c;
int d;

Moro pik = new Moro();
pik.a = 2;
pik.b = 3;
c = pik.a + pik.b;

Moro lik = new Moro();
lik.a = 5;
lik.b = 6;
d = lik.a + lik.b;

Console.WriteLine(“pik: ” + c);
Console.WriteLine(“lik: ” + d);
}
}

We have the result:

D:\SharpDevelop Projects\CSharp>csc cs9.cs
Microsoft (R) Visual C# 2010 Compiler version 4.0.30319.1
Copyright (C) Microsoft Corporation. All rights reserved.

D:\SharpDevelop Projects\CSharp>cs9
pik: 5
lik: 11

D:\SharpDevelop Projects\CSharp>

So it’s work! Let’s add a method:

/* A simple class for adding two integers */

using System;

class Moro
{
public int a;
public int b;
public double wynik;

public double Mira()
{
wynik = a + b * 100;
return wynik;
}
}

class Poro
{
public static void Main()
{
int c;
int d;
double f;
double g;

Moro pik = new Moro();
pik.a = 2;
pik.b = 3;
c = pik.a + pik.b;
f = pik.Mira();

Moro lik = new Moro();
lik.a = 5;
lik.b = 6;
d = lik.a + lik.b;
g = lik.Mira();

Console.WriteLine(“pik: ” + c + ” and Mira: ” + f);
Console.WriteLine(“lik: ” + d + ” and Mira: ” + g);
}
}

We have the result:

D:\SharpDevelop Projects\CSharp>csc cs10.cs
Microsoft (R) Visual C# 2010 Compiler version 4.0.30319.1
Copyright (C) Microsoft Corporation. All rights reserved.

D:\SharpDevelop Projects\CSharp>cs10
pik: 5 and Mira: 302
lik: 11 and Mira: 605

D:\SharpDevelop Projects\CSharp>

Now, let’s write a class with constructor:

using System;
class Boro
{
public int an;
public int bn;
public int wynik;

public Boro(int a, int b)
{
{
an = a;
bn = b;
}
}

public int Goga()
{
{

wynik = an + bn;
return wynik;
}
}
}

class Moka
{
public static void Main()
{
int c;
int d;
int e;
int f;

Boro adel = new Boro(1,2);
c = adel.Goga();
Console.WriteLine(“Mamy ” + c);

Boro adel1 = new Boro(3,8);
d = adel1.Goga();
Console.WriteLine(“Mamy ” + d);

Boro adel2 = new Boro(12345,5566);
e = adel2.Goga();
Console.WriteLine(“Mamy ” + e);

Boro adel3 = new Boro(-123,455);
f = adel3.Goga();
Console.WriteLine(“Mamy ” + f);

}
}

We have the result:

D:\SharpDevelop Projects\CSharp>cs12
Mamy 3
Mamy 11
Mamy 17911
Mamy 332

D:\SharpDevelop Projects\CSharp>

We can have a method overloading if we need:

using System;
class Mat
{
public int Fig(int a)
{
return a * a ;
}
public double Fig(double a)
{
return a * a ;
}
public int Fig(int a, int b)
{
return a * b;
}
public double Fig(double a, double b)
{
return a * b;
}
}

class Obl
{
public static void Main()
{
Mat ob = new Mat();
Console.WriteLine(“Suma: ” + ob.Fig(2));

Mat ob1 = new Mat();
Console.WriteLine(“Suma: ” + ob1.Fig(0.3));

Mat ob2 = new Mat();
Console.WriteLine(“Suma: ” + ob2.Fig(4,5));

Mat ob3 = new Mat();
Console.WriteLine(“Suma: ” + ob3.Fig(4.5, 6.7));
}
}

We have the result:

D:\SharpDevelop Projects\CSharp>cs13
Suma: 4
Suma: 0.09
Suma: 20
Suma: 30.15

D:\SharpDevelop Projects\CSharp>

Now,  we can see how method overloading works for constructors:

using System;

class Spok
{
public int an;
public int bn;
public double cn;
public double dn;
public double en;

public Spok (int a, int b, double c)
{
an = a;
bn = b;
cn = c;
}

public Spok (int a, int b)
{
an = a;
bn = b;
}

public Spok(double d, double e)
{
dn = d;
en = e;
}

public double Oro()
{
return an + bn + cn + dn + en;
}
}

class Eti
{
public static void Main()
{

Spok adel = new Spok(1,2);
Console.WriteLine(adel.Oro());
Spok adel1 = new Spok(1,2,3);
Console.WriteLine(adel1.Oro());
Spok adel2 = new Spok(1.2, 4.5);
Console.WriteLine(adel2.Oro());
}
}

We have the result:

D:\SharpDevelop Projects\CSharp>cs14
3
6
5.7

D:\SharpDevelop Projects\CSharp>