protected NodeSocket(NodeControl parentNode, Type nodeDataType, SocketTypes nodeType) { InitializeComponent(); ConnectedCurves = new List <Path>(); BaseColorStroke = Brushes.Black; guid = Guid.NewGuid(); SocketType = nodeType; DataType = nodeDataType; BaseColorBody = GetBaseColor(nodeDataType); ParentNode = parentNode; SetBaseColor(); HorizontalAlignment = nodeType == SocketTypes.Input ? HorizontalAlignment.Left : HorizontalAlignment.Right; updater = () => { parentNode.cbWindow.UpdateCurves(parentNode); parentNode.cbWindow.UpdateProcess(ParentNode); }; ParentNode.LoadSocketEvents(this); }
public Server(int portNumber, SocketTypes socketType) { ServerPort = portNumber; currentSocketType = socketType; InitializeSocket(portNumber); TaskFactory tf = new TaskFactory(TaskScheduler.Default); tf.StartNew(() => WaitForClientConnection(sockets.FirstOrDefault())); }
public SocketItem() { Name = "Opal Socket"; ItemType = ItemEquipType.Socket; Rarity = RarityTypes.Rare; SocketTier = 1; RequiredLevel = 0; _socketType = SocketTypes.Ruby; }
public bool sendSeverCmd(SocketTypes conName, byte[] cmd, int lenth) { try { int lengthOfNotSend = lenth; Socket socket = null; while (lengthOfNotSend > 0) { MainForm.CommunicationSocketDic.TryGetValue(conName, out socket); int len = socket.Send(cmd, 0, lenth, SocketFlags.None); lengthOfNotSend -= len; } } catch (Exception ex) { return(false); } return(true); }
public IEnumerable <Socket> GetSockets() => SocketTypes.Select(socket => new Socket(socket));
public SocketItem(SocketTypes socketType) { _socketType = socketType; }