C# Pcap.net communication - c#

I would like to ask why is my communicator receiving sent frames. I'm trying to fix this problem using flag PacketDeviceOpenAttributes.NoCaptureLocal for receiving communicator but I'm still receiving sent frames. Could anyone know how to fix this problem? Thank you. Here is my code:
using PcapDotNet.Core;
using PcapDotNet.Packets;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace PSIP
{
public partial class Form2 : Form
{
private Packet packet;
private List<Packet> buffer;
private IList<LivePacketDevice> allDevices;
private LivePacketDevice selectedDevice, sendDevice;
private int pkt_cnt;
private Thread thrReceive,thrSend;
public Form2(LivePacketDevice device)
{
InitializeComponent();
Show();
selectedDevice = device;
pkt_cnt = 0;
buffer = new List<Packet>();
allDevices = LivePacketDevice.AllLocalMachine;
for (int i = 0; i != allDevices.Count; ++i)
{
LivePacketDevice tempDevice = allDevices[i];
if (device.Description != null)
{
ListViewItem row = new ListViewItem(tempDevice.Name);
listDevices.Items.Add(row);
}
}
}
private void PacketHandler(object obj)
{
throw new NotImplementedException();
}
private void PacketHandler(Packet packet)
{
ListViewItem itemPacket = new ListViewItem(pkt_cnt.ToString());
itemPacket.SubItems.Add(packet.Ethernet.Destination.ToString());
itemPacket.SubItems.Add(packet.Ethernet.Source.ToString());
pktView.Items.Add(itemPacket);
buffer.Add(packet);
pkt_cnt++;
}
private void Sending()
{
for (int i = 0; i <= allDevices.Count; ++i)
{
sendDevice = allDevices[i];
if (sendDevice.Name.Equals(listDevices.SelectedItems[0].Text))
{
i = allDevices.Count;
}
}
using (PacketCommunicator communicator = sendDevice
.Open(100, PacketDeviceOpenAttributes.Promiscuous | PacketDeviceOpenAttributes.NoCaptureLocal, 1000))
{
int index = Int32.Parse(pktView.SelectedItems[0].Text);
Packet tmpPacket = buffer.ElementAt(index);
communicator.SendPacket(tmpPacket);
}
}
private void Receiving()
{
int c = int.Parse(packetcount.Text);
using (PacketCommunicator communicator = selectedDevice.Open(65536,
PacketDeviceOpenAttributes.NoCaptureRemote | PacketDeviceOpenAttributes.Promiscuous, 1000))
{
communicator.ReceivePackets(c, PacketHandler);
}
}
private void button1_Click(object sender, EventArgs e)
{
thrReceive = new Thread(Receiving);
thrReceive.Start();
}
private void buttonSend_Click(object sender, EventArgs e)
{
thrSend = new Thread(Sending);
thrSend.Start();
}
private void pktView_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
int index = Int32.Parse(pktView.SelectedItems[0].Text);
Packet tmpPacket = buffer.ElementAt(index);
textPacket.ResetText();
textPacket.AppendText(tmpPacket.Ethernet.ToHexadecimalString());
}
catch (Exception E)
{
Console.WriteLine(E.ToString());
}
}
private void buttonClear_Click(object sender, EventArgs e)
{
pktView.Items.Clear();
buffer.Clear();
pkt_cnt = 0;
}
} }

You seem to be using different PacketCommunicators, one for sending and one for receiving.
The documentation for NoCaptureRemote states "Defines if the local adapter will capture its own generated traffic.".
Since you're using two different communicators, the receiving communicator captures the sending communicator.

Related

C# Client-Server: Only one client receives data

