//------------------------------------------------------------------------ // Constructors and Initializers //------------------------------------------------------------------------ public DatabaseService(FormErrorHandler error, FormInfoHandler info) { connection = new OleDbConnection(); connectionStringService = new ConnectionStringService(); connection.ConnectionString = connectionStringService.buildConnectionString(); connection.Open(); OnFormError += error; OnFormInfo += info; }
public void removeSubscription() { FormErrorHandler handlerError = OnFormError; if (handlerError != null) { foreach (Delegate d in handlerError.GetInvocationList()) { handlerError -= (FormErrorHandler)d; } } FormInfoHandler handlerInfo = OnFormInfo; if (handlerInfo != null) { foreach (Delegate d in handlerInfo.GetInvocationList()) { handlerInfo -= (FormInfoHandler)d; } } }