public static ServiceLocatorManagerLogArgs Resetting(ServiceLocatorManager serviceLocatorManager) { var args = new ServiceLocatorManagerLogArgs(); args.ServiceLocatorManager = serviceLocatorManager; args.LogType = ServiceManagerLogType.Resetting; return(args); }
public static ServiceLocatorManagerLogArgs Missing(ServiceLocatorManager serviceLocatorManager, Type type) { var args = new ServiceLocatorManagerLogArgs(); args.ServiceLocatorManager = serviceLocatorManager; args.LogType = ServiceManagerLogType.Missing; args.Type = type; return(args); }
public virtual void OnMissing(ServiceLocatorManagerLogArgs args) { Assert.AreEqual(args.LogType, ServiceManagerLogType.Missing); Assert.IsNotNull(args.Type); Assert.IsNull(args.RegisteredInstance); string logMsg = string.Concat("ServiceLocator - ", "Cant find Service of type: ", args.Type.Name); Debug.LogError(logMsg); }
public static ServiceLocatorManagerLogArgs Registered(ServiceLocatorManager serviceLocatorManager, Type type, object instance) { var args = new ServiceLocatorManagerLogArgs(); args.ServiceLocatorManager = serviceLocatorManager; args.LogType = ServiceManagerLogType.Registered; args.Type = type; args.RegisteredInstance = instance; return(args); }
public void Log(ServiceLocatorManagerLogArgs args) { switch (args.LogType) { case ServiceManagerLogType.Registered: OnRegistered(args); break; case ServiceManagerLogType.Missing: OnMissing(args); break; case ServiceManagerLogType.Resetting: OnReset(args); break; default: throw new ArgumentOutOfRangeException(); } }
public virtual void OnReset(ServiceLocatorManagerLogArgs args) { Assert.AreEqual(args.LogType, ServiceManagerLogType.Resetting); Assert.IsNull(args.Type); Assert.IsNull(args.RegisteredInstance); }
public virtual void OnRegistered(ServiceLocatorManagerLogArgs args) { Assert.AreEqual(args.LogType, ServiceManagerLogType.Registered); Assert.IsNotNull(args.Type); }