示例#1
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.A))
        {
            PopMessage.ConfirmMessage("Title", "123");
        }
        if (Input.GetKeyDown(KeyCode.S))
        {
            PopMessage.YesNoMessage("title", "5678", B, C);
        }

        if (Input.GetKeyDown(KeyCode.D))
        {
            PopMessage.ConfirmMessage("Title", "123", A);
        }

        if (Input.GetKeyDown(KeyCode.F))
        {
            PopMessage.OpenLoading();
        }

        if (Input.GetKeyDown(KeyCode.G))
        {
            PopMessage.CloseLoading();
        }
    }
示例#2
0
        public virtual bool TryGetMessage(uint number, string uid, out PopMessage message, out string errorMessage)
        {
            lock (this)
            {
                if (this.State != EPop3ClientState.Awaiting)
                {
                    message      = null;
                    errorMessage = "Pop3Client doesn't allow executing multiple operations simulteneously in a few threads using one object";
                    return(false);
                }
                this.State = EPop3ClientState.Busy;
            }
            if (this.ConnectionState != EPop3ConnectionState.Authenticated)
            {
                message      = null;
                errorMessage = "The command cannot be executed in this state";
                this.State   = EPop3ClientState.Awaiting;
                if (this.Completed != null)
                {
                    this.Completed(this);
                }
                return(false);
            }
            bool flag = this._TryGetMessage(number, uid, out message, out errorMessage);

            this.State = EPop3ClientState.Awaiting;
            if (this.Completed != null)
            {
                this.Completed(this);
            }
            return(flag);
        }
示例#3
0
 public MessageHall()
 {
     InitializeComponent();
     Pop = new PopMessage(this);
     MQTTEventTrigger.SetHall(this);
     ServerIP.Text   = AMiddle.Middle.ServerIPAddress;
     ServerPort.Text = AMiddle.Middle.Port.ToString();
 }
        /// <summary>
        /// Handles the Click event of the btnReset control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
        private void btnReset_Click(object sender, RoutedEventArgs e)
        {
            PopMessage resetMessage = new PopMessage("Do you want to reset this maze?", "No", "Yes");

            if (resetMessage.ShowDialog() != true)
            {
                if (resetMessage.Choose == true) //reset the game
                {
                    vm.Reset();
                }
            }
        }
        /// <summary>
        /// Handles the Click event of the btnSolve control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
        private void btnSolve_Click(object sender, RoutedEventArgs e)
        {
            PopMessage solveMessage = new PopMessage("Do you want to solve this maze?", "No", "Yes");

            if (solveMessage.ShowDialog() != true)
            {
                if (solveMessage.Choose == true) //solve the game
                {
                    vm.Solve();
                }
            }
        }
示例#6
0
        /// <summary>
        /// Handles the Click event of the btnMainMenu control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
        private void btnMainMenu_Click(object sender, RoutedEventArgs e)
        {
            PopMessage exitMessage = new PopMessage("Do you want to exit this maze?", "No", "Yes");

            if (exitMessage.ShowDialog() != true)
            {
                if (exitMessage.Choose == true) //exit the game
                {
                    BackToMainMenu();
                }
            }
        }
 /// <summary>
 /// Called when [you won property changed].
 /// </summary>
 private void OnYouWonPropertyChanged()
 {
     if (YouWon == true)
     {
         PopMessage youWonMessage = new PopMessage("You Won", "Keep playing", "Return to main menu");
         if (youWonMessage.ShowDialog() != true)
         {
             if (youWonMessage.Choose == true) //solve the game
             {
                 BackToMainMenu();
             }
         }
     }
     YouWon = false;
 }
示例#8
0
 void posCardHandle_popMessage(object sender, PopMessage e)
 {
     this.Dispatcher.Invoke(new Action(() =>
     {
         if (this.WindowState == System.Windows.WindowState.Minimized)
         {
             if (e.PopType == SeatManage.EnumType.TipType.Exception)
             {
                 notifyIcon.ShowBalloonTip(5000, "离开终端", e.Message, System.Windows.Forms.ToolTipIcon.Error);
             }
             else
             {
                 notifyIcon.ShowBalloonTip(5000, "离开终端", e.Message, System.Windows.Forms.ToolTipIcon.Info);
             }
         }
         else
         {
             PopupWindow popWindow = new PopupWindow(e.PopType);
             popWindow.Show();
         }
     }));
 }
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.A))
        {
            PopMessage.ConfirmMessage("Title", "123");
        }
        if (Input.GetKeyDown(KeyCode.S))
        {
//			PopMessage.ConfirmMessage ("1","2", "A", this.gameObject);
            PopMessage.YesNoMessage("title", "5678", C, B);
        }

        if (Input.GetKeyDown(KeyCode.D))
        {
            PopMessage.YesNoMessage("title", "1234", B, C);
//			PopMessage.ConfirmMessage ("3","4");
        }
        if (Input.GetKeyDown(KeyCode.F))
        {
            PopMessage.ConfirmMessage("Title", "123", A);
        }
    }
