/// <summary> /// Indicate is specific FrameID valid or not /// </summary> /// <param name="FrameIdentifier">FrameID to check</param> /// <param name="ErrorType">Error type that must occur if frame identifier was not valid</param> /// <returns>true if frame identifer was valid otherwise false</returns> protected bool ValidatingFrameID(string FrameIdentifier, ExceptionLevels ErrorType) { bool IsValid = FramesInfo.IsValidFrameID(FrameIdentifier); if (!IsValid) { ID3Exception Ex = new ID3Exception(FrameIdentifier + " is not valid FrameID", FrameIdentifier, ErrorType); if (ErrorType == ExceptionLevels.Error) { throw Ex; } else if (ErrorType == ExceptionLevels.Error) { ExceptionOccured(Ex); } } return(IsValid); }
/// <summary> /// Indicate is value of Enumeration valid for that enum /// </summary> /// <param name="Enumeration">Enumeration to control value for</param> /// <param name="ErrorType">if not valid how error occur</param> /// <param name="FrameID">FrameID just for using in Exception message</param> /// <returns>true if valid otherwise false</returns> protected bool IsValidEnumValue(Enum Enumeration, ExceptionLevels ErrorType, string FrameID) { if (IsValidEnumValue(Enumeration)) { return(true); } else { ID3Exception FEx = new ID3Exception(Enumeration.ToString() + " is out of range of " + Enumeration.GetType().ToString(), FrameID, ErrorType); if (ErrorType != ExceptionLevels.Error) { ExceptionOccured(FEx); } //else //throw FEx; return(false); } }
/// <summary> /// Create new ASFException /// </summary> /// <param name="message">message of exception</param> /// <param name="GUID">GUID</param> /// <param name="Level">Level of exception</param> public ASFException(string message, string GUID, ExceptionLevels Level) : base(message) { _GUID = GUID; _Level = Level; }
/// <summary> /// Create ne tag exception /// </summary> /// <param name="message">Message of exception</param> /// <param name="ExceptionLevel">Exception level</param> public ID3Exception(string message, ExceptionLevels ExceptionLevel) : this(message, "", ExceptionLevel) { }
/// <summary> /// Create new TagException /// </summary> /// <param name="message">message of exception</param> /// <param name="FrameID">FrameID that exception occured in</param> /// <param name="ExceptionLevel">Exception Level for current exception</param> public ID3Exception(string message, string FrameID, ExceptionLevels ExceptionLevel) : base(message) { _FrameID = FrameID; _Level = ExceptionLevel; }