I'm trying to debug this but it's getting super messy in my head, I really need a little help over here. I'm doing the classic Chat Application program with multiple clients and a server. What I have so far :
Clients connect to the server;
The server stores each client in a list;
When a client sends a message, it is then sent to all the clients in the list;
My problem is about this third step, on my server side, my program outputs the step correctly.
For example, if my user is Hugo and he sends Hey:
Sending hugo: hey
to System.Net.Sockets.TcpClient0
Sending hugo: hey
to System.Net.Sockets.TcpClient1
The message is redirected to all the Users connected to my server. Now the problem is on the Client Side, for some reasons, the message are displayed only on the LAST connected user. Considering the previous example, the message "Hey" would be displayed two times on TcpClient1 , and never on TcpClient0
Server code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net.Sockets;
using System.Net;
using System.Threading;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Collections;
using ConsoleApp1;
namespace ServerSide
{
class Server
{
private int port;
private byte[] buffer = new byte[1024];
public delegate void DisplayInvoker(string t);
private StringBuilder msgclient = new StringBuilder();
private TcpListener client;
static IPHostEntry host = Dns.GetHostEntry(Dns.GetHostName());
private IPAddress ipAddress = host.AddressList[0];
private TcpClient myclient;
private List<TcpClient> usersConnected = new List<TcpClient>();
public Server(int port)
{
this.port = port;
}
public void startServer()
{
client = new TcpListener(ipAddress, port);
client.Start();
SERV a = new SERV();
a.Visible = true;
a.textBox1.AppendText("Waiting for a new connection...");
while (true)
{
myclient = client.AcceptTcpClient();
usersConnected.Add(myclient);
a.textBox1.AppendText("New User connected #" + myclient.ToString() );
myclient.GetStream().BeginRead(buffer, 0, 1024, Receive, null);
a.textBox1.AppendText("Size of List " + usersConnected.Count);
}
}
private void Receive(IAsyncResult ar)
{
int intCount;
try
{
lock (myclient.GetStream())
intCount = myclient.GetStream().EndRead(ar);
if (intCount < 1)
{
return;
}
Console.WriteLine("MESSAGE RECEIVED " + intCount);
BuildString(buffer, 0, intCount);
lock (myclient.GetStream())
myclient.GetStream().BeginRead(buffer, 0, 1024, Receive, null);
}
catch (Exception e)
{
return;
}
}
public void Send(string Data)
{
lock (myclient.GetStream())
{
System.IO.StreamWriter w = new System.IO.StreamWriter(myclient.GetStream());
w.Write(Data);
w.Flush();
}
}
private void BuildString(byte[] buffer, int offset, int count)
{
int intIndex;
for (intIndex = offset; intIndex <= (offset + (count - 1)); intIndex++)
{
msgclient.Append((char)buffer[intIndex]);
}
OnLineReceived(msgclient.ToString());
msgclient.Length = 0;
}
private void OnLineReceived(string Data)
{
int i = 0;
foreach (TcpClient objClient in usersConnected)
{
Console.WriteLine("Sending " + Data + " to " + objClient + i);
Send(Data);
i++;
}
}
}
}
Client code
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Net;
using System.Net.Sockets;
using System.Threading;
namespace WindowsFormsApp2
{
public partial class Form2 : Form
{
private delegate void DisplayInvoker(string t);
private string currentTopic = null;
private StringBuilder msg = new StringBuilder();
static public string MyUser { get; set; }
static private byte[] buffer = new byte[1024];
static IPHostEntry host = Dns.GetHostEntry(Dns.GetHostName());
static IPAddress ipAddress = host.AddressList[0];
static Client user = new Client(MyUser, ipAddress, 136);
public Form2(string User) // when a user is logged in , directly connect him to the server
{
InitializeComponent();
MyUser = User;
user.clientConnection();
Thread readingg = new Thread(reading);
readingg.Start();
user.sendText(MyUser + " joined the chatroom!" +"\n");
IPAdress.Text = GetLocalIP(host);
IPAdress.ReadOnly = true;
}
public void reading()
{
user.getClient().GetStream().BeginRead(buffer, 0, 1024, ReadFlow, null);
Console.WriteLine("READING FUNCTION TRIGGERED FOR "+MyUser);
}
private void DisplayText(string t)
{
UserChat.AppendText(t);
Console.WriteLine("DISPLAY FUNCTION TRIGGERED FOR " + MyUser + "with " +msg.ToString());
}
private void BuildString(byte[] buffer,int offset, int count)
{
int intIndex;
for(intIndex = offset; intIndex <= (offset + (count - 1)); intIndex++)
{
if (buffer[intIndex] == 10)
{
msg.Append("\n");
object[] #params = { msg.ToString() };
Console.WriteLine("BUILDSTIRNG FUNCTION TRIGGERED FOR " + MyUser);
Invoke(new DisplayInvoker(DisplayText),#params);
msg.Length = 0;
}
else
{
msg.Append((char)buffer[intIndex]);
}
}
}
private void ReadFlow(IAsyncResult ar)
{
int intCount;
try
{
intCount = user.getClient().GetStream().EndRead(ar);
Console.WriteLine(intCount);
if (intCount < 1)
{
return;
}
Console.WriteLine(MyUser + "received a message");
BuildString(buffer, 0, intCount);
user.getClient().GetStream().BeginRead(buffer, 0, 1024, this.ReadFlow, null);
}catch(Exception e)
{
return;
}
}
private string GetLocalIP(IPHostEntry host)
{
foreach (IPAddress ip in host.AddressList)
{
if (ip.AddressFamily == AddressFamily.InterNetwork)
{
return ip.ToString();
}
}
return "192.168.1.1";
} // get your local ip
private void label1_(object sender, EventArgs e)
{
this.Text = "Hello " + MyUser;
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void UserMessage_TextChanged(object sender, EventArgs e)
{
}
private void UserMessage_Focus(object sender, EventArgs e)
{
UserMessage.Text = "";
}
private void UserMessage_Focus2(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
listBox1.Items.Add(addTopic.Text);
addTopic.Text = "Add Topic";
}
private void button2_(object sender, EventArgs e)
{
}
private void addTopic_(object sender, EventArgs e)
{
}
private void addTopic_TextChanged(object sender, EventArgs e)
{
}
private void listBox1_MouseDoubleClick(object sender, MouseEventArgs e)
{
string curItem = listBox1.SelectedItem.ToString();
label1.Text = "Topic "+curItem;
currentTopic = curItem;
}
private void IPAdress_TextChanged(object sender, EventArgs e)
{
}
// send msg to the server
private void UserChat_TextChanged(object sender, EventArgs e)
{
}
private void Form2_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
//Handle event here
System.Windows.Forms.Application.Exit();
}
private void Send_Click_1(object sender, EventArgs e)
{
user.sendText(MyUser + ": " + UserMessage.Text +"\n");
UserMessage.Text = " ";
}//send message
}
}
In OnLineReceived, for each client you call SendData, where you send to myclient. You probably want to pass objClient into SendData, and send to that.
Note that there are also some threading problems there; if someone connects exactly while you are iterating the list, it'll break the iterator, for example.

Serial Port Data Received Event accessed from Multiple forms

I'm trying to make a windows form application in Visual Studio in C# and the purpose is to be able to communicate with an Arduino microcontroller. Right now I have 2 forms (Form1 and Form2) and I need to send and receive data from both windows to the microcontroller. I have defined a class SerialComms.cs in which there I start my serialPort and I have been able to send messages from both forms to the Arduino.
The problem is I don't know how to go about to receiving data from the Arduino as soon as the data is received. If I were to create the serialPort from one of the forms i would be able to create a function for DataReceived that will run anytime data is received but I don't know how to do that when I start my serialPort from a class. Any help?
Here is my code for both forms and my serialComms class:
Form1
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO.Ports;
using System.IO;
namespace Test_Comms
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
connectToArduino();
}
void connectToArduino()
{
try { SerialComms.SerialPort.Close(); }
catch { }
getAvailablePorts();
for (int i = 0; i < COMcomboBox.Items.Count; i++)
{
string inputMsg = "None";
string commport = COMcomboBox.GetItemText(COMcomboBox.Items[i]);
//Wait for Arduino message sent
//If not receieved go to next port
SerialComms.SerialPort.PortName = commport;
SerialComms.SerialPort.BaudRate = 9600;
SerialComms.SerialPort.Open();
try { SerialComms.SerialPort.Open(); }
catch { }
int counter1 = 0;
while (counter1 < 100)
{
inputMsg = SerialComms.SerialPort.ReadLine();
try { inputMsg = SerialComms.SerialPort.ReadLine(); }
catch { }
counter1++;
if (inputMsg == "Arduino")
{
counter1 = 1000;
}
}
if (inputMsg != "Arduino")
{
try { SerialComms.SerialPort.Close(); }
catch { }
}
else
{
i = COMcomboBox.Items.Count;
SerialComms.SerialPort.WriteLine("Connection Established");
toolStripStatusLabel1.Text = "Connected";
break;
}
}
}
void getAvailablePorts()
{
COMcomboBox.Items.Clear();
String[] ports = SerialPort.GetPortNames();
COMcomboBox.Items.AddRange(ports);
}
private void button1_Click(object sender, EventArgs e)
{
SerialComms.SerialPort.WriteLine("LED ON");
}
private void button2_Click(object sender, EventArgs e)
{
SerialComms.SerialPort.WriteLine("LED OFF");
}
private void button3_Click(object sender, EventArgs e) //Opens second form
{
Form2 settingsForm = new Form2();
settingsForm.ShowDialog();
}
}
}
Form2
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO.Ports;
using System.IO;
namespace Test_Comms
{
public partial class Form2 : Form
{
public static string text = "Test text";
public Form2()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
SerialComms.SerialPort.WriteLine("LED ON");
}
private void button2_Click(object sender, EventArgs e)
{
SerialComms.SerialPort.WriteLine("LED OFF");
button2.Text = text;
}
private void Form2_Load(object sender, EventArgs e)
{
}
}
}
SerialComms.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO.Ports;
using System.IO;
namespace Test_Comms
{
public static class SerialComms
{
//public static delegate void DataReceivedEventHandler(object sender, ReceivedEventArgs e);
//public static event DataReceivedEventHandler DataReceived;
private static SerialPort _serialPort = new SerialPort();
public static SerialPort SerialPort
{
get { return _serialPort; }
set { _serialPort = value; }
}
}
}

