View on GitHub

SARAFF SOFTWARE

All products / Saraff.Twain.DS / Contents

Extensions points

You can expand processing behavior. In this case you must inherit follow interfaces (one or more) and bind your derivative type (see Common services)

ILog

The ILog used to handle errors.

namespace Saraff.Twain.DS.Extensions {

    public interface ILog {

        void Write(Exception ex);

        void Write(string message, LogLevel level = LogLevel.None);
    }

    public enum LogLevel { 
        None,
        Info,
        Warning,
        Error
    }
}

IListener

The IListener can be used for logging, check security permissions, unit-testing with a mock-objects, etc. Available for a components that uses the ProxyRequiredAttribute. For more info see Listener of invocations

namespace Saraff.Twain.DS.IoC {

    public interface IListener {

        object OnInvoking(MethodBase method, object instance, object[] parameters);

        object OnInvoked(MethodBase method, object instance, object result);

        Exception OnCatch(MethodBase method, object instance, Exception ex);
    }
}