Esempio n. 1
0
 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);
     });
 }
Esempio n. 3
0
        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));
        }
Esempio n. 6
0
 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");
 }
Esempio n. 7
0
        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));
        }
Esempio n. 8
0
        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);
        }
Esempio n. 9
0
#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);
        }
Esempio n. 10
0
        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");
        }
Esempio n. 11
0
 /// <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);
 }
Esempio n. 13
0
 private void HandleWarning(object sender, WarningEventArgs e)
 => throw new XunitException("Warning was raised: " + e.Message);
Esempio n. 14
0
 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);
 }
Esempio n. 16
0
 private void OnWarning(Object sender, WarningEventArgs e)
 {
     Console.WriteLine("Warning: " + e.ToString());
 }
Esempio n. 17
0
 public void Write(object sender, WarningEventArgs ea)
 {
     MethodInfo method = tmi.GetType().GetMethod("WriteWarning");
     method.Invoke(tmi, new object[] { sender, ea.Warning });
 }
Esempio n. 18
0
 private static void MagickImage_Warning(object sender, WarningEventArgs arguments)
 {
     Console.WriteLine(arguments.Message);
 }
Esempio n. 19
0
 private void GesturesService_WarningLog(object sender, WarningEventArgs exception)
 {
     WriteLogMessage($"{exception.Exception}", Colors.Red);
 }
Esempio n. 20
0
        public void Write(object sender, WarningEventArgs ea)
        {
            MethodInfo method = tmi.GetType().GetMethod("WriteWarning");

            method.Invoke(tmi, new object[] { sender, ea.Warning });
        }
		protected void OnWarning(WarningEventArgs e) {
			if (Warning != null) Warning(this, e);
		}
Esempio n. 22
0
 private void HandleWarning(object sender, WarningEventArgs e)
 {
     Assert.Fail("Warning was raised: " + e.Message);
 }
Esempio n. 23
0
 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();
 }