Created
October 22, 2013 19:40
-
-
Save josuebasurto/1d3981dbfeb519ade1b2 to your computer and use it in GitHub Desktop.
Get Resources Text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public string GetResourceText(string resourcekey) | |
{ | |
object resourceText = null; | |
if (this.ResourceFilePathExist || this.ResourceFilePathDefaultExist) | |
{ | |
resourceText = this.GetLocalResourceObject(resourcekey); | |
if (resourceText != null) | |
{ | |
return resourceText.ToString(); | |
} | |
} | |
if (!IsRootDirectory) | |
{ | |
if (this.ResourceFolderPathExist || this.ResourceFolderPathDefaultExist) | |
{ | |
resourceText = HttpContext.GetLocalResourceObject(this.ResourceFolderVirtualPath, resourcekey); | |
if (resourceText != null) | |
{ | |
return resourceText.ToString(); | |
} | |
} | |
} | |
//Ya estamos en la raiz o no se encontro en ninguno de los casos anteriores el resourcekey | |
return this.GetGlobalResourceText(K_GLOBAL_RESOURCE_DEFAULT, resourcekey, true); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
GlobalResources.resx
LocalResources.resx