Esempio n. 1
0
 /// <summary>
 /// Invoke this method during runtime to ensure that only one of the two given are setup to run and that only one is available.
 /// </summary>
 /// <param name="caller">The method in runtime validation</param>
 /// <param name="resource"></param>
 /// <param name="error">A description of the error if one occurs</param>
 /// <param name="dataSource"></param>
 /// <returns>True if there is no issue, false if both are either filler out or none are.</returns>
 public static bool EnsureExactlyOneAndOfSameType <T>(this IModule caller, IDataSource <T> dataSource, IResource resource, ref string error)
 {
     return(caller.EnsureExactlyOne(dataSource, resource, ref error) || !caller.EnsureTypesMatch(dataSource, resource, ref error));
 }