public static CompilerOptions CreateOptions(ParseModes mode = ParseModes.Singleplayer) { return(new CompilerOptions() { ParsingMode = mode }); }
public static Boolean AvailableInParseMode(this CallModifiers type, ParseModes mode) { switch (type) { case CallModifiers.Thread: return(true); case CallModifiers.ChildThread: return(mode == ParseModes.Singleplayer); case CallModifiers.Volatile: return(true); case CallModifiers.Call: return(mode == ParseModes.Singleplayer); } throw new NotImplementedException(); }
}// end function //! checks for the relevant string private bool CheckingForParams(String PossibleMatch) { bool isMatchFound = false; for (int i = 0; i < ModeIdentifiers.Length; ++i) { //casting to equivalent parseMode if (PossibleMatch.Equals(ModeIdentifiers[i])) { isMatchFound = true; switch (i) { case (0): m_ParseMode = ParseModes.ErrorReading; m_OrderOfParse.Add(m_ParseMode); return(isMatchFound); case (1): m_ParseMode = ParseModes.LexReading; m_OrderOfParse.Add(m_ParseMode); return(isMatchFound); case (2): m_ParseMode = ParseModes.SytaxReading; m_OrderOfParse.Add(m_ParseMode); return(isMatchFound); case (3): m_ParseMode = ParseModes.SemanticReading; m_OrderOfParse.Add(m_ParseMode); return(isMatchFound); } isMatchFound = true; } } return(isMatchFound); }// end function
/// <summary> /// [async] отправить текстовое сообщение TelegramBot /// </summary> public async void SendMessageTelegramBotAsync(long chat_id, string message_text, ParseModes parse_mode = ParseModes.Markdown) { SetStatus("Отправка сообщения в чат: " + chat_id); await Task.Run(() => { try { MessageClass message = TelegramClient.sendMessage(chat_id.ToString(), message_text, parse_mode); SetStatus("Сообщение отправлено"); } catch { SetStatus("Ошибка отправки сообщения.", StatusTypes.ErrorStatus); SetStatus(TelegramClient.HttpRrequestStatus); } SetStatus(null); }); }