private static string GetIconPath(IContextualResourceModel resource)
{
string iconPath = resource.IconPath;
if (string.IsNullOrEmpty(resource.UnitTestTargetWorkflowService))
{
if (string.IsNullOrEmpty(resource.IconPath))
{
iconPath = ResourceType.WorkflowService.GetIconLocation();
}
else if (!resource.IconPath.Contains(StringResources.Pack_Uri_Application_Image))
{
var imageUriConverter = new ContextualResourceModelToImageConverter();
var iconUri = imageUriConverter.Convert(resource, null, null, null) as Uri;
if (iconUri != null) iconPath = iconUri.ToString();
}
}
else
{
iconPath = string.IsNullOrEmpty(resource.IconPath)
? StringResources.Navigation_UnitTest_Icon_Pack_Uri
: resource.IconPath;
}
return iconPath;
}