private object findDefinition(JsString qualifiedClassName) { dynamic nextLevel = HtmlContext.window; var failed = false; JsString realName = ""; if (qualifiedClassName.substr(0, 14) == "SharpKit.Html.") { realName = qualifiedClassName.substr(14); } else { realName = qualifiedClassName; } var path = realName.split('.'); for (var i = 0; i < path.length; i++) { nextLevel = nextLevel[path[i]]; if (nextLevel == JsContext.undefined) { failed = true; break; } } if (failed) { return(null); } return(nextLevel); }
private JsString returnFieldName( JsString token ) { return token.substr( 1, token.length - 2 ); }
public string GetPrefix(JsString prop) { JsString prefix = ""; int idx = prop.indexOf("."); if (-1 != idx) { prefix = prop.substr(0, idx + 1); } return prefix; }
public string getQueryParam(JsString jsString, string p) { string res = ""; int idx = jsString.indexOf("?"); if (idx > 0) { JsString tmp = jsString.substr(idx + 1); JsArray<JsString> args = tmp.split("&"); if (args.length == 0) { args.Add(tmp); } foreach (JsString arg in args) { JsArray<JsString> keyVal = arg.split("="); if (keyVal.length == 2) { if (keyVal[0] == p) { res = keyVal[1]; break; } } } } return res; }
public string getPrefix(JsString tmp) { int idx = tmp.indexOf("."); string prefix = tmp.substr(0, idx + 1); return prefix; }
private JsString returnFieldName(JsString token) { return(token.substr(1, token.length - 2)); }
private object findDefinition(JsString qualifiedClassName) { dynamic nextLevel = HtmlContext.window; var failed = false; JsString realName = ""; if ( qualifiedClassName.substr(0,14) == "SharpKit.Html.") { realName = qualifiedClassName.substr(14); } else { realName = qualifiedClassName; } var path = realName.split('.'); for (var i = 0; i < path.length; i++) { nextLevel = nextLevel[path[i]]; if (nextLevel == JsContext.undefined) { failed = true; break; } } if (failed) { return null; } return nextLevel; }