/// <summary>
        /// Returns true if ReduceWarningInfo instances are equal
        /// </summary>
        /// <param name="input">Instance of ReduceWarningInfo to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ReduceWarningInfo input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     WarningCode == input.WarningCode ||
                     WarningCode.Equals(input.WarningCode)
                     ) &&
                 (
                     PageNumber == input.PageNumber ||
                     PageNumber.Equals(input.PageNumber)
                 ) &&
                 (
                     PageImageNumber == input.PageImageNumber ||
                     PageImageNumber.Equals(input.PageImageNumber)
                 ) &&
                 (
                     ExtWarningMessage == input.ExtWarningMessage ||
                     (ExtWarningMessage != null &&
                      ExtWarningMessage.Equals(input.ExtWarningMessage))
                 ));
        }
Esempio n. 2
0
 // General warnings
 // Note that the warningNumber corresponds to an HRESULT in src\inc\corerror.xml
 public static void WriteWarning(string message, WarningCode warningCode)
 {
     if (!CheckSilent((int)warningCode))
     {
         String warningFormat = "TlbImp : warning TI{1:0000} : {0}";
         Console.Error.WriteLine(warningFormat, message, (int)warningCode);
     }
 }
Esempio n. 3
0
        // warnings 70**

        internal static Diagnostic LoadWarning(WarningCode code, IEnumerable <string> args, string source) =>
        new Diagnostic
        {
            Severity = DiagnosticSeverity.Warning,
            Code     = Warnings.Code(code),
            Source   = source,
            Message  = DiagnosticItem.Message(code, args ?? Enumerable.Empty <string>()),
            Range    = null
        };
Esempio n. 4
0
 /// <summary>
 /// Logs a a diagnostic message based on the given warning code,
 /// with the given source as the file for which the error occurred.
 /// </summary>
 public void Log(WarningCode code, IEnumerable <string> args, string source = null, LSP.Range range = null) =>
 this.Log(new Diagnostic
 {
     Severity = DiagnosticSeverity.Warning,
     Code     = Warnings.Code(code),
     Source   = source,
     Message  = DiagnosticItem.Message(code, args ?? Enumerable.Empty <string>()),
     Range    = range
 });
Esempio n. 5
0
        public static string GetFriendlyWarningCode(WarningCode code)
        {
            switch (code)
            {
            case WarningCode.RedundantStatement:
                return("Redundant statement.");

            default:
                return(code + ".");
            }
        }
        public void AddWarning(WarningCode warningCode, string info)
        {
            // TODO: make number of maximum warnings configureable
            if (_warnings.Count >= MaximumWarningCount)
                throw new CodeGeneratorException(ErrorCode.TooManyWarnings);

            if (info == null || info == string.Empty)
                info = "No Info"; // should not occur

            string warningText = string.Format("OBLXW{0:d4}: {1}: {2}", (int)warningCode, warningCode.ToString(), info);

            if (! _warnings.Contains(warningText))
                _warnings.Add(warningText);
        }
Esempio n. 7
0
        /// <summary>
        /// Given a warningcode, this returns a user-friendly message.
        /// </summary>
        /// <param name="Entry"></param>
        /// <returns></returns>
        public static string GetFriendlyWarningMessage(WarningCode Entry)
        {
            switch (Entry)
            {
            case WarningCode.RedundantStatement:
                return("Redundant statement.");

            case WarningCode.AssignToLiteral:
                return("Attempted to assign to a literal.");

            default:
                return(Entry.ToString() + ".");
            }
        }
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hashCode = 41;
         hashCode = hashCode * 59 + WarningCode.GetHashCode();
         hashCode = hashCode * 59 + PageNumber.GetHashCode();
         hashCode = hashCode * 59 + PageImageNumber.GetHashCode();
         if (ExtWarningMessage != null)
         {
             hashCode = hashCode * 59 + ExtWarningMessage.GetHashCode();
         }
         return(hashCode);
     }
 }
        public void AddWarning(WarningCode warningCode, string info)
        {
            // TODO: make number of maximum warnings configureable
            if (_warnings.Count >= MaximumWarningCount)
            {
                throw new CodeGeneratorException(ErrorCode.TooManyWarnings);
            }

            if (info == null || info == string.Empty)
            {
                info = "No Info";                 // should not occur
            }
            string warningText = string.Format("OBLXW{0:d4}: {1}: {2}", (int)warningCode, warningCode.ToString(), info);

            if (!_warnings.Contains(warningText))
            {
                _warnings.Add(warningText);
            }
        }
Esempio n. 10
0
 // General warnings
 // Note that the warningNumber corresponds to an HRESULT in src\inc\corerror.xml
 public static void WriteWarning(string message, WarningCode warningCode)
 {
     if (!CheckSilent((int)warningCode))
     {
         String warningFormat = "TlbImp : warning TI{1:0000} : {0}";
         Console.Error.WriteLine(warningFormat, message, (int)warningCode);
     }
 }
Esempio n. 11
0
 /// <summary>
 /// Dids the occur warning.
 /// </summary>
 /// <param name="engine">Engine.</param>
 /// <param name="warningCode">Warning code.</param>
 public override void DidOccurWarning(AgoraRtcEngineKit engine, WarningCode warningCode)
 {
     Console.WriteLine($"DidOccurWarning:  {warningCode}");
 }
Esempio n. 12
0
 public void ReportEvent(WarningCode code, string eventMsg)
 {
     m_resolver.ReportEvent(ImporterEventKind.NOTIF_CONVERTWARNING, (int)code, eventMsg);
 }
Esempio n. 13
0
 public static string Code(this WarningCode code) =>
 Warning((int)code);
 protected Diagnostic LoadWarning(Uri target, WarningCode code, params string[] args) => Warnings.LoadWarning(code, args, ProjectManager.MessageSource(target));
Esempio n. 15
0
 /// <summary>
 /// Given a warningcode, this returns a user-friendly message.
 /// </summary>
 /// <param name="Entry"></param>
 /// <returns></returns>
 public static string GetFriendlyWarningMessage(WarningCode Entry)
 {
     switch (Entry)
     {
         case WarningCode.RedundantStatement:
             return "Redundant statement.";
         case WarningCode.AssignToLiteral:
             return "Attempted to assign to a literal.";
         default:
             return Entry.ToString() + ".";
     }
 }
Esempio n. 16
0
 public ListEntry(string LineValue, string File, int LineNumber, ushort[] Output, ushort Address, WarningCode WarningCode)
     : this(LineValue, File, LineNumber, Output, Address)
 {
     this.Output = Output;
     this.WarningCode = WarningCode;
 }
Esempio n. 17
0
 public ListEntry( string LineValue, string File, int LineNumber, ushort[] Output, ushort Address, bool Listed, WarningCode WarningCode, bool lineIsExpanded )
     : this(LineValue, File, LineNumber, Address, lineIsExpanded)
 {
     this.Output = Output;
     this.Listed = Listed;
     this.WarningCode = WarningCode;
 }
Esempio n. 18
0
 public ListEntry(string LineValue, string File, int LineNumber, ushort[] Output, ushort Address, WarningCode WarningCode, bool lineIsExpanded)
     : this(LineValue, File, LineNumber, Output, Address, lineIsExpanded)
 {
     this.Output      = Output;
     this.WarningCode = WarningCode;
 }