//****************************************************************************************************** // ISupportLifecycle.cs - Gbtc // // Copyright © 2010, Grid Protection Alliance. All Rights Reserved. // // Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See // the NOTICE file distributed with this work for additional information regarding copyright ownership. // The GPA licenses this file to you under the Eclipse Public License -v 1.0 (the "License"); you may // not use this file except in compliance with the License. You may obtain a copy of the License at: // // http://www.opensource.org/licenses/eclipse-1.0.php // // Unless agreed to in writing, the subject software distributed under the License is distributed on an // "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the // License for the specific language governing permissions and limitations. // // Code Modification History: // ---------------------------------------------------------------------------------------------------- // 10/09/2008 - Pinal C. Patel // Generated original version of source code. // 09/14/2009 - Stephen C. Wills // Added new header and license agreement. // 11/23/2011 - J. Ritchie Carroll // Added required Disposed event for interface to allow deep automated life cycle management. // 10/8/2012 - Danyelle Gilliam // Modified Header // //****************************************************************************************************** #region [ Contributor License Agreements ] //****************************************************************************************************** // // Copyright © 2011, Grid Protection Alliance. All Rights Reserved. // // The GPA licenses this file to you under the Eclipse Public License -v 1.0 (the "License"); you may // not use this file except in compliance with the License. You may obtain a copy of the License at: // // http://www.opensource.org/licenses/eclipse-1.0.php // // Unless agreed to in writing, the subject software distributed under the License is distributed on an // "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the // License for the specific language governing permissions and limitations. // //****************************************************************************************************** #endregion using System; namespace GSF { /// /// Specifies that this object provides support for performing tasks during the key stages of object lifecycle. This interface /// also allows objects to declare themselves as reusable such that their lifecycle can be automatically managed when pooled via /// the . /// /// /// /// /// Lifecycle Stage /// Equivalent Member /// /// /// Birth /// /// /// /// Life (Work/Sleep) /// /// /// /// Death /// /// /// /// public interface ISupportLifecycle : IDisposable { /// /// Raised after the source object has been properly disposed. /// /// /// Proper implementation of this event will allow objects to be automatically returned to the /// ,in this mode sender event parameter should always be this. /// event EventHandler Disposed; /// /// Initializes the state of the object. /// /// /// /// Typical implementation of should allow the object state to be initialized only /// once. should be called automatically from one or more key entry points of the /// object. For example, if the object is a and it implements /// the interface then should /// be called from the method so that the object /// gets initialized automatically when consumed through the IDE designer surface. In addition to this /// should also be called from key or mandatory methods of the object, like 'Start()' /// or 'Connect()', so that the object gets initialized even when not consumed through the IDE designer surface. /// /// /// Proper implementation of this method will allow objects to be automatically reinitialized when taken from /// the . /// /// void Initialize(); /// /// Gets or sets a boolean value that indicates whether the object is enabled. /// /// /// Typical implementation of should suspend the internal processing when the object is /// disabled and resume processing when the object is enabled. /// bool Enabled { get; set; } } }