/// <summary> /// A window displaying the logged messages. /// </summary> /// <param name="windowID">The window's ID.</param> void ConsoleWindow(int windowID) { scrollPos = GUILayout.BeginScrollView(scrollPos); // Go through each logged entry for (int i = 0; i < entries.Count; i++) { ConsoleMessage entry = entries[i]; // If this message is the same as the last one and the collapse feature is chosen, skip it if (collapse && i > 0 && entry.message == entries[i - 1].message) { continue; } // Change the text colour according to the log type switch (entry.type) { case LogType.Error: case LogType.Exception: GUI.contentColor = Color.red; break; case LogType.Warning: GUI.contentColor = Color.yellow; break; default: GUI.contentColor = Color.white; break; } GUILayout.Label(entry.message); } GUI.contentColor = Color.white; GUILayout.EndScrollView(); GUILayout.BeginHorizontal(); // Clear button if (GUILayout.Button(clearLabel)) { entries.Clear(); } // Collapse toggle collapse = GUILayout.Toggle(collapse, collapseLabel, GUILayout.ExpandWidth(false)); GUILayout.EndHorizontal(); // Set the window to be draggable by the top title bar GUI.DragWindow(new Rect(0, 0, 10000, 20)); }
public void ChangeNestedTest() { string parentFlow = "Parent"; string nestedFlow1 = "Nested1"; string nestedFlow2 = "Nested2"; ConsoleMessage.StartTest("Flow Object: Change Nested", "FlowObject"); Appium.Instance.Driver.LaunchApp(); LoginActivity.LoginStep(_user, _timeout); BrowserActivity.CreateAssay(_assay); //setup parent BrowserActivity.CreateFlow(parentFlow); BrowserActivity.FlowList.FindAndTap(parentFlow); FlowActivity.AddElement("Add"); FlowActivity.AddElement("Flow"); FlowActivity.ElementList.VerifyElementCountByClass(2, "android.widget.EditText"); TabMenu.Browser.Tap(); //setup nested1 BrowserActivity.AssayList.FindAndTap(_assay); BrowserActivity.CreateFlow(nestedFlow1); BrowserActivity.FlowList.FindAndTap(nestedFlow1); FlowActivity.AddElement("Add"); FlowActivity.ElementList.VerifyElementCountByClass(1, "android.widget.EditText"); TabMenu.Browser.Tap(); //setup nested2 BrowserActivity.AssayList.FindAndTap(_assay); BrowserActivity.CreateFlow(nestedFlow2); BrowserActivity.FlowList.FindAndTap(nestedFlow2); FlowActivity.AddElement("Aspirate"); FlowActivity.ElementList.VerifyElementCountByClass(1, "android.widget.EditText"); TabMenu.Browser.Tap(); //link parent and nested1 BrowserActivity.AssayList.FindAndTap(_assay); BrowserActivity.FlowList.FindAndTap(parentFlow); FlowActivity.ElementList.FindAndTap("Flow"); FlowElementDialog.SelectFlow.Tap(); FlowSelectNesting.ItemList.FindAndTap(_assay); FlowSelectNesting.ItemList.FindAndTap(nestedFlow1); FlowElementDialog.Ok.Tap(); FlowActivity.ElementList.FindAndTap(nestedFlow1); FlowElementDialog.ShowNested.Tap(); FlowActivity.FlowName.VerifyText(nestedFlow1); FlowActivity.NavPanel(NavPanel.Parent); //change nested FlowActivity.ElementList.FindAndTap(nestedFlow1); FlowElementDialog.SelectFlow.Tap(); FlowSelectNesting.ItemList.FindAndTap(_assay); FlowSelectNesting.ItemList.FindAndTap(nestedFlow2); FlowElementDialog.Ok.Tap(); FlowActivity.ElementList.FindAndTap(nestedFlow2); FlowElementDialog.ShowNested.Tap(); FlowActivity.FlowName.VerifyText(nestedFlow2); TabMenu.Logout.Tap(); }
public void handleConsoleMessage(string message) { if (ConsoleMessage.notNull()) { ConsoleMessage(message); } if (ShowConsoleMessageInLogViewer) { "[BlindElephant] {0}".info(message); } }
/// <summary> /// Logged messages are sent through this callback function. /// </summary> /// <param name="message">The message itself.</param> /// <param name="stackTrace">A trace of where the message came from.</param> /// <param name="type">The type of message: error/exception, warning, or assert.</param> void HandleLog(string message, string stackTrace, LogType type) { ConsoleMessage entry = new ConsoleMessage(message, stackTrace, type); entries.Add(entry); if (entries.Count > LIMIT_LINE) { entries.RemoveAt(0); } if (GameManager.CurrentScene == ESceneName.GameplayChan && type == LogType.Exception) { WaitingView.Show("Có l?i x?y ra. Vui lòng d?i!"); GameManager.Server.DoRequestGameCommand("refreshGame"); } entriesConsole.Add(entry); if (entriesConsole.Count > LIMIT_LINE_CONSOLE) { entriesConsole.RemoveAt(0); } if (type == LogType.Error && !message.StartsWith("Coroutine couldn't be started because the the game object")) { StoreGame.ClearLog(); for (int i = 0; i < entries.Count; i++) { StoreGame.SaveLog(StoreGame.EType.DEBUG_LOG, entries[i].message); } //SaveLogToFile(); //for test string url = ServerWeb.URL_REQUEST_ERROR; string data = ConvertStringToJson(StoreGame.LoadString(StoreGame.EType.DEBUG_LOG)); WWWForm form = new WWWForm(); form.AddField("app_id", GameManager.GAME.ToString()); form.AddField("game_version", GameSettings.CurrentVersion); if (GameManager.CurrentScene != ESceneName.LoginScreen) { form.AddField("user_id", GameManager.Instance.mInfo.id); form.AddField("username", GameManager.Instance.mInfo.username); } form.AddField("scene", GameManager.CurrentScene.ToString()); form.AddField("error", ""); form.AddField("detail", ""); form.AddField("environment", Common.GetDevice); form.AddField("debug_log", data); form.AddField(ServerWeb.PARAM_PARTNER_ID, GameSettings.Instance.ParnerCodeIdentifier); if (!listSendError.Contains(form)) { listSendError.Add(form); ServerWeb.StartThread(url, form, null); } } }
protected override bool OnConsoleMessage(CefBrowser browser, string message, string source, int line) { var consoleArgs = new ConsoleMessageArgs(message, source, line); if (ConsoleMessage == null) { Trace.WriteLine(consoleArgs); } ConsoleMessage?.Invoke(this, consoleArgs); return(false); }
public static void SendTo(this byte[] data, IPEndPoint eps) { try { UDPWorker.Client.SendTo(data, eps); } catch (Exception ex) { ConsoleMessage.WriteException(ex.Message, "GameCommander.cs", "SendTo"); } }
static ConsoleMessage Add(MessageType type, string message) { var cm = new ConsoleMessage(type, message); instance.messages.Add(cm); while (instance.messages.Count > instance.capacity) { instance.messages.RemoveAt(0); } return(cm); }
/// <summary> /// Add a combat message to the stringbuilder /// </summary> /// <param name="message">The message that is to be added</param> public void AddMessage(ConsoleMessage message) { if (InCombat && message.Mode == ConsoleState.Combat) { String handledMessage = combatReporting.HandleMessage(message, configuration); if (handledMessage != null) { CombatLogStringBuilder.Append(handledMessage); } } }
public override bool OnConsoleMessage(ConsoleMessage consoleMessage) { //Log.Debug("LogTag", message); //result.Confirm(); TextView text_view1 = (TextView)activity.FindViewById(Resource.Id.textView1); myConsoleResponseHandler(consoleMessage.Message()); text_view1.Text = consoleMessage.Message(); return(true); }
public void AddOnly() { string flowName = "Add"; Permission permission = new Permission(true, false, false, true); //create flow ConsoleMessage.StartTest("Share flow with user: Add", "ShareFlow"); Appium.Instance.Driver.LaunchApp(); LoginActivity.LoginStep(_user1, _timeout); BrowserActivity.AssayList.FindAndTap(_assay); BrowserActivity.CreateFlow(flowName); BrowserActivity.FlowList.FindAndTap(flowName); FlowActivity.AddElement(element1); FlowActivity.AddElement(element2); FlowActivity.AddElement(element3); FlowActivity.ElementList.VerifyElementCountByClass(3, "android.widget.EditText"); //share FlowActivity.Share.Tap(); FlowActivity.ShareOk.Tap(); FlowShareDialog.ShareWithUserStep(_team, _user2.Name, permission); CommonOperation.Delay(_shareDelay); TabMenu.Logout.Tap(); //verify LoginActivity.LoginStep(_user2, _timeout); CommonOperation.Delay(_loginDelay); BrowserActivity.AssayList.FindAndTap("Shared With: " + _user1.Name); BrowserActivity.FlowList.FindAndTap(_assay); BrowserActivity.FlowList.FindAndTap(flowName); FlowActivity.ElementList.VerifyElementCountByClass(3, "android.widget.EditText"); //verify can't add element FlowActivity.AddElement("Add"); FlowActivity.ElementList.VerifyElementCountByClass(4, "android.widget.EditText"); //verify can't delete element FlowActivity.DeleteElement("Add"); FlowActivity.ElementList.VerifyElementCountByClass(4, "android.widget.EditText"); //verify can't share flow FlowActivity.Share.Tap(); FlowPermissionErrorDialog.DialogName.VerifyText("Share Permission"); FlowPermissionErrorDialog.Ok.Tap(); //verify can't delete flow FlowActivity.DeleteFlow.Tap(); FlowPermissionErrorDialog.DialogName.VerifyText("Delete Permission"); FlowPermissionErrorDialog.Ok.Tap(); TabMenu.Logout.Tap(); //verify on recipient LoginActivity.LoginStep(_user1, _timeout); CommonOperation.Delay(_loginDelay); BrowserActivity.AssayList.FindAndTap(_assay); BrowserActivity.FlowList.FindAndTap(flowName); FlowActivity.ElementList.VerifyElementCountByClass(4, "android.widget.EditText"); TabMenu.Logout.Tap(); }
public static void AddMessage(ConsoleMessage consoleMessage) { if (Messages.Contains(consoleMessage)) { Debug.LogError($"Message already exist: [{consoleMessage.Message}]"); } else { Messages.Add(consoleMessage); } }
void HandleLog(string message, string stackTrace, LogType type) { if (entries.Count > 200) { entries.Clear(); } ConsoleMessage entry = new ConsoleMessage(message, stackTrace, type); entries.Add(entry); }
private void RegisterTerminalCommands() { _commandController.Register(new Command("close", "closes console", _ => { IsOpen = false; return("opened"); })); _commandController.Register(new Command("clear", "clears console", _ => { ClearLog(); return("clear"); })); _commandController.Register(new Command("filter", "filter console items", args => { const string enabledStr = "-e:"; const string disabledStr = "-d"; if (args.Length == 2) { var value = args[1].Trim(); if (value.StartsWith(enabledStr)) { var regexStr = value.Substring(enabledStr.Length); _regex = new Regex(regexStr, RegexOptions.IgnoreCase); return("filter enabled"); } if (value.StartsWith(disabledStr)) { _regex = null; return("filter disabled"); } } LogMessage(ConsoleMessage.Info("Wrong syntax: \n\tfilter -e:<regex> \n\tfilter -d")); return(""); })); _commandController.Register(new GeocodeCommand(_container.Resolve <IGeocoder>())); _commandController.Register(new GrepCommand(_messages)); _commandController.Register(new SysCommand()); _commandController.Register(new Command("help", "prints help", args => { var output = new StringBuilder(); output.AppendLine(":: Command List ::"); foreach (var name in _commandController.Commands.Keys) { var command = _commandController.Commands[name]; output.AppendFormat("{0}: {1}\n", name, command.Description); } output.AppendLine(" "); return(output.ToString()); })); }
public void DeleteEmployee() { Employee employee = this.GetEmployee(); if (employee == null) { ConsoleMessage.Show("Colaborador não localizado.", ConsoleMessage.TypeMessage.WARNING); return; } this.GetEmployeeDetails(employee); Boolean noDelete = false; while (true) { Console.Write("Deseja mesmo excluir o registro do colaborador "); Console.ForegroundColor = ConsoleColor.Cyan; Console.Write(employee.Name); Console.ForegroundColor = ConsoleColor.Gray; Console.Write(" com CPF "); Console.ForegroundColor = ConsoleColor.Cyan; Console.Write(employee.DocumentNumber); Console.ForegroundColor = ConsoleColor.Gray; Console.Write(" [s/n] ? "); String op = Console.ReadLine().ToLower(); if (op.Equals("s")) { break; } else if (op.Equals("n")) { noDelete = true; break; } else { ConsoleMessage.Show("Informe \"s\" ou \"n\".", ConsoleMessage.TypeMessage.WARNING); continue; } } if (noDelete) { ConsoleMessage.Show("Operação cancelada", ConsoleMessage.TypeMessage.WARNING); return; } EmployeeRepository repository = new EmployeeRepository(); repository.Delete(employee); ConsoleMessage.Show("Registro excluído", ConsoleMessage.TypeMessage.SUCCESS); }
public void LogMessage(ConsoleMessage msg) { if (_regex != null && !_regex.IsMatch(msg.Text)) { return; } lock (_messages) _messages.Add(msg); _dirty = true; }
private static void WaitForUser() { Console.Clear(); ConsoleMessage.Message("Press any key to start."); Console.ReadKey(intercept: true); while (Console.KeyAvailable) { Console.ReadKey(intercept: true); } Console.Clear(); }
/// <summary> /// Adds a chat message to the chat box /// </summary> public void AddChat(string username, string message) { message = WrapText(ChatBox.GetFont(), username + ": " + message, ChatBox.Width - 24); ConsoleMessage c = new ConsoleMessage(message, 0); string[] texts = c.Text.Split(new string[1] { TomShane.Neoforce.Controls.Manager.StringNewline }, System.StringSplitOptions.None); ConsoleMessage[] msgs = new ConsoleMessage[texts.Length]; AddText(c, texts, msgs); }
public static void Start(string Receiving, IPEndPoint EP) { try { GameCommandObject obj = JsonConvert.DeserializeObject <GameCommandObject>(Receiving); EP.AddToSocketList(); } catch (Exception ex) { ConsoleMessage.WriteException(ex.Message, "GameCommander.cs", "Start"); } }
private void AwesomiumWebControl_ConsoleMessage(object sender, Awesomium.Core.ConsoleMessageEventArgs e) { try { ConsoleMessage?.Invoke(e.Message); } catch (Exception) { //В некоторых случаях, 1Ска подписывается на событие, хотя явного вызова ДобавитьОбработчик нет, //при срабатывании ком обьект просто падает, с ошибкой 0x80020003 } }
public static String GetStringByConsole(String message) { String data; do { ConsoleMessage.Print(message, 1); data = Console.ReadLine(); } while (data == ""); return(data); }
private void SetWebDriverSettings(string filePath) { ConsoleMessage.Print("Read config file and applying settings."); FileValidation.ExtensionIsValid(filePath, ".json"); string file = File.ReadAllText(filePath); JsonFile data = JsonSerializer.Deserialize <JsonFile>(file); settings = data; ConsoleMessage.Print("Settings applied with success.", "success"); }
protected void OnMessageReceived(object sender, IrcMessageEventArgs message) { try { var subscriptions = SubscriptionsRepository.GetSubscriptions(message); subscriptions.ForEach(callback => callback(message)); } catch (Exception e) { var messageConsoleRedirect = new ConsoleMessage(e.Message); SendMessage(messageConsoleRedirect); } }
/// <summary> /// Logged messages are sent through this callback function. /// </summary> /// <param name="message">The message itself.</param> /// <param name="stackTrace">A trace of where the message came from.</param> /// <param name="type">The type of message: error/exception, warning, or assert.</param> void HandleLog(string message, string stackTrace, LogType type) { // if (type == LogType.Log) // return; AutoClear(); lock (m_MsgLock) { ConsoleMessage entry = new ConsoleMessage(message, stackTrace, type); entries.Add(entry); } }
public static void SelectFlowPlan() { try { FlowType.GetInternalElement().FindElementByName("Flow Plan").Click(); ConsoleMessage.Pass(String.Format("{0}. Select: Flow Plan", ActivityName)); } catch (Exception ex) { ConsoleMessage.Fail(String.Format("{0}. Can't Select: Flow Plan", ActivityName), ex); throw; } }
public void SendConsoleOutput(UUID agentID, string message) { OSD osd = OSD.FromString(message); m_eventQueue.Enqueue(EventQueueHelper.BuildEvent("SimConsoleResponse", osd), agentID); ConsoleMessage handlerConsoleMessage = OnConsoleMessage; if (handlerConsoleMessage != null) { handlerConsoleMessage(agentID, message); } }
/// <summary> /// Used to add text messages to the chat box /// </summary> private void AddText(ConsoleMessage c, string[] texts, ConsoleMessage[] msgs) { for (int i = 0; i < texts.Length; i++) { string str = texts[i]; msgs[i] = new ConsoleMessage(str, c.Channel, c.Color); msgs[i].NoShow = i > 0; if (!string.IsNullOrWhiteSpace(msgs[i].Text)) { ChatBox.MessageBuffer.Add(msgs[i]); } } }
public static void VerifyLibraryNotExist(string libraryName) { try { Assert.True(LibraryList.GetInternalElement().FindElementsByName(libraryName).Count == 0, "Library with name: " + libraryName + " exist"); ConsoleMessage.Pass(String.Format("{0}. Verify, library with name: {1} not exist", ActivityName, libraryName)); } catch (Exception ex) { ConsoleMessage.Fail(String.Format("{0}. Verify fail. Library with name: {1} still exist", ActivityName, libraryName), ex); throw; } }
private void Start() { PreSpawnLogic(); owner = Player.Get(gameObject); owner.Role = Role; Timing.CallDelayed(0.1f, () => { if (Health > 0) { owner.Health = Health; owner.MaxHealth = Health; } if (!Tag.IsEmpty()) { owner.PlayerInfoArea &= ~PlayerInfoArea.Role; owner.CustomPlayerInfo = Tag; } if (!Ammo.IsEmpty() && Ammo.Length == 3) { owner.Ammo[(int)AmmoType.Nato556] = Ammo[0]; owner.Ammo[(int)AmmoType.Nato762] = Ammo[1]; owner.Ammo[(int)AmmoType.Nato9] = Ammo[2]; } if (!Inventory.IsEmpty()) { owner.ClearInventory(); foreach (ItemType itm in Inventory) { owner.AddItem(itm); } } if (Spawnpoint != RoomType.Unknown) { owner.Position = Map.Rooms.Where(r => r.Type == Spawnpoint).FirstOrDefault().Position; } if (!Broadcast.IsEmpty()) { owner.Broadcast(5, Broadcast); } if (!ConsoleMessage.IsEmpty()) { owner.SendConsoleMessage(ConsoleMessage, "yellow"); } if (!GlobalBroadcast.IsEmpty()) { Map.Broadcast(5, GlobalBroadcast); } PostSpawnLogic(); Initialized = true; }); }
public void ShareOnly() { string shareName = string.Format("{0}=Share", _version); string reshareName = string.Format("{0}=Rshr", _version); Permission permission = new Permission(true, true, false, false); Permission allPermission = new Permission(true, true, true, true); ConsoleMessage.StartTest("Share library with user: Share", "ShareLibrary"); //share on owner Appium.Instance.Driver.LaunchApp(); LoginActivity.LoginStep(_user1, _timeout); TabMenu.Library.Tap(); LibraryActivity.SelectAndShareLibrary(_baseLibrary, shareName); LibraryShareDialog.ShareWithUserStep(_team, _user2.Name, permission); CommonOperation.Delay(_shareDelay); TabMenu.Logout.Tap(); //verify on recipient LoginActivity.LoginStep(_user2, _timeout); CommonOperation.Delay(_loginDelay); TabMenu.Library.Tap(); LibraryActivity.LibraryList.FindAndTap(shareName); LibraryActivity.ElementList.VerifyElementCountById(20, "library_document_icon"); //verify can't add element LibraryActivity.AddElement.Tap(); LibraryPermissionErrorDialog.DialogName.VerifyText("Add Permission"); LibraryPermissionErrorDialog.Ok.Tap(); //verify can't delete library LibraryActivity.DeleteLibrary.Tap(); LibraryPermissionErrorDialog.DialogName.VerifyText("Delete Permission"); LibraryPermissionErrorDialog.Ok.Tap(); //verify can't delete library element LibraryActivity.ElementList.FindAndTap("Add"); LibraryElementActivity.Delete.Tap(); LibraryPermissionErrorDialog.DialogName.VerifyText("Delete Permission"); LibraryPermissionErrorDialog.Ok.Tap(); LibraryElementActivity.Cancel.Tap(); //verify can't share library LibraryActivity.SelectAndShareLibrary(shareName, reshareName); LibraryShareDialog.ShareWithUserStep(_team, _user1.Name, allPermission); CommonOperation.Delay(_shareDelay); TabMenu.Logout.Tap(); //verify on owner LoginActivity.LoginStep(_user1, _timeout); CommonOperation.Delay(_loginDelay); TabMenu.Library.Tap(); LibraryActivity.LibraryList.FindAndTap(reshareName); LibraryActivity.ElementList.VerifyElementCountById(20, "library_document_icon"); TabMenu.Logout.Tap(); }
private static void RequestAlteration(EmployeeVm emp, string text, string value, string property, InputText.InputValidator validator) { var conMessage = new ConsoleMessage(text + value); conMessage.Show(); var confirmation = new ConsoleConfirmation("Alterar?"); confirmation.Show(); if (confirmation.Confirmed) { new BindInputText <EmployeeVm>(text, emp, property, validator).Show(); } }
public override bool OnConsoleMessage(ConsoleMessage consoleMessage) { if (consoleMessage.Message().Contains(JS_PREFIX)) { Return = consoleMessage.Message().Replace(JS_PREFIX, string.Empty); JsTrigger.Set(); } else { Console += consoleMessage.Message() + "\n"; } return true; }
public static void ConsoleLogMessage(String msg, ConsoleMessage type) { Console.Out.Write(getLoggingStamp() + " "); switch (type) { case ConsoleMessage.INFO: Console.ForegroundColor = ConsoleColor.Gray; Console.Out.Write("INFO: "); Console.Out.WriteLine(msg); break; case ConsoleMessage.WARN: Console.ForegroundColor = ConsoleColor.Yellow; Console.Out.Write("WARN: "); Console.ForegroundColor = ConsoleColor.Gray; Console.Out.WriteLine(msg); break; case ConsoleMessage.FOUND: Console.ForegroundColor = ConsoleColor.Green; Console.Out.Write("FOUND: "); Console.ForegroundColor = ConsoleColor.Gray; Console.Out.WriteLine(msg); break; case ConsoleMessage.FATAL: Console.ForegroundColor = ConsoleColor.Red; Console.Out.Write("FATAL: "); Console.ForegroundColor = ConsoleColor.Gray; Console.Out.WriteLine(msg); // FATAL messages are assumed to be truly fatal, // so we'll pause until the user has seen the // message and then close the application. Console.Out.WriteLine("RETURN to continue..."); Console.In.ReadLine(); Environment.Exit(1); break; } }
/// <summary> /// Called when a chat is sent from the local user /// </summary> void SentChat(object sender, ConsoleMessageEventArgs e) { e.Message.Text = WrapText(ChatBox.GetFont(), Game.Username + ": " + e.Message.Text, ChatBox.Width - 24); ConsoleMessage c = new ConsoleMessage(e.Message.Text, 0); Game.NetManager.Send(new Networking.Messages.ChatMessage(Game.Me, e.Message.Text.Substring((Game.Username + ": ").Length))); string[] texts = c.Text.Split(new string[1] { TomShane.Neoforce.Controls.Manager.StringNewline }, System.StringSplitOptions.None); ConsoleMessage[] msgs = new ConsoleMessage[texts.Length]; AddText(c, texts, msgs); ChatBox.TextBox.Focused = false; Manager.FocusedControl = Game.MainWindow; }
void HandleLog (string message, string stackTrace, LogType type){ ConsoleMessage newMessage = new ConsoleMessage(message, stackTrace, type); messages.Add(newMessage); }
//////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// public ConsoleMessageEventArgs(ConsoleMessage message) { Message = message; }
public override bool OnConsoleMessage (ConsoleMessage consoleMessage) { var messageLvl = consoleMessage.InvokeMessageLevel (); if (messageLvl.Equals (ConsoleMessage.MessageLevel.Tip)) Log.Verbose (TAG, consoleMessage.Message ()); if (messageLvl.Equals (ConsoleMessage.MessageLevel.Log)) Log.Info (TAG, consoleMessage.Message ()); if (messageLvl.Equals (ConsoleMessage.MessageLevel.Warning)) Log.Warn (TAG, consoleMessage.Message ()); if (messageLvl.Equals (ConsoleMessage.MessageLevel.Error)) Log.Error (TAG, consoleMessage.Message ()); if (messageLvl.Equals (ConsoleMessage.MessageLevel.Debug)) Log.Debug (TAG, consoleMessage.Message ()); if (null != permissionReqFrag.mConsoleMonitor) { permissionReqFrag.mConsoleMonitor.OnConsoleMessage (consoleMessage); } return true; }
public void WriteMessage(ConsoleMessage type, ConsoleColorExt colour, int errorId, string str) { ConsoleExt.WriteMessage(type, colour, errorId, str); }
public static void WriteMessage(ConsoleMessage type, ConsoleThemeColor colour, int errorId, string sourceFile, int line, int character, string str) { App.WriteMessage(type, colour, errorId, sourceFile, line, character, str); }
public static void WriteMessage(ConsoleMessage type, ConsoleColorExt colour, string str) { App.WriteMessage(type, colour, str); }
/// <summary> /// Logged messages are sent through this callback function. /// </summary> /// <param name="message">The message itself.</param> /// <param name="stackTrace">A trace of where the message came from.</param> /// <param name="type">The type of message: error/exception, warning, or assert.</param> void HandleLog(string message, string stackTrace, LogType type) { if (type == LogType.Error) { show = true; } ConsoleMessage entry = new ConsoleMessage(message, stackTrace, type); entries.Add(entry); }
public static void WriteMessage(ConsoleMessage type, ConsoleColorExt colour, int errorId, string sourceFile, int line, int character, string str) { string str2 = str; if (IsBuildMode) { string str3 = ""; if (type == ConsoleMessage.Warning) { if (WarningsAsErrors) { str3 = "error"; } else { str3 = "warning"; } } else if (type == ConsoleMessage.Prompt) { if (WarningsAsErrors) { str3 = "error"; } else { str3 = "warning"; } } else { str3 = "error"; } string executablePath = null; if (sourceFile == null) { executablePath = Application.ExecutablePath; } else { executablePath = string.Concat(new object[] { sourceFile, "(", line, ",", character, ")" }); } if ((str3 != "warning") || ((str3 == "warning") && ReportWarnings)) { str2 = executablePath + ": " + str3 + " " + ApplicationBuildReportPrefix + errorId.ToString().PadLeft(4, '0') + ": " + str.Replace("\n", " "); } } ConsoleColor foregroundColor = Console.ForegroundColor; if (colour != ConsoleColorExt.Inhreit) { Console.ForegroundColor = (ConsoleColor) colour; } if (CanManipulateBuffer) { if (Console.CursorLeft > 0) { Console.WriteLine(); } Console.WriteLine(str2); } else { Console.WriteLine(Environment.NewLine + str2); } Console.ForegroundColor = foregroundColor; }
/// <summary> /// Called when page adds something to console output, e.g. when a JavaScript error occured /// </summary> /// <param name="consoleMessage"></param> /// <returns></returns> public override bool OnConsoleMessage(ConsoleMessage consoleMessage) { var ln = consoleMessage.LineNumber(); var msg = consoleMessage.Message(); var sid = consoleMessage.SourceId(); //NOTE: We can rise NavigationFailed event here with JS error, but Microsoft control doesn't work that way return base.OnConsoleMessage(consoleMessage); }
/// <summary> /// Adds a system chat message to the chat box /// </summary> public void SystemChat(string message) { message = WrapText(ChatBox.GetFont(), "[color:Gold]*[/color]" + message, ChatBox.Width - 24); ConsoleMessage c = new ConsoleMessage(message, 0); string[] texts = c.Text.Split(new string[1] { TomShane.Neoforce.Controls.Manager.StringNewline }, System.StringSplitOptions.None); ConsoleMessage[] msgs = new ConsoleMessage[texts.Length]; AddText(c, texts, msgs); }
/// <summary> /// Logged messages are sent through this callback function. /// </summary> /// <param name="message">The message itself.</param> /// <param name="stackTrace">A trace of where the message came from.</param> /// <param name="type">The type of message: error/exception, warning, or assert.</param> void HandleLog(string message, string stackTrace, LogType type) { ConsoleMessage entry = new ConsoleMessage(message, stackTrace, type, DateTime.Now.ToString("hh:mm:ss")); entries.Add(entry); if (entries.Count > LIMIT_LINE) entries.RemoveAt(0); }
/// <summary> /// Used to add text messages to the chat box /// </summary> private void AddText(ConsoleMessage c, string[] texts, ConsoleMessage[] msgs) { for (int i = 0; i < texts.Length; i++) { string str = texts[i]; msgs[i] = new ConsoleMessage(str, c.Channel, c.Color); msgs[i].NoShow = i > 0; if (!string.IsNullOrWhiteSpace(msgs[i].Text)) ChatBox.MessageBuffer.Add(msgs[i]); } }
/// <summary> /// Logged messages are sent through this callback function. /// </summary> /// <param name="message">The message itself.</param> /// <param name="stackTrace">A trace of where the message came from.</param> /// <param name="type">The type of message: error/exception, warning, or assert.</param> void HandleLog(string message, string stackTrace, LogType type) { AutoClear(); lock(m_MsgLock) { ConsoleMessage entry = new ConsoleMessage(message, stackTrace, type); entries.Add(entry); } }
public void LogError(string message) { AutoClear(); lock(m_MsgLock) { ConsoleMessage entry = new ConsoleMessage(message, "", LogType.Error); entries.Add(entry); } }
public static void WriteMessage(ConsoleMessage type, ConsoleThemeColor colour, int errorId, string str) { WriteMessage(type, Theme[colour], errorId, null, 0, 0, str); }
public static void WriteMessage(ConsoleMessage type, ConsoleThemeColor colour, int errorId, string str) { App.WriteMessage(type, colour, errorId, str); }
public override bool OnConsoleMessage (ConsoleMessage consoleMessage) { Console.WriteLine (consoleMessage.Message ()); return base.OnConsoleMessage (consoleMessage); }
public static void WriteMessage(ConsoleMessage type, ConsoleColorExt colour, int errorId, string str) { WriteMessage(type, colour, errorId, null, 0, 0, str); }
public static void WriteMessage(ConsoleMessage type, ConsoleThemeColor colour, string str) { WriteMessage(type, Theme[colour], 0, str); }
public void WriteMessage(ConsoleMessage type, ConsoleThemeColor colour, string str) { ConsoleExt.WriteMessage(type, colour, str); }
public virtual bool onConsoleMessage(ConsoleMessage msg) { Log.Debug(TAG, "console: " + msg.Message() + " at " + msg.SourceId() + ":" + msg.LineNumber()); return true; }
/// <summary> /// Prints a message to the console event. /// </summary> /// <param name="message"></param> /// <param name="type"></param> public static void PrintConsole(string message, ConsoleMessageType type) { var msg = new ConsoleMessage(message, type); if (Console.PrintConsoleMessage != null) Console.PrintConsoleMessage(null, msg); }
public void WriteMessage(ConsoleMessage type, ConsoleColorExt colour, int errorId, string sourceFile, int line, int character, string str) { ConsoleExt.WriteMessage(type, colour, errorId, sourceFile, line, character, str); }
public override bool OnConsoleMessage(ConsoleMessage consoleMessage) { Log.Debug("AgWebChromeClient", consoleMessage.SourceId() + " (" + consoleMessage.LineNumber() + "): " + consoleMessage.Message()); return true; }
/// <summary> /// Logged messages are sent through this callback function. /// </summary> /// <param name="message">The message itself.</param> /// <param name="stackTrace">A trace of where the message came from.</param> /// <param name="type">The type of message: error/exception, warning, or assert.</param> void HandleLog(string message, string stackTrace, LogType type) { ConsoleMessage entry = new ConsoleMessage(message, stackTrace, type); entries.Add(entry); }
/// <summary> /// Logged messages are sent through this callback function. /// </summary> /// <param name="message">The message itself.</param> /// <param name="stackTrace">A trace of where the message came from.</param> /// <param name="type">The type of message: error/exception, warning, or assert.</param> void HandleLog(string message, string stackTrace, LogType type) { ABFileLog.Write("Heros", type, message + " -> " + stackTrace); if (!bOut) return; AutoClear(); lock(m_MsgLock) { ConsoleMessage entry = new ConsoleMessage(message, stackTrace, type); entries.Add(entry); } }
public void Echo(ConsoleMessage messageType, string text) { string[] buffer = text.Split(new string[] { "\r\n", "\n" }, StringSplitOptions.None); string[] substringBuffer; int ind = linesLastIndex % maxLinesInMemory; int drawWidth = Game.Window.ClientBounds.Width-10; int j; //Get the starting index to begin writing. If we already have the maximum number of lines //in memory begin overwriting at the start index. for (int i = 0; i<buffer.Length; i++) { if (debugResources.DebugFont.MeasureString(buffer[i]).X > drawWidth) { substringBuffer = WrapText(buffer[i], drawWidth); for (j = 0; j < substringBuffer.Length; j++) { lines[ind] = substringBuffer[j]; linesLastIndex++; ind = linesLastIndex % maxLinesInMemory; numOfLines++; } } else { lines[ind] = buffer[i]; linesLastIndex++; ind = linesLastIndex % maxLinesInMemory; numOfLines++; } } renderStartIndex = linesLastIndex - MaxLineCount; linesLastIndex %= maxLinesInMemory; if (numOfLines >= maxLinesInMemory) { numOfLines = maxLinesInMemory; if (renderStartIndex < 0) renderStartIndex += maxLinesInMemory; } else if (renderStartIndex < 0) { renderStartIndex = 0; } // Call registered listeners. foreach (IEchoListener listner in listeners) listner.Echo(messageType, text); }