public string GetTemplateCode(object obj, string templatePropertyName) { var core = obj as InputCore; var type = core.Type; return(AssemblyResource.LoadText(string.Format("CodeArt.Web.XamlControls.Metronic.Input.InputCore.{0}Template.html,CodeArt.Web.XamlControls.Metronic", type.FirstToUpper()))); }
public string GetXaml() { if (this.Url.StartsWith("/")) { //相对路径 var path = this.Url.Substring(1); var fileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, path.Replace("/", "\\")); return(File.ReadAllText(fileName)); } else if (this.Url.IndexOf("\\") > -1) { //文件路径 return(File.ReadAllText(this.Url)); } else { //程序集资源 return(AssemblyResource.LoadText(this.Url)); } }