Beispiel #1
0
    private void GetMsgCallBack(Tny.Folder folder, bool cancel, Tny.Msg msg, Tny.TnyException ex)
    {
        Console.WriteLine(ex.Message);

        if (msg != null && !cancel)
        {
            this.msg_view.Msg = msg;
        }
    }
Beispiel #2
0
    private void GetHeadersCallback(Tny.Folder folder, bool cancel, Tny.List model, Tny.TnyException ex)
    {
        Console.WriteLine(ex.Message);

        if (model != null && !cancel)
        {
            this.headers_treeview.Model = (Gtk.TreeModel)model;
        }
    }
Beispiel #3
0
        public static TnyException Create(IntPtr Handle)
        {
            TnyException ex   = null;
            ErrorEnum    code = Handle != IntPtr.Zero ? (ErrorEnum)tny_error_get_code(Handle) : ErrorEnum.NoError;

            switch (code)
            {
            case ErrorEnum.ServiceErrorUnknown:
                ex = new UnknownException(Handle);
                break;

            case ErrorEnum.SystemErrorUnknown:
                ex = new UnknownException(Handle);
                break;

            case ErrorEnum.SystemErrorMemory:
                ex = new MemoryException(Handle);
                break;

            case ErrorEnum.SystemErrorCancel:
                ex = new CancelException(Handle);
                break;

            case ErrorEnum.IoErrorWrite:
                ex = new IOException(Handle);
                break;

            case ErrorEnum.IoErrorRead:
                ex = new IOException(Handle);
                break;

            case ErrorEnum.ServiceErrorAuthenticate:
                ex = new AuthenticateException(Handle);
                break;

            case ErrorEnum.ServiceErrorConnect:
                ex = new ConnectException(Handle);
                break;

            case ErrorEnum.ServiceErrorUnavailable:
                ex = new ServiceUnavailableException(Handle);
                break;

            case ErrorEnum.ServiceErrorLostConnection:
                ex = new LostConnectionException(Handle);
                break;

            case ErrorEnum.ServiceErrorCertificate:
                ex = new CertificateException(Handle);
                break;

            case ErrorEnum.ServiceErrorFolderCreate:
                ex = new FolderCreateException(Handle);
                break;

            case ErrorEnum.ServiceErrorFolderRemove:
                ex = new FolderRemoveException(Handle);
                break;

            case ErrorEnum.ServiceErrorFolderRename:
                ex = new FolderRenameException(Handle);
                break;

            case ErrorEnum.ServiceErrorFolderIsUnknown:
                ex = new FolderIsUnknownException(Handle);
                break;

            case ErrorEnum.ServiceErrorProtocol:
                ex = new ProtocolException(Handle);
                break;

            case ErrorEnum.ServiceErrorUnsupported:
                ex = new ActionUnsupportedException(Handle);
                break;

            case ErrorEnum.ServiceErrorNoSuchMessage:
                ex = new NoSuchMessageException(Handle);
                break;

            case ErrorEnum.ServiceErrorMessageNotAvailable:
                ex = new MessageNotAvailableException(Handle);
                break;

            case ErrorEnum.ServiceErrorState:
                ex = new StateException(Handle);
                break;

            case ErrorEnum.MimeErrorState:
                ex = new StateException(Handle);
                break;

            case ErrorEnum.ServiceErrorAddMsg:
                ex = new AddMsgException(Handle);
                break;

            case ErrorEnum.ServiceErrorRemoveMsg:
                ex = new RemoveMsgException(Handle);
                break;

            case ErrorEnum.ServiceErrorGetMsg:
                ex = new GetMsgException(Handle);
                break;

            case ErrorEnum.ServiceErrorSync:
                ex = new SyncException(Handle);
                break;

            case ErrorEnum.ServiceErrorRefresh:
                ex = new RefreshException(Handle);
                break;

            case ErrorEnum.ServiceErrorCopy:
                ex = new CopyException(Handle);
                break;

            case ErrorEnum.ServiceErrorTransfer:
                ex = new TransferException(Handle);
                break;

            case ErrorEnum.ServiceErrorGetFolders:
                ex = new GetFoldersException(Handle);
                break;

            case ErrorEnum.ServiceErrorSend:
                ex = new SendException(Handle);
                break;

            case ErrorEnum.MimeErrorMalformed:
                ex = new MimeMalformedException(Handle);
                break;

            case ErrorEnum.NoError:
                ex = new TnyException(Handle);
                break;

            default:
                ex = new TnyException(Handle);
                break;
            }

            return(ex);
        }