示例#1
0
 void GenerateNextLine(InstructionInfoEventArgs e)
 {
     if (this.currentTextLine < MaxLinesPerMessage)
     {
         if (this.currentTextLine == MaxLinesPerMessage - 1)
         {
             e.Handled = true;
         }
         else
         {
             e.WriteText(NextLineFunctionCode);
             e.Handled = true;
         }
     }
     NextLine(e);
 }
示例#2
0
 private void GenerateNextMessage(InstructionInfoEventArgs e)
 {
     e.WriteText(NextMessageFunctionCode);
     e.Handled = true;
     NextMessage();
 }
示例#3
0
        private void HandleMessage(InstructionInfoEventArgs e, string messageText)
        {
            int indentSize        = GetIndentSize(messageText);
            int realSplitPosition = FindCharacterIndexOfRightMargin(messageText, maxCharactersPerLine);

            if (realSplitPosition < messageText.Length || e.Handled == true)
            {
                e.Handled = true;
                while (realSplitPosition < messageText.Length)
                {
                    int position = FindSplitPoint(messageText, realSplitPosition);
                    if (position <= indentSize)
                    {
                        //for really long lines - split them at the wrap position instead of an infinite loop
                        position = realSplitPosition;
                    }

                    string line = messageText.Substring(0, position);

                    e.WriteLine(" " + AssemblerProjectWriter.EscapeAndQuoteMessage(line) + " ");
                    GenerateNextLine(e);
                    e.WriteLine("");

                    messageText = messageText.Substring(position);

                    //eat spaces
                    position = 0;
                    while (position < messageText.Length && messageText[position] == ' ')
                    {
                        position++;
                    }
                    if (position > 0)
                    {
                        messageText = messageText.Substring(position);
                    }

                    //add indent if enabled
                    if (MaintainIndentation)
                    {
                        if (indentSize > 0)
                        {
                            messageText = "".PadLeft(indentSize, ' ') + messageText;
                        }
                    }

                    //find next split
                    realSplitPosition = FindCharacterIndexOfRightMargin(messageText, maxCharactersPerLine);
                }

                //remaining text is set to something if this is a "next message" call, so output any leftover text at that time.
                //Otherwise, if we have the leftover text feature disabled, output it now.
                if (!this.RemoveLineBreaksIfWordWrapping || this.remainingText != "")
                {
                    e.WriteText(" " + AssemblerProjectWriter.EscapeAndQuoteMessage(messageText) + " ");
                    this.remainingText = "";
                }
                else
                {
                    this.remainingText = messageText;
                }
            }
        }