Пример #1
0
        /// <summary>
        /// Constructor for complete intialization
        /// </summary>
        /// <param name="category">Message Category</param>
        /// <param name="title">Title of the Message</param>
        /// <param name="likelycause">Likely Cause of the message</param>
        /// <param name="potentialSolution">Potential Solution of the message</param>
        /// <param name="firstButtonLabel">The Label of the first button</param>
        /// <param name="secondButtonLabel">The Label of the Second button</param>
        /// <param name="cancelButtonLabel">The label of the Cancel Button</param>
        /// <param name="callback">The Method to be called after message response</param>
        public MessageEventArgs(MessageCategory category,
                                string title,
                                string likelycause,
                                string potentialSolution,
                                string firstButtonLabel,
                                string secondButtonLabel,
                                string cancelButtonLabel,
                                MessageCallbackDelegate callback)
            : this()
        {
            Category          = category;
            Title             = title;
            LikelyCause       = likelycause;
            PotentialSolution = potentialSolution;
            FirstButtonLabel  = firstButtonLabel;
            SecondButtonLabel = secondButtonLabel;

            // Cancel Button's Label can't be empty
            if (!string.IsNullOrEmpty(cancelButtonLabel))
            {
                CancelButtonLabel = cancelButtonLabel;
            }
            Callback = callback;
        }
Пример #2
0
 public static extern void SetCallback(IntPtr handle, MessageCallbackDelegate callback);
Пример #3
0
 public static extern IntPtr CreateIPCClient(MessageCallbackDelegate callbackDelegate, ConnectionCallbackDelegate onConnect, ConnectionCallbackDelegate onDisconnect);
Пример #4
0
 public static extern IntPtr CreateIPCServer(string serverName, MessageCallbackDelegate callback, ConnectionCallbackDelegate onConnect, ConnectionCallbackDelegate onDisconnect);
Пример #5
0
        public ImapReader(ImapClient client, string folder, MessageCallbackDelegate cb)
        {
            callbackFn = cb;
            folderName = folder;
            imapClient = client;

            // Step 1: add delegate to the
            imapClient.StatusUpdateReceived += onStatusUpdateReceived;
            Crystalbyte.Equinox.Imap.Responses.SelectExamineImapResponse selectResponse = imapClient.Select("INBOX");

            // record the next uid to read ---- this ensures that we will only read new messages
            uidNext = selectResponse.MailboxInfo.UidNext;

            /***
            // let's just check that we can get messages
            var query = client.Messages;
            foreach (var msg in query)
            {
                if (msg.Subject.Contains("bot"))
                {
                    callbackFn(msg.Text);
                }
            }
             * ***/

            IdlerDelegate asyncIdleMethod = startIdle;

            asyncIdleMethod.BeginInvoke(startIdleAsyncCallback, asyncIdleMethod);
        }