當前位置: 首頁>>代碼示例>>C#>>正文


C# FrameworkElement.GetProvider方法代碼示例

本文整理匯總了C#中Windows.UI.Xaml.FrameworkElement.GetProvider方法的典型用法代碼示例。如果您正苦於以下問題:C# FrameworkElement.GetProvider方法的具體用法?C# FrameworkElement.GetProvider怎麽用?C# FrameworkElement.GetProvider使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Windows.UI.Xaml.FrameworkElement的用法示例。


在下文中一共展示了FrameworkElement.GetProvider方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: AutomationInvokeAction

        private static object AutomationInvokeAction(FrameworkElement element)
        {
            var invokeProvider = element.GetProvider<IInvokeProvider>(PatternInterface.Invoke);
            invokeProvider.Invoke();

            return null;
        }
開發者ID:krishachetan89,項目名稱:Winium.StoreApps,代碼行數:7,代碼來源:ExecuteCommand.cs

示例2: AutomationScrollAction

        private static object AutomationScrollAction(FrameworkElement element, IDictionary<string, JToken> parameters)
        {
            var scrollProvider = element.GetProvider<IScrollProvider>(PatternInterface.Scroll);

            var scrollInfo = parameters["args"].ElementAtOrDefault(1);
            if (scrollInfo == null)
            {
                var msg = string.Format(HelpArgumentsErrorMsg, HelpUrlAutomationScript);
                throw new AutomationException(msg, ResponseStatus.JavaScriptError);
            }

            var horizontalAmount = ParseScrollAmount(scrollInfo["horizontal"] ?? scrollInfo["h"]);
            var verticalAmount = ParseScrollAmount(scrollInfo["vertical"] ?? scrollInfo["v"]);
            var count = (scrollInfo["count"] ?? 1).Value<int>();

            if (horizontalAmount != ScrollAmount.NoAmount && !scrollProvider.HorizontallyScrollable)
            {
                throw new AutomationException("Element is not horizontally scrollable.", ResponseStatus.JavaScriptError);
            }

            if (verticalAmount != ScrollAmount.NoAmount && !scrollProvider.VerticallyScrollable)
            {
                throw new AutomationException("Element is not vertically scrollable.", ResponseStatus.JavaScriptError);
            }

            for (var i = 0; i < count; ++i)
            {
                scrollProvider.Scroll(horizontalAmount, verticalAmount);
            }

            return null;
        }
開發者ID:krishachetan89,項目名稱:Winium.StoreApps,代碼行數:32,代碼來源:ExecuteCommand.cs

示例3: TogglePatternToggleState

 private static string TogglePatternToggleState(FrameworkElement element)
 {
     var provider = element.GetProvider<IToggleProvider>(PatternInterface.Toggle);
     return provider.ToggleState.ToString();
 }
開發者ID:krishachetan89,項目名稱:Winium.StoreApps,代碼行數:5,代碼來源:ExecuteCommand.cs

示例4: TogglePatternToggle

        private static object TogglePatternToggle(FrameworkElement element)
        {
            var provider = element.GetProvider<IToggleProvider>(PatternInterface.Toggle);
            provider.Toggle();

            return null;
        }
開發者ID:krishachetan89,項目名稱:Winium.StoreApps,代碼行數:7,代碼來源:ExecuteCommand.cs


注:本文中的Windows.UI.Xaml.FrameworkElement.GetProvider方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。