示例#10
0
        protected virtual bool _TryGetMessage(uint number, string uid, out PopMessage message, out string errorMessage)
        {
            RETR         command  = new RETR(number, uid, this._configurationProvider.AttachmentDirectory);
            Pop3Response response = this.DoCommand(command);

            if (response.Type == EPop3ResponseType.OK)
            {
                if (this.MessageReceived != null)
                {
                    this.MessageReceived(this, command.Message);
                }
                errorMessage = "";
                message      = command.Message;
                return(true);
            }
            if (this.BrokenMessage != null)
            {
                this.BrokenMessage(this, new Pop3MessageInfo(number, 0), response.Message, command.Message);
            }
            errorMessage = response.Message;
            message      = command.Message;
            return(false);
        }
示例#11
0
        public virtual IPart ParsePart(IMessageReader reader, string contentId, ContentType contentType, ContentDisposition contentDisposition, EContentTransferEncoding contentTransferEncoding, string uid, string attachmentDirectory, string boundary, PopMessage parentMessage)
        {
            if (PartUtils.IsMultipart(contentType))
            {
                MultiPartParser parser = new MultiPartParser();
                parser.FinalBoundaryReached += new EventHandler(this.childParser_FinalBoundaryReached);
                return(parser.Parse(reader, contentTransferEncoding, boundary, uid, attachmentDirectory, parentMessage, contentType));
            }
            if (PartUtils.IsTextPart(contentType, contentDisposition))
            {
                string         charset = contentType.Attributes.ContainsKey("charset") ? contentType.Attributes["charset"] : "us-ascii";
                TextPartParser parser2 = new TextPartParser(charset);
                parser2.FinalBoundaryReached += new EventHandler(this.childParser_FinalBoundaryReached);
                return(parser2.Parse(reader, contentType, contentDisposition, contentTransferEncoding, boundary));
            }
            if (PartUtils.IsMessagePart(contentType) && (contentType.SubType == "delivery-status"))
            {
                MessageDeliveryStatusPartParser parser3 = new MessageDeliveryStatusPartParser();
                parser3.FinalBoundaryReached += new EventHandler(this.childParser_FinalBoundaryReached);
                return(parser3.Parse(reader, contentType, contentDisposition, contentTransferEncoding, boundary));
            }
            if (PartUtils.IsMessagePart(contentType) && (contentType.SubType == "disposition-notification"))
            {
                MessageDispositionNotificationPartParser parser4 = new MessageDispositionNotificationPartParser();
                parser4.FinalBoundaryReached += new EventHandler(this.childParser_FinalBoundaryReached);
                return(parser4.Parse(reader, contentType, contentDisposition, contentTransferEncoding, boundary));
            }
            if (PartUtils.IsMessagePart(contentType))
            {
                MessagePartParser parser5 = new MessagePartParser();
                parser5.FinalBoundaryReached += new EventHandler(this.childParser_FinalBoundaryReached);
                return(parser5.Parse(reader, contentType, contentDisposition, contentTransferEncoding, boundary, uid, attachmentDirectory));
            }
            attachmentDirectory = Path.Combine(attachmentDirectory, MailClient.MessageFolderPrefix + IOUtil.FormatFileSystemName(uid));
            ContentPartParser parser6 = new ContentPartParser(attachmentDirectory);

            parser6.FinalBoundaryReached += new EventHandler(this.childParser_FinalBoundaryReached);
            ContentPart part2      = (ContentPart)parser6.Parse(reader, contentType, contentDisposition, contentTransferEncoding, boundary);
            IPart       part       = part2;
            Attachment  attachment = new Attachment(part2.DiskFilename, contentId, contentType, attachmentDirectory, part2.Size)
            {
                DiskFilename        = part2.DiskFilename,
                TransferFilename    = part2.TransferFilename,
                AttachmentDirectory = attachmentDirectory,
                ContentID           = contentId,
                ContentType         = contentType
            };

            if (!attachment.TransferFilenameExtension.Equals(".octet-stream", StringComparison.OrdinalIgnoreCase))
            {
                parentMessage.Attachments.Add(attachment);
            }
            return(part);
        }
示例#12
0
 public static void ConfirmMessage(string p_Title, string p_Text)
 {
     PopMessage.ConfirmMessage(p_Title, p_Text, null);
 }
示例#13
0
 public static void CreatePopMessage()
 {
     instance = (Instantiate(Resources.Load("CPlugins/PopMessage/PopMessageCanvas")) as GameObject).GetComponent <PopMessage>();
 }
