GPPointFileInfo\GPMessages.cs
Creating a non-trival custom GP tool - inputs, outputs, and responding to environment settings
GPPointFileInfo\GPMessages.cs
// Copyright 2008 ESRI
// 
// All rights reserved under the copyright laws of the United States
// and applicable international laws, treaties, and conventions.
// 
// You may freely redistribute and use this sample code, with or
// without modification, provided you include the original copyright
// notice and use restrictions.
// 
// See use restrictions at <your ArcGIS install location>/developerkit/userestrictions.txt.
// 

namespace GPPointFileInfo
{
    public class GPMessages : GPPointFileInfo.IGPMessages
    {
        private ESRI.ArcGIS.Geodatabase.IGPMessages _gpMessages;

        public GPMessages(ESRI.ArcGIS.Geodatabase.IGPMessages gpMessages)
        {
            _gpMessages = gpMessages;
        }

        public void AddInfo(string message)
        {
            _gpMessages.AddMessage(message);
        }

        public void AddWarn(string message)
        {
            _gpMessages.AddWarning(message);
        }

        public void AddError(string message)
        {
            const int DefaultCode = 1;

            _gpMessages.AddError(DefaultCode, message);
        }

        public void AddFatal(string message)
        {
            _gpMessages.AddAbort(message);
        }
    }
}