コード例 #1
0
        public static string SafeProperty(this DynamicNode node, string propertyName)
        {
            string returnValue = "";

            if (node.HasProperty(propertyName))
            {
                returnValue = node.GetProperty(propertyName).Value as string;
            }

            return(returnValue);
        }
コード例 #2
0
        public static bool IfSafeProperty(this DynamicNode node, string propertyName, out string result)
        {
            string returnValue = "";

            if (node.HasProperty(propertyName))
            {
                returnValue = node.GetProperty(propertyName).Value as string;
            }

            result = returnValue;
            return(!string.IsNullOrEmpty(returnValue));
        }
コード例 #3
0
        public static bool IfSafePropertyMatch(this DynamicNode node, string propertyName, string match)
        {
            bool   returnValue   = false;
            string propertyValue = "";

            if (node.HasProperty(propertyName))
            {
                propertyValue = node.GetProperty(propertyName).Value as string;
                returnValue   = (propertyValue == match);
            }

            return(returnValue);
        }