void rdpClient_WarningOccurred(object sender, WarningEventArgs e) { if (WarningOccurred != null) { WarningOccurred(this, e); } }
private void CalculationProgressWarning(object sender, WarningEventArgs e) { Dispatcher.UIThread.InvokeAsync(() => { Warnings.Add(e.Message); }); }
void Logger_WarningEvent(object sender, WarningEventArgs e) { string line = string.Empty; if ((e.Warning.MessageObject as FileMessageObject) != null) { FileMessageObject FMO = e.Warning.MessageObject as FileMessageObject; if (FMO.File == "EXEC") { line = Strings.Warning + " " + e.Warning.Message; } else { line = FMO.File + "(" + FMO.LineNumber + "," + FMO.ColumnNumber + "): " + Strings.Warning + " " + e.Warning.Code + ": " + e.Warning.Message; } } if ((e.Warning.MessageObject as ComponentMessageObject) != null) { ComponentMessageObject CMO = e.Warning.MessageObject as ComponentMessageObject; line = CMO.Component.Name + ": " + Strings.Warning + " " + e.Warning.Code + ": " + e.Warning.Message; } if (e.Warning.MessageObject == null) { } if (!string.IsNullOrEmpty(line)) { this.AppendText(line + "\r\n"); int linenum = GetOutputLinesCount() - 2; //En: -2 because last line always empty Ru: -2 потому что последняя линяя всегда пустая ErrorsAndWarningsDict.Add(linenum, e.Warning); } }
public void WarningEventArgsTest() { var args = new WarningEventArgs(1, 2, "mess", 3, 4, "colName"); Assert.AreEqual(1, args.RecordNumber); args.RecordNumber = 10; Assert.AreEqual(10, args.RecordNumber); Assert.AreEqual(2, args.ColumnNumber); args.ColumnNumber = 11; Assert.AreEqual(11, args.ColumnNumber); Assert.AreEqual(3, args.LineNumberStart); args.LineNumberStart = 12; Assert.AreEqual(12, args.LineNumberStart); Assert.AreEqual(4, args.LineNumberEnd); args.LineNumberEnd = 13; Assert.AreEqual(13, args.LineNumberEnd); Assert.AreEqual("mess", args.Message); args.Message = "mess2"; Assert.AreEqual("mess2", args.Message); Assert.AreEqual("colName", args.ColumnName); args.ColumnName = "colName2"; Assert.AreEqual("colName2", args.ColumnName); }
public void DisplayTest() { var args = new WarningEventArgs(1, 2, "mess", 3, 4, "colName"); Assert.AreEqual("mess", args.Display(false, false)); Assert.AreEqual("Line 3 - 4: mess", args.Display(true, false)); Assert.AreEqual("Line 3 - 4 Column [colName]: mess", args.Display(true, true)); Assert.AreEqual("Column [colName]: mess", args.Display(false, true)); }
void Logger_WarningEvent(object sender, WarningEventArgs e) { if (this.WarningsBtn.Checked) { AddWarning(e.Warning); } this.ErrorsAndWarningsList.AddWarning(e.Warning); LVColumnsResize(); SetBtnText(WarningsBtn, ErrorsAndWarningsList.WarningsCount + " Warnings"); }
public void WarningEventArgsDisplay() { var test1 = new WarningEventArgs(100, 200, "Warning", 201, 202, "ColName"); Assert.AreEqual(test1.Message, test1.Display(false, false)); Assert.AreEqual("Line 201 - 202 Column [ColName]: Warning", test1.Display(true, true)); var test2 = new WarningEventArgs(101, 202, "Warning", 203, -1, "ColName"); Assert.AreEqual("Line 203: Warning", test2.Display(true, false)); }
public void WarningEventArgsPropertySetGet() { var test1 = new WarningEventArgs(100, 200, "Warning", 201, 202, "ColName"); Assert.AreEqual(100, test1.RecordNumber); Assert.AreEqual(200, test1.ColumnNumber); Assert.AreEqual("Warning", test1.Message); Assert.AreEqual(201, test1.LineNumberStart); Assert.AreEqual(202, test1.LineNumberEnd); Assert.AreEqual("ColName", test1.ColumnName); }
#pragma warning disable CC0057 // Unused parameters protected internal void OnWarning(IntPtr converter, string message) #pragma warning restore CC0057 // Unused parameters { if (_configuration.WarningAction == null) { return; } var eventArgs = new WarningEventArgs( ProcessingDocument, message); _configuration.WarningAction?.Invoke(eventArgs); }
public void WarningEventArgsError() { var exception = false; try { var unused = new WarningEventArgs(100, 200, "", 201, 202, "ColName"); } catch (ArgumentException) { exception = true; } catch (Exception ex) { Assert.Fail("Wrong Exception Type: " + ex.GetType()); } Assert.IsTrue(exception, "No Exception thrown"); }
/// <summary> /// Warns the user. /// </summary> /// <param name="sender">The sender.</param> /// <param name="args">The argument.</param> protected void Warn(object sender, WarningEventArgs args) => Warning?.Invoke(sender, args);
void HandleM_WarningViewHelperWarningActivated(object sender, WarningEventArgs e) { GotoIndex(e.Index); }
private void HandleWarning(object sender, WarningEventArgs e) => throw new XunitException("Warning was raised: " + e.Message);
void session_WarningEvent(object sender, WarningEventArgs args) { eventView.LogWarning(args.ToString()); Trace.TraceWarning(args.ToString()); }
//=========================================================================================== private static void ShouldNotRaiseWarning(object sender, WarningEventArgs arguments) { Assert.Fail(arguments.Message); }
private void OnWarning(Object sender, WarningEventArgs e) { Console.WriteLine("Warning: " + e.ToString()); }
public void Write(object sender, WarningEventArgs ea) { MethodInfo method = tmi.GetType().GetMethod("WriteWarning"); method.Invoke(tmi, new object[] { sender, ea.Warning }); }
private static void MagickImage_Warning(object sender, WarningEventArgs arguments) { Console.WriteLine(arguments.Message); }
private void GesturesService_WarningLog(object sender, WarningEventArgs exception) { WriteLogMessage($"{exception.Exception}", Colors.Red); }
protected void OnWarning(WarningEventArgs e) { if (Warning != null) Warning(this, e); }
private void HandleWarning(object sender, WarningEventArgs e) { Assert.Fail("Warning was raised: " + e.Message); }
private void session_WarningEvent(object source, WarningEventArgs args) { eventView.LogWarning(args.ToString()); Trace.TraceWarning(args.ToString()); }
private void OnWarning(Object sender, WarningEventArgs e) { _logger.Add("Session Warning: " + e.ToString()); }
private void CalculationProgress_Warning(object sender, WarningEventArgs e) { _warningsSource.Add(e.Message); _warningsSource.MoveLast(); }