Warning() public static méthode

Invokes the library-wide warning handling methods to (normally) write a warning message to the Console.Error.

The format is a composite format string that uses the same format as O:System.String.Format method. The method parameter, if not null, is printed before the message; it typically is used to identify the method in which a warning is detected.

Applications that desire to capture control in the event of a warning should use SetErrorHandler to override the default error and warning handler.

public static Warning ( Tiff tif, string method, string format ) : void
tif Tiff An instance of the class. Can be null.
method string The method in which a warning is detected.
format string A composite format string (see Remarks).
Résultat void
Exemple #1
0
        private bool writeOK(byte[] buffer, int offset, int count)
        {
            try
            {
                m_stream.Write(m_clientdata, buffer, offset, count);
            }
            catch (Exception)
            {
                Tiff.Warning(this, "writeOK", "Failed to write {0} bytes", count);
                return(false);
            }

            return(true);
        }
Exemple #2
0
        private bool writeOK(byte[] buffer, int offset, int count)
        {
            try
            {
                m_stream.Write(m_clientdata, buffer, offset, count);
            }
#pragma warning disable CA1031 // Do not catch general exception types
            catch (Exception)
#pragma warning restore CA1031 // Do not catch general exception types
            {
                Tiff.Warning(this, "writeOK", "Failed to write {0} bytes", count);
                return(false);
            }

            return(true);
        }