private static string GetText(ActionInfo action, ActionTextProperties property) { #if UWP var resourceLoader = new ResourceLoader(); #else var resourceLoader = new ResourceManager("AppStudio.Uwp.Strings.Resources", typeof(ActionsCommandBar).GetTypeInfo().Assembly); #endif string text = null; if (!string.IsNullOrEmpty(action.Name)) { if (property == ActionTextProperties.Label) { text = resourceLoader.GetString(string.Format("{0}/Label", action.Name)); } else if (property == ActionTextProperties.AutomationPropertiesName) { text = resourceLoader.GetString(string.Format("{0}/AutomationPropertiesName", action.Name)); } } if (string.IsNullOrEmpty(text)) { if (property == ActionTextProperties.Label) { text = action.Text; } else if (property == ActionTextProperties.AutomationPropertiesName) { text = GetText(action, ActionTextProperties.Label); } } return(text); }
private static string GetText(ActionInfo action, ActionTextProperties property) { var resourceLoader = new ResourceLoader(); string text = null; if (!string.IsNullOrEmpty(action.Name)) { if (property == ActionTextProperties.Label) { text = resourceLoader.GetString(string.Format("{0}/Label", action.Name)); } else if (property == ActionTextProperties.AutomationPropertiesName) { text = resourceLoader.GetString(string.Format("{0}/AutomationPropertiesName", action.Name)); } } if (string.IsNullOrEmpty(text)) { if (property == ActionTextProperties.Label) { text = action.Text; } else if (property == ActionTextProperties.AutomationPropertiesName) { text = GetText(action, ActionTextProperties.Label); } } return(text); }
private static string GetText(ActionInfo action, ActionTextProperties property) { var resourceLoader = new ResourceLoader(); string text = null; if (!string.IsNullOrEmpty(action.Name)) { if (property == ActionTextProperties.Label) text = resourceLoader.GetString(string.Format("{0}/Label", action.Name)); else if (property == ActionTextProperties.AutomationPropertiesName) text = resourceLoader.GetString(string.Format("{0}/AutomationPropertiesName", action.Name)); } if (string.IsNullOrEmpty(text)) { if (property == ActionTextProperties.Label) { text = action.Text; } else if (property == ActionTextProperties.AutomationPropertiesName) { text = GetText(action, ActionTextProperties.Label); } } return text; }