Exemplo n.º 1
0
        public override CompatibilityType GetCompatibilityType(PsaiMusicEntity targetEntity, out CompatibilityReason reason)
        {
            if (targetEntity is Group)
            {
                Group targetGroup = (Group)targetEntity;

                Theme sourceTheme = this.Theme;
                Theme targetTheme = targetGroup.Theme;

                if (sourceTheme.GetCompatibilityType(targetTheme, out reason) == CompatibilityType.logically_impossible)
                {
                    return(CompatibilityType.logically_impossible);
                }
                else
                {
                    if (ManuallyBlockedGroups.Contains(targetGroup))
                    {
                        reason = CompatibilityReason.manual_setting_within_same_hierarchy;
                        return(CompatibilityType.blocked_manually);
                    }
                    else if (ManuallyLinkedGroups.Contains(targetGroup))
                    {
                        reason = CompatibilityReason.manual_setting_within_same_hierarchy;
                        return(CompatibilityType.allowed_manually);
                    }
                    else
                    {
                        CompatibilityType themeCompatibility = Theme.GetCompatibilityType(targetGroup.Theme, out reason);
                        {
                            switch (themeCompatibility)
                            {
                            case CompatibilityType.blocked_manually:
                            {
                                reason = CompatibilityReason.manual_setting_of_parent_entity;
                                return(CompatibilityType.blocked_implicitly);
                            }


                            case CompatibilityType.allowed_manually:
                            {
                                reason = CompatibilityReason.manual_setting_of_parent_entity;
                                return(CompatibilityType.allowed_implicitly);
                            }

                            default:
                                reason = CompatibilityReason.inherited_from_parent_hierarchy;
                                return(themeCompatibility);
                            }
                        }
                    }
                }
            }

            reason = CompatibilityReason.not_set;
            return(CompatibilityType.undefined);
        }
Exemplo n.º 2
0
 public override CompatibilitySetting GetCompatibilitySetting(PsaiMusicEntity targetEntity)
 {
     if (targetEntity is Group)
     {
         if (ManuallyBlockedGroups.Contains((Group)targetEntity))
         {
             return(CompatibilitySetting.blocked);
         }
         else if (ManuallyLinkedGroups.Contains((Group)targetEntity))
         {
             return(CompatibilitySetting.allowed);
         }
     }
     return(CompatibilitySetting.neutral);
 }