GPPointFileInfo\ESOverwriteOutput.cs
Creating a non-trival custom GP tool - inputs, outputs, and responding to environment settings
GPPointFileInfo\ESOverwriteOutput.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.
// 

using ESRI.ArcGIS.Geoprocessing;
using ESRI.ArcGIS.Geodatabase;

namespace GPPointFileInfo
{
    public class ESOverwriteOutput : GPPointFileInfo.IESOverwriteOutput
    {
        private bool _value;

        public ESOverwriteOutput(ESRI.ArcGIS.Geoprocessing.IGPEnvironmentManager gpEnvironmentManager)
        {
            _value = GetValue(gpEnvironmentManager);
        }

        public bool Value
        {
            get
            {
                return _value;
            }
        }

        private bool GetValue(ESRI.ArcGIS.Geoprocessing.IGPEnvironmentManager gpEnvironmentManager)
        {
            bool value;

            IGeoProcessorSettings geoProcessorSettings = gpEnvironmentManager as IGeoProcessorSettings;

            value = geoProcessorSettings.OverwriteOutput;

            return value;
        }
    }
}