-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathClientManager.cs
More file actions
42 lines (32 loc) · 1.33 KB
/
ClientManager.cs
File metadata and controls
42 lines (32 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System;
using System.Collections.Generic;
using System.Net;
using System.Windows;
using Client.Windows;
using System.Net.Sockets;
namespace Client.Net
{
public delegate void ClipboardNoticeCaller(IDataObject obj);
public delegate void InputNoticeCaller(INPUT input);
public delegate void NetworkErrorEventHandler(SocketException exception);
class ClientManager
{
static IEnumerable<IPEndPoint> targets = new LinkedList<IPEndPoint>(); //list of server
private static ClipboardNoticeCaller ClipboardCaller = new ClipboardNoticeCaller(ClipboardNetworkChannel.SendClipboardNotice);
private static InputNoticeCaller InputCaller = new InputNoticeCaller(ClipboardNetworkChannel.SendInputNotice);
public static void NotifyClipboardAsynch()
{
IAsyncResult result = ClipboardCaller.BeginInvoke(Clipboard.GetDataObject(), new AsyncCallback(clipboardCallback), null);
}
public static void clipboardCallback(IAsyncResult res)
{
}
public static void NotifyInputAsynch(INPUT input)
{
IAsyncResult result = InputCaller.BeginInvoke(input, new AsyncCallback(inputCallback), null);
}
public static void inputCallback(IAsyncResult res)
{
}
}
}