/// <summary> /// Retrieves the descendant children of specified object. /// </summary> /// <param name="service"></param> /// <param name="o"></param> /// <returns></returns> public static IEnumerable <T> GetDescendants <T>(this IHierarchyService <T> service, T o) { ThrowIfInvalidArgs(service, o); var stack = new Stack <T>(service.GetChildren(o).Reverse()); return(GetDescendantsAndSelf(service, stack)); }
public LoginController(IUserService userService, IEmailMailService emailMailService, IMenuService menuService, IHierarchyService hierarchyService) { _userService = userService; _emailMailService = emailMailService; _menuService = menuService; _hierarchyService = hierarchyService; }
public UserController(IUserService userService, IProfileService ProfileService, IHierarchyService hierarchyService, IEmailMailService emailMailService, Pagination pagination) { _userService = userService; _ProfileService = ProfileService; _hierarchyService = hierarchyService; _emailMailService = emailMailService; _pagination = pagination; }
/// <summary> /// Returns a collection of objects that contain the specified object and all descendant objects. /// </summary> /// <param name="service"></param> /// <param name="o"></param> /// <returns></returns> public static IEnumerable <T> GetDescendantsAndSelf <T>(this IHierarchyService <T> service, T o) { ThrowIfInvalidArgs(service, o); var stack = new Stack <T>(); stack.Push(o); return(GetDescendantsAndSelf(service, stack)); }
private static void ThrowIfInvalidArgs <T>(IHierarchyService <T> service, T o) { if (service == null) { throw new ArgumentNullException(nameof(service)); } if (o == null) { throw new ArgumentNullException(nameof(o)); } }
/// <summary> /// Returns a collection of the siblings after specified object. /// </summary> /// <param name="service"></param> /// <param name="o"></param> /// <returns></returns> public static IEnumerable <T> GetObjectsAfterSelf <T>(this IHierarchyService <T> service, T o) where T : class { ThrowIfInvalidArgs(service, o); var parent = service.GetParent(o); if (parent != null) { return(service.GetChildren(parent).SkipWhile(c => c != o).Skip(1)); } return(Enumerable.Empty <T>()); }
public ScenarioController(IHierarchyService hierarchyService, IScenarioWebService scenarioWebService, IRecommendationProductService recommendationProductService, IFileUploadService fileUploadService, IOrganisationDataProvider organisationDataProvider) { _hierarchyService = hierarchyService; _scenarioWebService = scenarioWebService; _recommendationProductService = recommendationProductService; _fileUploadService = fileUploadService; _organisationDataProvider = organisationDataProvider; }
private static IEnumerable <T> GetDescendantsAndSelf <T>(this IHierarchyService <T> service, Stack <T> stack) { while (stack.Count > 0) { var o = stack.Pop(); yield return(o); foreach (var child in service.GetChildren(o).Reverse()) { stack.Push(child); } } }
/// <summary> /// Returns a collection of ancestors of specified object. /// </summary> /// <param name="service"></param> /// <param name="o"></param> /// <returns></returns> public static IEnumerable <T> GetAncestors <T>(this IHierarchyService <T> service, T o) { ThrowIfInvalidArgs(service, o); while (true) { o = service.GetParent(o); if (o != null) { yield return(o); } else { break; } } }
public HoursWorkedController(ILDAPService ldapService, IHierarchyService hierarchyService) { _hierarchyService = hierarchyService; _ldapService = ldapService; }
public HoursWorkedController(ILDAPService ldapService, IHierarchyService hierarchyService) { _hierarchyService = hierarchyService; _ldapService = ldapService; }
public HierarchyController(ILogger <HierarchyController> logger, IHierarchyService hierarchyService, IDbLoggerService dbLoggerService) { _logger = logger; _hierarchyService = hierarchyService; _dbLoggerService = dbLoggerService; }
/// <summary> /// Determines whether the object has grandchildren. /// </summary> /// <param name="service"></param> /// <param name="o"></param> /// <returns></returns> public static bool HasGrandchildren <T>(this IHierarchyService <T> service, T o) { ThrowIfInvalidArgs(service, o); return(service.GetChildren(o).Any(c => !service.IsLeaf(c))); }
/// <summary> /// Determines whether the object is a leaf object, meaning it has no children. /// </summary> /// <param name="service"></param> /// <param name="o"></param> /// <returns></returns> public static bool IsLeaf <T>(this IHierarchyService <T> service, T o) { ThrowIfInvalidArgs(service, o); return(!service.GetChildren(o).Any()); }
public SafetyIncidentController(ILDAPService ldapService, IEmailService emailService, IHierarchyService hierarchyService) { _ldapService = ldapService; _emailService = emailService; _hierarchyService = hierarchyService; }
public SafetyIncidentController(ILDAPService ldapService, IEmailService emailService, IHierarchyService hierarchyService) { _ldapService = ldapService; _emailService = emailService; _hierarchyService = hierarchyService; }
public HomeController(IHierarchyService hierarchyService, ILogger <HomeController> logger) { this.hierarchyService = hierarchyService; this.logger = logger; }
public HierarchyController(IHierarchyService hierarchyService) { _hierarchyService = hierarchyService; }
public VideoController(ISecurityService securityService, IHierarchyService hierarchyService) { _securityService = securityService; _hierarchyService = hierarchyService; }
public VideoController(ISecurityService securityService, IHierarchyService hierarchyService) { _securityService = securityService; _hierarchyService = hierarchyService; }
/// <summary> /// Determines whether specified object is the root object. /// </summary> /// <param name="service"></param> /// <param name="o"></param> /// <returns></returns> public static bool IsRoot <T>(this IHierarchyService <T> service, T o) { ThrowIfInvalidArgs(service, o); return(service.GetParent(o) == null); }
public HomeController(IHierarchyService hierarchyService, IErrorLogService errorLogService) { this.hierarchyService = hierarchyService; this.errorLogService = errorLogService; }
public HierarchyController(IHierarchyService hierarchyService, IDictionaryAllService dictionaryAllService) { _hierarchyService = hierarchyService; _dictionaryAllService = dictionaryAllService; }