Add missing handshake signals sync
authorThomas
Tue, 30 Apr 2019 12:39:22 +0200
branchsync
changeset 2622ed338b3729ab
parent 2621 04d3ed8778d1
child 2623 d0c935a45a22
Add missing handshake signals
AdapterCallbacks.cs
     1.1 --- a/AdapterCallbacks.cs	Mon Apr 29 13:55:15 2019 +0200
     1.2 +++ b/AdapterCallbacks.cs	Tue Apr 30 12:39:22 2019 +0200
     1.3 @@ -4,7 +4,6 @@
     1.4  using System.Runtime.InteropServices;
     1.5  using System.Threading;
     1.6  using System.Threading.Tasks;
     1.7 -using Outlook = Microsoft.Office.Interop.Outlook;
     1.8  
     1.9  namespace pEp
    1.10  {
    1.11 @@ -14,9 +13,6 @@
    1.12      internal class AdapterCallbacks : IpEpEngineCallbacks
    1.13      {
    1.14          private static  HandshakeDialog             handshakeDialog         = null;
    1.15 -        private static  System.Windows.Forms.Timer  timer                   = null;
    1.16 -        private const   int                         FAST_POLLING_INTERVAL   = 1000;    // 1 second in ms
    1.17 -        private const   int                         MAX_POLLING_COUNT       = 600;     // 600 times each second => max. 10 minutes      
    1.18  
    1.19          #region Callbacks
    1.20          /// <summary>
    1.21 @@ -92,14 +88,30 @@
    1.22                      {
    1.23                          break;
    1.24                      }
    1.25 +                // Signal to show notification that a sync process was successful
    1.26 +                case SyncHandshakeSignal.SyncNotifyAcceptedDeviceAdded:
    1.27 +                case SyncHandshakeSignal.SyncNotifyAcceptedGroupCreated:
    1.28 +                    {
    1.29 +                        // TODO: show notification
    1.30 +                        break;
    1.31 +                    }
    1.32                  // Signal to close the dialog (actually, it is already closed at this point)
    1.33                  case SyncHandshakeSignal.SyncNotifyOvertaken:
    1.34                      {
    1.35                          break;
    1.36                      }
    1.37 -                // Currently, there is no action defined for the next three signals
    1.38 -                case SyncHandshakeSignal.SyncNotifyAcceptedDeviceAdded:
    1.39 -                case SyncHandshakeSignal.SyncNotifyAcceptedGroupCreated:
    1.40 +                // Signal to show that the device is in state sole
    1.41 +                case SyncHandshakeSignal.SyncNotifySole:
    1.42 +                    {
    1.43 +                        // TODO
    1.44 +                        break;
    1.45 +                    }
    1.46 +                // Signal to show that the device is already grouped
    1.47 +                case SyncHandshakeSignal.SyncNotifyInGroup:
    1.48 +                    {
    1.49 +                        // TODO: show notification
    1.50 +                        break;
    1.51 +                    }
    1.52                  default:
    1.53                      {
    1.54                          break;