예제 #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;
     }
 }