コード例 #1
0
 private void ConnectionChangedHandler(CommunicationInterface commInterface, CommunicationInterface.ConnectionStatusType status, bool willReconnect)
 {
     lock (this)        //lock to ensure we don't accidentally get other callbacks while handling this one
     {
         if (IsRunning) //always need to check this in case we are getting callbacks after we complete
         {
             OnConnectionChanged(commInterface, status, willReconnect);
         }
     }
 }
コード例 #2
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            CommunicationInterface.ConnectionStatusType connectionStatus = (CommunicationInterface.ConnectionStatusType)value;
            bool unsetIfTrue = ((parameter != null) && (parameter is string) && ((string)parameter == "UnsetIfTrue"));

            bool disconnected = (connectionStatus == CommunicationInterface.ConnectionStatusType.Disconnected) || (connectionStatus == CommunicationInterface.ConnectionStatusType.CommunicationTerminated);

            if (disconnected)
            {
                if (unsetIfTrue)
                {
                    return(DependencyProperty.UnsetValue);
                }
            }

            return(disconnected);
        }
コード例 #3
0
 protected virtual void OnConnectionChanged(CommunicationInterface commInteface, CommunicationInterface.ConnectionStatusType status, bool willReconnect)
 {
     if ((status == CommunicationInterface.ConnectionStatusType.CommunicationTerminated) || (status == CommunicationInterface.ConnectionStatusType.Disconnected))
     {
         if (ShouldFailOnDisconnect())
         {
             OperationCompleted(false);
         }
     }
 }
コード例 #4
0
 void ConnectionStatusChangedEvent(CommunicationInterface commInterface, CommunicationInterface.ConnectionStatusType status, bool willReconnect)
 {
 }