Receive data from Myo and show it on a c# chart

I'm trying to show Myo datas on a chart using c#. I receive the data from Myo and sends it to chart but it won't show anything. Examples on the net hasn't helped me! this is the code (I think i have thread but don't know much, producer class receives the raw emg data from myo and Form1 is supposed to show it):
using MyoSharp.Communication;
using MyoSharp.Device;
using MyoSharp.Exceptions;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;
namespace MyoThings
{
public partial class Form1 : Form
{
int i = 0;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Producer producer = new Producer();
producer.StartConnection();
}
public void receiveData(int data)
{
Console.WriteLine(data);
chart1.Series[0].Points.Add(i++, data); // won't add anything -
chart1.Invalidate();
}
}
class Producer
{
Chart chart = new Chart();
public void StartConnection()
{
using (var channel = Channel.Create(ChannelDriver.Create(ChannelBridge.Create(),
MyoErrorHandlerDriver.Create(MyoErrorHandlerBridge.Create()))))
{
using (var hub = Hub.Create(channel))
{
hub.MyoConnected += (sender, e) =>
{
Console.WriteLine($"Myo Connected, handle: {e.Myo.Handle}");
e.Myo.Vibrate(VibrationType.Short);
e.Myo.EmgDataAcquired += Myo_EmgDataAcquired;
e.Myo.SetEmgStreaming(true);
};
channel.StartListening();
//int i = 0;
while (true)
{
}
}
}
}
private static void Myo_EmgDataAcquired(object sender, EmgDataEventArgs e)
{
//Console.WriteLine(e.EmgData.GetDataForSensor(1));
Producer producer = new Producer();
Form1 form = new Form1();
//sends data of myo to chart
form.receiveData(e.EmgData.GetDataForSensor(1));
}
}
}
I could answer it myself. I sent the chart to producer class and add points
using MyoSharp.Communication;
using MyoSharp.Device;
using MyoSharp.Exceptions;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Threading;
using System.Diagnostics;
using System.Windows.Forms.DataVisualization.Charting;
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
private Producer producer;
private bool sitSensorOne = true;
private bool sitSensorTwo = true;
private bool sitSensorThree = true;
private bool sitSensorFour = true;
private bool sitSensorFive = true;
private bool sitSensorSix = true;
private bool sitSensorSeven = true;
private bool sitSensorEighth = true;
public Form1()
{
InitializeComponent();
producer = new Producer(chart1);
producer.YSeriesEvent += MyHandler;
chart1.Series[0].Enabled = true;
Load += (sender, e) => producer.Start();
}
private void MyHandler(object sender, int data)
{
Invoke(new Action(() =>
{
}));
}
}
}
class Producer
{
public event EventHandler<int> YSeriesEvent;
private Thread thread;
public int Data;
private Chart chart;
public Producer(Chart chart)
{
this.chart = chart;
thread = new Thread(new ThreadStart(this.Work));
thread.IsBackground = true;
thread.Name = "My Worker";
}
public void Start()
{
thread.Start();
}
private void Work()
{
using (var channel = Channel.Create(ChannelDriver.Create(ChannelBridge.Create(),
MyoErrorHandlerDriver.Create(MyoErrorHandlerBridge.Create()))))
{
using (var hub = Hub.Create(channel))
{
hub.MyoConnected += (sender, e) =>
{
Console.WriteLine($"Myo connected, handle: {e.Myo.Handle}");
e.Myo.Vibrate(VibrationType.Short);
e.Myo.EmgDataAcquired += Myo_EmgDataAcquired;
e.Myo.SetEmgStreaming(true);
YSeriesEvent?.Invoke(this, Data);
};
channel.StartListening();
while (true) { }
}
}
}
private void Myo_EmgDataAcquired(object sender, EmgDataEventArgs e)
{
Data = e.EmgData.GetDataForSensor(3);
Console.WriteLine(Data);
chart.Invoke(new Action(() =>
{
for (int i = 0; i < 8; i++)
chart.Series[i].Points.AddY(e.EmgData.GetDataForSensor(i));
}
));
}
private void returnData()
{
chart.Series[0].Points.AddY(Data);
Console.WriteLine(Data);
}
}
}

