+
+ internal static bool IsDirective (string value, char directiveChar)
+ {
+ if (value == null || value == String.Empty)
+ return false;
+
+ value = value.Trim ();
+ if (!StrUtils.StartsWith (value, "<%") || !StrUtils.EndsWith (value, "%>"))
+ return false;
+
+ int dcIndex = value.IndexOf (directiveChar, 2);
+ if (dcIndex == -1)
+ return false;
+
+ if (dcIndex == 2)
+ return true;
+ dcIndex--;
+
+ while (dcIndex >= 2) {
+ if (!Char.IsWhiteSpace (value [dcIndex]))
+ return false;
+ dcIndex--;
+ }
+
+ return true;
+ }
+
+ internal static bool IsDataBound (string value)
+ {
+ return IsDirective (value, '#');
+ }
+
+ internal static bool IsExpression (string value)
+ {
+ return IsDirective (value, '$');
+ }