コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: ActionsCommandBar.cs プロジェクト: ridomin/waslibs
        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;
        }