Exemple #1
0
        /// <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);
        }
Exemple #2
0
        /// <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);
            }
        }
Exemple #3
0
 /// <summary>
 /// Exception Occured while reading file
 /// </summary>
 /// <param name="Ex">Exception to add to list</param>
 protected void ExceptionOccured(ID3Exception Ex)
 {
     _Exception = Ex;
 }