public static string Compliance(this DynamicNode node)
        {
            // news article content may inherit non-empty compliance settings from their parent news article
            // but only if their own compliance is blank. this allows compliance to be only set once when it's needed
            // but also allows links to be open and content to prompt self-certification

            string inheritedCompliance = "";

            if (node != null && node.Parent != null && node.Parent.NodeTypeAlias != null)
            {
                if (node.Parent.NodeTypeAlias.ToLower() == "newsarticle")
                {
                    inheritedCompliance = node.Parent.SafeProperty("compliance");
                }
            }

            var nodeCompliance = node.SafeProperty("compliance");

            if (string.IsNullOrEmpty(nodeCompliance))
            {
                return(inheritedCompliance);
            }
            else
            {
                return(nodeCompliance);
            }
        }
示例#2
0
 public static bool NodeHasCompliance(DynamicNode targetNode, out string complianceString)
 {
     complianceString = targetNode.SafeProperty("compliance");
     return(!string.IsNullOrEmpty(complianceString));
 }
 public static bool IsPropertyPopulated(this DynamicNode node, string propertyName, out string value)
 {
     value = node.SafeProperty(propertyName);
     return(!string.IsNullOrEmpty(value));
 }