CurrentMethod() public static method

Returns the name of the caller method.
public static CurrentMethod ( int skipFrames, bool includeDeclaringType = true ) : string
skipFrames int The number of frames to skip. This function itsself is omitted by default.
includeDeclaringType bool If true, the methods declaring type is included in the returned name.
return string
Ejemplo n.º 1
0
        /// <summary>
        /// Checks for errors that might have occurred during audio processing.
        /// </summary>
        /// <param name="silent">If true, errors aren't logged.</param>
        /// <returns>True, if an error occurred, false if not.</returns>
        public static bool CheckOpenALErrors(bool silent = false)
        {
            if (sound != null && !sound.IsAvailable)
            {
                return(false);
            }
            ALError error;
            bool    found = false;

            while ((error = AL.GetError()) != ALError.NoError)
            {
                if (!silent)
                {
                    Log.Core.WriteError(
                        "Internal OpenAL error, code {0} at {1}",
                        error,
                        Log.CurrentMethod(1));
                }
                found = true;
            }
            if (found && !silent && System.Diagnostics.Debugger.IsAttached)
            {
                System.Diagnostics.Debugger.Break();
            }
            return(found);
        }
Ejemplo n.º 2
0
 public static bool GuardSingleThreadState(bool silent = false)
 {
     if (Thread.CurrentThread != mainThread)
     {
         if (!silent)
         {
             Log.Core.WriteError(
                 "Method {0} isn't allowed to be called from a Thread that is not the main Thread.",
                 Log.CurrentMethod(1));
         }
         return(false);
     }
     return(true);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Checks for errors that might have occurred during video processing. You should avoid calling this method due to performance reasons.
        /// Only use it on suspect.
        /// </summary>
        /// <param name="silent">If true, errors aren't logged.</param>
        /// <returns>True, if an error occurred, false if not.</returns>
        public static bool CheckOpenGLErrors(bool silent = false)
        {
            ErrorCode error;
            bool      found = false;

            while ((error = GL.GetError()) != ErrorCode.NoError)
            {
                if (!silent)
                {
                    Log.Core.WriteError(
                        "Internal OpenGL error, code {0} at {1}",
                        error,
                        Log.CurrentMethod(1));
                }
                found = true;
            }
            if (found && !silent && System.Diagnostics.Debugger.IsAttached)
            {
                System.Diagnostics.Debugger.Break();
            }
            return(found);
        }