public void Recieve(Connection connection, int flameLate, IPictureArea pictureareArea, Action closing) { if (_Receiver != null && !_Receiver.IsDisposed) { throw new InvalidOperationException("Recieve Already Run."); } _Receiver = new DisplayImageReciveAlgorithm(connection, ReciveManager, flameLate, pictureareArea, closing); _Receiver.Start(); }
public DisplayImageReciveAlgorithm(Connection connection, IShareAlgorithmManager manager, int interval, IPictureArea area, Action closed) { _Reciver = ShareAlgorithmBuilder.NewBuilder() .SetShareClientSpec(connection.ClientSpec) .SetShareAlgorithmManager(manager) .SetConnectEndoPoint(connection.RemoteEndPoint) .BuildRecieve(connection.LocalEndPoint); _Reciver.ShareAlgorithmClosed += Reciver_ShareAlgorithmClosed; _PictureArea = area; _Closing = closed; _ReciverTimer.Interval = interval; _ReciverTimer.Elapsed += PaintPicture; }