示例#1
0
 /// <summary>
 /// Get widget template content
 /// </summary>
 /// <param name="widgetSetup"></param>
 /// <returns></returns>
 public static string GetTemplateContent(WidgetSetupModel widgetSetup)
 {
     return
         (EmbeddedResourceHelper.GetString(
              string.Format("{0}.{1}.{2}.cshtml", DataSetupResourceType.WidgetTemplate.GetEnumName(),
                            widgetSetup.Widget, widgetSetup.DefaultTemplate), ResourceNamespace));
 }
 /// <summary>
 /// Get module resource content
 /// </summary>
 /// <param name="resourceName"></param>
 /// <param name="moduleResourceNameSpace"></param>
 /// <param name="type"></param>
 /// <returns></returns>
 public static string GetModuleResourceContent(string resourceName, string moduleResourceNameSpace, ResourceType type = ResourceType.None)
 {
     if (type == ResourceType.None)
     {
         return(EmbeddedResourceHelper.GetString(resourceName, ResourceNamespace));
     }
     return(EmbeddedResourceHelper.GetString(string.Format("{0}.{1}", type.GetEnumName(), resourceName), moduleResourceNameSpace));
 }
示例#3
0
 /// <summary>
 /// Get plugin resource content
 /// </summary>
 /// <param name="resourceName"></param>
 /// <param name="pluginResourceNameSpace"></param>
 /// <param name="type"></param>
 /// <returns></returns>
 public static string GetPluginResourceContent(string resourceName, string pluginResourceNameSpace, DataSetupResourceType type = DataSetupResourceType.None)
 {
     if (type == DataSetupResourceType.None)
     {
         return(EmbeddedResourceHelper.GetString(resourceName, ResourceNamespace));
     }
     return(EmbeddedResourceHelper.GetString(string.Format("{0}.{1}", type.GetEnumName(), resourceName), pluginResourceNameSpace));
 }
示例#4
0
        /// <summary>
        /// Get git version of EzCMS
        /// </summary>
        /// <returns></returns>
        public static string GetEzCMSVersion()
        {
            var version = StateManager.GetApplication <string>(EzCMSContants.EzCMSVersion);

            if (string.IsNullOrEmpty(version))
            {
                version = EmbeddedResourceHelper.GetString("version.txt", "EzCMS.Web.App_Data");
                if (HttpContext.Current != null)
                {
                    StateManager.SetApplication(EzCMSContants.EzCMSVersion, version);
                }
            }
            return(version);
        }
示例#5
0
        public static string GetEzCMSResource(string name, string template, ResourceTypeEnums resourceType)
        {
            var @namespace = string.Format("{0}.{1}.Resources.{2}", Namespace, template, resourceType.GetEnumName());

            return(EmbeddedResourceHelper.GetString(name, @namespace));
        }
示例#6
0
 /// <summary>
 /// Get starter
 /// </summary>
 /// <param name="name"></param>
 /// <param name="namespace"></param>
 /// <returns></returns>
 public static string GetResource(string name, string @namespace)
 {
     return(EmbeddedResourceHelper.GetString(name, @namespace));
 }