Graph plotting C#

I am working on an interface in C#, which reads data from the serial port and displays it on a graph. I wrote the following code, but the graph doesn't display anything. What is wrong? I don't know exactly what should I modify.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO.Ports;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public long rt = 0;
string dataReceived = string.Empty;
private delegate void SetTextDeleg(string text);
// public string kp, kd, ki;
public int distanta;
public string potentiometru;
public Form1()
{
InitializeComponent();
this.chart1.ChartAreas[0].AxisX.Minimum = 0;
this.chart1.ChartAreas[0].AxisY.Minimum = 0;
this.chart1.ChartAreas[0].AxisY.Maximum = 55;
}
private void Connect_button_Click(object sender, EventArgs e)
{
if (serialPort1.IsOpen)
{
Connect_button.Enabled = false;
}
serialPort1.BaudRate = 9600;// Convert.ToUInt16(comboBox1.Text);
serialPort1.PortName = comboBox3.Text;
serialPort1.DataBits = 8;
serialPort1.StopBits = (System.IO.Ports.StopBits)2;
timer1.Start();
serialPort1.Open();
}
private void Sent_Button_Click(object sender, EventArgs e)
{
// kp = Convert.ToString(Kp_textbox.Text);
//kd = Convert.ToString(Kd_textbox.Text);
//ki = Convert.ToString(Ki_textbox.Text);
//serialPort1.Write(kp);
//serialPort1.Write(ki);
//serialPort1.Write(kd);
//string transmit = "$kp$" + kp + "$kd$" + kd + "$ki$" + ki;
// $kp$0.25
}
private void serialPort1_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
try
{
string x = serialPort1.ReadLine();
this.BeginInvoke(new SetTextDeleg(DataReceived), new object[] { x });
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void DataReceived(string data)
{
dataReceived = data.Trim();
if (rt < 2)
return;
if (dataReceived.Contains("."))
{
senzor_textbox.Text = dataReceived;
this.chart1.Series["Distance"].Points.AddXY(0, dataReceived);
}
else
{
potentiometru_textbox.Text = dataReceived;
this.chart1.Series["SetPoint"].Points.AddXY(0, dataReceived);
}
rt = 0;
}
private void button1_Click(object sender, EventArgs e)
{
}
private void timer1_Tick(object sender, EventArgs e)
{
rt++;
}
private void button2_Click(object sender, EventArgs e)
{
if(serialPort1.IsOpen)
serialPort1.Close();
}
}
}

