コード例 #1
0
 private bool SocketIsUnlinked(Socket socket)
 {
     return socket.ConnectedToSocketId == null;
 }
コード例 #2
0
 private void AddNewSocketToDevice(Device selectedDevice, Socket socket)
 {
     _context.Sockets.CreateNewLinkedSocket(selectedDevice, socket);
     _context.Complete();
 }
コード例 #3
0
 private void Socket_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
 {
     var device = new Socket();
     switch (e.Action)
     {
         case NotifyCollectionChangedAction.Add:
             foreach (var item in e.NewItems)
             {
                 var entity = item as Socket;
                 if (entity != null && !_isAddedbyApp)
                 {
                     //Adding to the database is working by itself!
                 }
             }
             _context.Complete();
             break;
         case NotifyCollectionChangedAction.Reset:
             var count = _context.Complete();
             break;
     }
 }