示例#14
0
 public Pop3ReceiveMessageException(string errorMessage, PopMessage mailMessage) : base(errorMessage)
 {
     this.MailMessage = mailMessage;
 }
示例#15
0
        public virtual MultiPart Parse(IMessageReader reader, EContentTransferEncoding contentTransferEncoding, string boundary, string uid, string attachmentDirectory, PopMessage parentMessage, ContentType contentType)
        {
            byte[]    buffer;
            MultiPart part = new MultiPart();
            string    str2 = contentType.Attributes["boundary"];

            this._childrenReachedFinalBoundary = false;
            do
            {
                buffer = reader.ReadLine();
            }while (buffer != null && this._defaultEncoding.GetString(buffer, 0, buffer.Length) != ("--" + str2));
            do
            {
                string     source = Utils.ReadHeaders(reader);
                MIMEHeader header = new MIMEHeaderParser().Parse(source);
                if (reader.EndOfMessage)
                {
                    break;
                }
                IPart part2 = this.ParsePart(reader, header.ContentID, header.ContentType, header.ContentDisposition, header.ContentTransferEncoding, uid, attachmentDirectory, str2, parentMessage);
                part2.Header = header;
                part2.Header.ContentTransferEncoding = header.IsDefaultContentTransferEncoding ? contentTransferEncoding : header.ContentTransferEncoding;
                part.Parts.Add(part2);
            }while (!this._childrenReachedFinalBoundary);
            while (!reader.EndOfMessage)
            {
                buffer = reader.ReadLine();
                if (buffer == null)
                {
                    this.RaiseFinalBoundaryReached();
                    return(part);
                }
                EBoundaryType type = BoundaryChecker.CheckBoundary(buffer, boundary);
                if (type != EBoundaryType.NotBoundary)
                {
                    if (type == EBoundaryType.Final)
                    {
                        this.RaiseFinalBoundaryReached();
                    }
                    return(part);
                }
            }
            return(part);
        }
示例#16
0
        public PopMessage Parse(IMessageReader reader, string uid, string attachmentDirectory)
        {
            PopMessage message;
            MIMEHeader header;

            if (reader == null)
            {
                throw new ArgumentNullException("reader");
            }
            if (attachmentDirectory == null)
            {
                throw new ArgumentNullException("attachmentDirectory");
            }
            try
            {
                MIMEHeaderParser parser = new MIMEHeaderParser();
                message     = new PopMessage();
                message.Uid = uid;
                string source = Utils.ReadHeaders(reader);
                header                                   = parser.Parse(source);
                message.Date                             = header.Date;
                message.From                             = header.From;
                message.Header.Sender                    = header.Sender;
                message.Header.ReplyTo                   = header.ReplyTo;
                message.To                               = header.To;
                message.CarbonCopies                     = header.CarbonCopies;
                message.BlindedCarbonCopies              = header.BlindedCarbonCopies;
                message.Header.MessageID                 = header.MessageID;
                message.Header.InReplyTo                 = header.InReplyTo;
                message.Header.References                = header.References;
                message.Subject                          = header.Subject;
                message.Header.Comments                  = header.Comments;
                message.Header.Keywords                  = header.Keywords;
                message.Header.ContentDisposition        = header.ContentDisposition;
                message.Header.ResentDate                = header.ResentDate;
                message.Header.ResentFrom                = header.ResentFrom;
                message.Header.ResentSender              = header.ResentSender;
                message.Header.ResentTo                  = header.ResentTo;
                message.Header.ResentCarbonCopies        = header.ResentCarbonCopies;
                message.Header.ResentBlindedCarbonCopies = header.ResentBlindedCarbonCopies;
                message.Header.ResentMessageID           = header.ResentMessageID;
                message.Header.ReturnPath                = header.ReturnPath;
                message.Header.Received                  = header.Received;
                message.Header.ContentType               = header.ContentType;
                message.Header.ContentTransferEncoding   = header.ContentTransferEncoding;
                foreach (KeyValuePair <string, string> pair in header.ExtraHeaders)
                {
                    message.Header.ExtraHeaders.SmartAdd(pair.Key, pair.Value);
                }
                if (!reader.EndOfMessage)
                {
                    message.RootPart = this.ParsePart(reader, message.Header.ContentID, message.Header.ContentType, message.Header.ContentDisposition, message.Header.ContentTransferEncoding, uid, attachmentDirectory, null, message);
                }
            }
            finally
            {
                while (!reader.EndOfMessage)
                {
                    reader.ReadLine();
                }
            }
            if (message.RootPart != null)
            {
                message.RootPart.Header = header;
                message.FillText();
            }
            return(message);
        }