/// <summary> /// Gets the image property. /// </summary> /// <returns></returns> internal static string GetOriginalUrl(int nodeId, ImageResizerPrevalueEditor imagePrevalueEditor) { Property imageProperty; var node = new CMSNode(nodeId); if (node.nodeObjectType == Document._objectType) { imageProperty = new Document(nodeId).getProperty(imagePrevalueEditor.PropertyAlias); } else if (node.nodeObjectType == Media._objectType) { imageProperty = new Media(nodeId).getProperty(imagePrevalueEditor.PropertyAlias); } else { if (node.nodeObjectType != Member._objectType) { throw new Exception("Unsupported Umbraco Node type for Image Resizer (only Document, Media and Members are supported."); } imageProperty = new Member(nodeId).getProperty(imagePrevalueEditor.PropertyAlias); } try { return(imageProperty.Value.ToString()); } catch { return(string.Empty); } }
/// <summary> /// Gets the image property. /// </summary> /// <returns></returns> internal static string GetOriginalUrl(int nodeId, ImageResizerPrevalueEditor imagePrevalueEditor) { Property imageProperty; var node = new CMSNode(nodeId); if (node.nodeObjectType == Document._objectType) { imageProperty = new Document(nodeId).getProperty(imagePrevalueEditor.PropertyAlias); } else if (node.nodeObjectType == Media._objectType) { imageProperty = new Media(nodeId).getProperty(imagePrevalueEditor.PropertyAlias); } else { if (node.nodeObjectType != Member._objectType) { throw new Exception("Unsupported Umbraco Node type for Image Resizer (only Document, Media and Members are supported."); } imageProperty = new Member(nodeId).getProperty(imagePrevalueEditor.PropertyAlias); } try { return imageProperty.Value.ToString(); } catch { return string.Empty; } }