Exemplo n.º 1
0
        private void RegisterFaxServerEvents()
        {
            faxServer.OnOutgoingJobAdded +=
                new IFaxServerNotify2_OnOutgoingJobAddedEventHandler(faxServer_OnOutgoingJobAdded);
            faxServer.OnOutgoingJobChanged +=
                new IFaxServerNotify2_OnOutgoingJobChangedEventHandler(faxServer_OnOutgoingJobChanged);
            faxServer.OnOutgoingJobRemoved +=
                new IFaxServerNotify2_OnOutgoingJobRemovedEventHandler(faxServer_OnOutgoingJobRemoved);

            var eventsToListen =
                FAX_SERVER_EVENTS_TYPE_ENUM.fsetFXSSVC_ENDED | FAX_SERVER_EVENTS_TYPE_ENUM.fsetOUT_QUEUE |
                FAX_SERVER_EVENTS_TYPE_ENUM.fsetOUT_ARCHIVE | FAX_SERVER_EVENTS_TYPE_ENUM.fsetQUEUE_STATE |
                FAX_SERVER_EVENTS_TYPE_ENUM.fsetACTIVITY | FAX_SERVER_EVENTS_TYPE_ENUM.fsetDEVICE_STATUS;

            faxServer.ListenToServerEvents(eventsToListen);
        }
    private void RegisterFaxServerEvents()
    {
        // subscribe to multiple FaxServer events here ...
        faxServer.OnOutgoingJobChanged += faxServer_OnOutgoingJobChanged;

        /* very important, you MUST tell the FaxServer object which events you're
         * listening for, otherwise the events will never raise!
         * This is what I have set and you should only need one of the event types
         * to listen for but I didn't research this for your problem
         */
        var events = FAX_SERVER_EVENTS_TYPE_ENUM.fsetACTIVITY |
                     FAX_SERVER_EVENTS_TYPE_ENUM.fsetDEVICE_STATUS |
                     FAX_SERVER_EVENTS_TYPE_ENUM.fsetOUT_ARCHIVE |
                     FAX_SERVER_EVENTS_TYPE_ENUM.fsetOUT_QUEUE;

        faxServer.ListenToServerEvents(events);
    }