Code:
namespace TCP_Communication
{
class TcpClient
{
// ...
public delegate void OnDataAvailable(char[] data);
// ...
}
}
Code:
using System;
using System.Collections.Generic;
using System.Text;
namespace TCP_Communication
{
class Program
{
static void Main(string[] args)
{
// ...
Client.OnDataAvailable = DataArrived;
// ...
}
public void DataArrived(char[] newdata)
{
// empty for now
}
}
}
Quote:
'OnDataAvailable': cannot reference a type through an expression; try 'TCP_Communication.TcpClient.OnDataAvailable' instead
Program.cs
Code:
using System;
using System.Collections.Generic;
using System.Text;
namespace TCP_Communication
{
class Program
{
static void Main(string[] args)
{
// ...
TCP_Communication.TcpClient.OnDataAvailable = DataArrived;
// ...
}
public void DataArrived(char[] newdata)
{
// empty for now
}
}
}
Quote:
'TCP_Communication.TcpClient.OnDataAvailable' is a 'type', which is not valid in the given context
Please help me guys, how can I fix this code?