public XenMasterEventArgs(string message, MasterEventType type, Serverity severity)
 {
     Message       = message;
     Type          = type;
     Severity      = severity;
     CanonicalType = _Type.ToString().Replace("_", " ");
 }
Esempio n. 2
0
 private void Log(Serverity serverity, string message, Exception exception = null)
 {
     if (logger == null)
     {
         return;
     }
     try
     {
         logger.Invoke(serverity, message, exception);
     }
     catch
     {
     }
 }
        /// <summary>
        /// Sets the specified hresult.
        /// </summary>
        /// <param name="hresult">The hresult.</param>
        public void Set(int hresult)
        {
            _hresult = (uint)hresult;

            _serverityCode = (int)(_hresult >> 30);
            _serverity     = (Serverity)_serverityCode;

            _facilityCode = (int)(_hresult >> 16);
            _facilityCode = _facilityCode & 0x0FFF;

            if (Enum.IsDefined(typeof(Facility), _facilityCode))
            {
                _facility = (Facility)_facilityCode;
            }
            else
            {
                _facility = Facility.Unknown;
            }

            _code = (int)_hresult & 0x0000FFFF;
        }
Esempio n. 4
0
        public override int GetHashCode()
        {
            int hashCode = StartLine ^ EndLine;

            if (Serverity != null)
            {
                hashCode ^= Serverity.GetHashCode();
            }
            if (Message != null)
            {
                hashCode ^= Message.GetHashCode();
            }
            if (FilePath != null)
            {
                hashCode ^= FilePath.GetHashCode();
            }
            if (Span != null)
            {
                hashCode ^= Span.GetHashCode();
            }

            return(hashCode);
        }
Esempio n. 5
0
    /// <summary>
    /// Sets the specified hresult.
    /// </summary>
    /// <param name="hresult">The hresult.</param>
    public void Set(int hresult)
    {
      _hresult = (uint)hresult;

      _serverityCode = (int)(_hresult >> 30);
      _serverity = (Serverity)_serverityCode;

      _facilityCode = (int)(_hresult >> 16);
      _facilityCode = _facilityCode & 0x0FFF;

      if (Enum.IsDefined(typeof (Facility), _facilityCode))
        _facility = (Facility)_facilityCode;
      else
        _facility = Facility.Unknown;

      _code = (int)_hresult & 0x0000FFFF;
    }
Esempio n. 6
0
 public CompileMessage(Serverity serverity, string message, string datails)
 {
     MServerity = serverity;
     RawMessage = message;
     Detail     = datails;
 }
Esempio n. 7
0
 public CompileMessage(Serverity serverity, string message)
 {
     MServerity = serverity;
     RawMessage = message;
     Detail     = "";
 }