Beispiel #1
0
        public ITaskBranch GetBranchForRole(BranchRoles role, EngineModes mode, bool fallbackToAll)
        {
            var roleBranches = _branches.Values.Where(e => e as RoleBranch != null).Select(e => e as RoleBranch);

            var result = roleBranches.LastOrDefault(instance =>
                instance.BranchRole == role &&
                instance.RoleMode== mode) as ITaskBranch;

            if (result == null && fallbackToAll)
                result = GetBranchForRole(role, EngineModes.All, false) ;

            if (result == null)
                Log.DebugFormat("Cannot find branch for role {0} and mode {1}", role, mode);

            return result;
        }
Beispiel #2
0
 public override void ConfigureFromNode(System.Xml.Linq.XElement node)
 {
     base.ConfigureFromNode(node);
     BranchRole = XmlUtilities.GetEnumValueFromAttribute(node, "role", BranchRoles.None);
     RoleMode = XmlUtilities.GetEnumValueFromAttribute(node, "roleMode", EngineModes.All);
 }
Beispiel #3
0
 public BranchNotFound(BranchRoles role, EngineModes mode)
 {
     Issue = string.Format("No branch defined for role {0} and mode {1}", role, mode);
 }
Beispiel #4
0
 public override void ConfigureFromNode(System.Xml.Linq.XElement node)
 {
     base.ConfigureFromNode(node);
     Value = XmlUtilities.GetEnumValueFromAttribute(node, "value", EngineModes.All);
 }