示例#1
0
 public Message CreateNonCriticalErrorMessage(string To, MeshworkError error)
 {
     Message p = new Message(network, MessageType.NonCriticalError);
     p.To = To;
     p.Content = error;
     return p;
 }
示例#2
0
 public Message CreateCriticalErrorMessage(Node MessageTo, MeshworkError error)
 {
     Message m = new Message(network, MessageType.CriticalError);
     m.To = MessageTo.NodeID;
     m.Content = error;
     return m;
 }
示例#3
0
 public Message CreateNonCriticalErrorMessage(Node To, MeshworkError error)
 {
     return CreateNonCriticalErrorMessage(To.NodeID, error);
 }
 private void network_ReceivedNonCriticalError(Network network, Node from, MeshworkError error)
 {
     try {
         UpdateConnectionList();
     } catch (Exception ex) {
         LoggingService.LogError(ex);
         Gui.ShowErrorDialog (ex.ToString(), Gui.MainWindow.Window);
     }
 }
示例#5
0
 internal void SendNonCriticalError(Node node, MeshworkError error)
 {
     this.SendRoutedMessage(this.MessageBuilder.CreateNonCriticalErrorMessage(node, error));
 }
示例#6
0
        internal void RaiseReceivedNonCriticalError(Node from, MeshworkError error)
        {
            LoggingService.LogWarning("RECEIVE NONCRITICALERROR: " + error.Message);

            if (ReceivedNonCriticalError != null)
                ReceivedNonCriticalError(this, from, error);
        }
示例#7
0
        internal void ProcessNonCriticalErrorMessage(Node messageFrom, MeshworkError error)
        {
            if (error is NotTrustedError) {
                messageFrom.ClearSessionKey();
                messageFrom.RemotelyUntrusted = true;
            } else if (error is FileTransferError) {
                string id = ((FileTransferError)error).TransferId;
                foreach (IFileTransfer transfer in Core.FileTransferManager.Transfers) {
                    if (transfer.Id == id) {
                        ((IFileTransferInternal)transfer).ErrorReceived(messageFrom, (FileTransferError)error);
                        break;
                    }
                }

            } else {
                network.RaiseReceivedNonCriticalError (messageFrom, error);
            }
        }
示例#8
0
        private void network_ReceivedNonCriticalError(Network network, Node from, MeshworkError error)
        {
            if (error is DirectoryNotFoundError)
            {
                string errorPath = ((DirectoryNotFoundError)error).DirPath;
                errorPath = errorPath.Substring(1);

                // FIXME: errorPath doesn't have network part, navigatingTo does!!
                if (true)
                //if (errorPath == navigatingTo)
                {
                    Gui.ShowErrorDialog("Directory not found");

                    StopNavigating();

                    // FIXME: Maybe something should reset the state on the directory object
                }
            }
        }