How can I show map on gMapControl?

My problem is I can not see any thing on form when I run application. This my code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using GMap;
using GMap.NET;
using GMap.NET.WindowsForms;
namespace Gmap_tesx
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e1)
{
try
{
System.Net.IPHostEntry e =
System.Net.Dns.GetHostEntry("www.google.com");
}
catch
{
gMapControl1.Manager.Mode = AccessMode.CacheOnly;
MessageBox.Show("No internet connection avaible, going to CacheOnly mode.",
"GMap.NET - Demo.WindowsForms", MessageBoxButtons.OK,
MessageBoxIcon.Warning);
}
// config map
GMaps.Instance.Mode = AccessMode.ServerAndCache;
// gMapControl1.CacheLocation = Application.StartupPath + "data.gmdp";
GMaps g = new GMaps();
gMapControl1.MapType = MapType.GoogleSatellite;
gMapControl1.MaxZoom = 6;
gMapControl1.MinZoom = 1;
gMapControl1.Zoom = gMapControl1.MinZoom + 1;
gMapControl1.Position = new PointLatLng(54.6961334816182,
25.2985095977783);
// map events
gMapControl1.OnCurrentPositionChanged += new
CurrentPositionChanged(gMapControl1_OnCurrentPositionChanged);
gMapControl1.OnTileLoadStart += new TileLoadStart(gMapControl1_OnTileLoadStart);
gMapControl1.OnTileLoadComplete += new
TileLoadComplete(gMapControl1_OnTileLoadComplete);
gMapControl1.OnMarkerClick += new MarkerClick(gMapControl1_OnMarkerClick);
gMapControl1.OnMapZoomChanged += new MapZoomChanged(gMapControl1_OnMapZoomChanged);
gMapControl1.OnMapTypeChanged += new MapTypeChanged(gMapControl1_OnMapTypeChanged);
gMapControl1.MouseMove += new MouseEventHandler(gMapControl1_MouseMove);
gMapControl1.MouseDown += new MouseEventHandler(gMapControl1_MouseDown);
gMapControl1.MouseUp += new MouseEventHandler(gMapControl1_MouseUp);
gMapControl1.OnMarkerEnter += new MarkerEnter(gMapControl1_OnMarkerEnter);
gMapControl1.OnMarkerLeave += new MarkerLeave(gMapControl1_OnMarkerLeave);
}
private void gMapControl1_OnCurrentPositionChanged(PointLatLng point)
{
}
private void gMapControl1_OnMarkerLeave(GMapMarker item)
{
}
private void gMapControl1_OnMarkerEnter(GMapMarker item)
{
}
private void gMapControl1_MouseUp(object sender, MouseEventArgs e)
{
}
private void gMapControl1_MouseDown(object sender, MouseEventArgs e)
{
}
private void gMapControl1_MouseMove(object sender, MouseEventArgs e)
{
}
private void gMapControl1_OnMapTypeChanged(MapType type)
{
}
private void gMapControl1_OnMapZoomChanged()
{
}
private void gMapControl1_OnMarkerClick(GMapMarker item, MouseEventArgs e)
{
}
private void gMapControl1_OnTileLoadComplete(long ElapsedMilliseconds)
{
}
private void gMapControl1_OnTileLoadStart()
{
}
}
}

Categories