public IrisBackground parseBackground() { IrisBackground bgd = new IrisBackground(); String fieldName, fieldValue; nextTokenIfEquals(Token.TokenValue.BACKGROUND); if (currentTokenEquals(Token.TokenValue.VALUE_IDENTIFIER)) { bgd.name = currentToken.stringValue; nextToken(); nextTokenIfEquals(Token.TokenValue.LBRACE); while (!currentTokenEquals(Token.TokenValue.RBRACE)) { if (currentTokenEquals(Token.TokenValue.VALUE_IDENTIFIER)) { fieldName = currentToken.stringValue; nextToken(); nextTokenIfEquals(Token.TokenValue.EQ); if (fieldName.Equals("source")) { if (currentTokenEquals(Token.TokenValue.STRING)) { fieldValue = currentToken.stringValue; nextToken(); nextTokenIfEquals(Token.TokenValue.SEMICOLON); bgd.setImage(fieldValue); } else { } } else { } } else { throw new SyntaxError(lineNumber, colNumber, Token.TokenValue.VALUE_IDENTIFIER); } } nextTokenIfEquals(Token.TokenValue.RBRACE); } else { throw new SyntaxError(lineNumber, colNumber, Token.TokenValue.VALUE_IDENTIFIER); } return(bgd); }
public void addBackground(IrisBackground background) { if (backgrounds == null) { backgrounds = new List <IrisBackground>(); } backgrounds.Add(background); }
public void setBackground(IrisBackground image) { background.Source = image.bmp; }