Esempio n. 1
0
 public static void IfNotPresent <T>(T part)
 {
     if (part is null)
     {
         Type coreType = PrivateErrorHelpers.TrimGenericWrapper(typeof(T), typeof(Lazy <>));
         Fail(Strings.ServiceMissing, coreType.FullName);
     }
 }
Esempio n. 2
0
 public static void Present <T>([NotNull] T component)
 {
     if (component == null)
     {
         Type coreType = PrivateErrorHelpers.TrimGenericWrapper(typeof(T), typeof(Lazy <>));
         Fail(string.Format(CultureInfo.CurrentCulture, Strings.ServiceMissing, coreType.FullName));
     }
 }
Esempio n. 3
0
        public static void IfNotPresent <T>(T part)
        {
            if (part == null)
            {
                Type coreType = PrivateErrorHelpers.TrimGenericWrapper(typeof(T), typeof(Lazy <>));
#if DESKTOP // TODO: we should remove this entire CPS-specific behavior.
                if (Environment.GetEnvironmentVariable("CPSUnitTest") != "true")
                {
                    Fail(Strings.ServiceMissing, coreType.FullName);
                }
#endif
            }
        }