public Form1() { InitializeComponent(); processingService = new ProcessingServiceImpl(); processButton.Enabled = false; //заполняем выпадающий список filterList.Items.AddRange(ZeroNeighborsSharedFilter.GetAllFilters().ToArray()); filterList.SelectedIndex = 0; }
static void Main(string[] args) { ImagePeerService peerService = new ImagePeerService(); while (!peerService.IsConnected) { peerService.TryToConnect(EndPoint); Console.WriteLine($"Appointed GUID: {peerService.Guid}"); } while (true) { ImageProcessingMessage message = peerService.WaitForMessage(); ZeroNeighborsSharedFilter filter = ZeroNeighborsSharedFilter.GetFilterByID(message.FilterID); for (int i = 0; i < message.ImageArray.Length; i++) { message.ImageArray[i] = filter.Filter(message.ImageArray[i]); } peerService.SendMessage(message); } }