小编Nar*_*ren的帖子

在Windows Phone 8中获取UI调度程序

我一直在开发一个消耗Windows运行时组件(WRC)的Windows Phone应用程序.由非UI线程访问的功能需要使用访问Windows Phone应用程序的回调.

void WControlPointCallback::OnListChange(char *pFriendlyName)
{
    // Callback function to access the UI
    pCallBack->AlertCaller("Message");  
}
Run Code Online (Sandbox Code Playgroud)

最初没有使用Dispatcher它扔了

Platform::AccessDeniedException.

然后我提到了这个,这个这个.我试图从UI获取Dispatcher.

var dispatcher = Windows.UI.Core.CoreWindow.GetForCurrentThread().Dispatcher;
Run Code Online (Sandbox Code Playgroud)

它扔了System.AccessViolationException.然后我用了

pDispatcher = Windows::UI::Core::CoreWindow::GetForCurrentThread()->Dispatcher; 
Run Code Online (Sandbox Code Playgroud)

在C++代码(WRC)中.但这也引发了Platform::AccessDeniedException.

如何在Windows Phone中获取Dispatcher for UI?

c# windows-runtime c++-cx windows-phone-8

9
推荐指数
1
解决办法
6987
查看次数

使用 Google API 从刷新令牌中获取访问令牌

我一直在使用谷歌+ API用于.NET在我application.Using提供的示例 网站,我能够得到令牌的访问。

我的问题是如何使用 OAuth 2.0 从刷新令牌中获取访问令牌。我还没有找到任何示例来从刷新令牌中获取访问令牌。

我已经提到了 [google+ API 参考],但他们使用 HTTP 方法提到了它。2请提供一些使用 google+ API 提供的方法在 C# 中的示例。

access-token oauth-2.0 c#-4.0 google-plus

5
推荐指数
1
解决办法
9276
查看次数

浏览器控件中的刷新和导航功能有何区别?

昨天,我遇到了一个用于显示“视图”(即访问该页面的人数)的网站。当我单击刷新按钮时,计数开始增加。

然后我编写了这个小应用程序来增加观看次数。

 browser = new WebBrowser();
 for (int index = 0; index < 250000; index++)
 {
   {
     browser.Navigate("url");
     System.Threading.Thread.Sleep(100);
   }
 }
Run Code Online (Sandbox Code Playgroud)

我报告了这个错误,他们已经纠正了它。现在,即使我按 F5 按钮,视图计数也不会增加。但是当我运行上面的程序时,计数开始增加。

有人可以解释一下导航功能和刷新(F5)之间的区别吗?

c# browser refresh webbrowser-control

1
推荐指数
1
解决办法
2502
查看次数

带滑块绑定的TranslateTransform不起作用

无法理解为什么Translatetransform绑定不起作用.我有3个滑块 - 一个用于缩放,2个用于x和y变换(我将圆圈作为Canvas代码中的子元素).

我在XAML下面使用:

<Window x:Class="Visualizer.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" WindowState="Maximized" WindowStartupLocation="CenterScreen" ResizeMode="NoResize">
    <Canvas HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" Name="MainCanvas" >
        <Canvas HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" Name="OperatorsCanvas" >
            <ContentControl x:Name="OperatorsContent"/>
            <Canvas.LayoutTransform>
                <TransformGroup>
                    <ScaleTransform 
                    CenterX="0" 
                    CenterY="0"
                    ScaleX="{Binding ElementName=ScaleSlider,Path=Value}"
                    ScaleY="{Binding ElementName=ScaleSlider,Path=Value}"
                    />
                    <TranslateTransform X="{Binding ElementName=TranslateXSlider,Path=Value}" Y="{Binding ElementName=TranslateYSlider,Path=Value}" />
                </TransformGroup>
            </Canvas.LayoutTransform>
        </Canvas>
        <Slider Canvas.Right="5" Width="154" Canvas.Top="5" HorizontalAlignment="Right" Name="ScaleSlider" ToolTip="Determines the UI scale factor."
                    Value="1" Minimum="0.1" Maximum="4"/>
        <Slider Canvas.Bottom="0" Width="762"  HorizontalAlignment="Stretch" Name="TranslateXSlider" Value="0" Minimum="-20" Maximum="20"/>
        <Slider Canvas.Right="0" Canvas.Top="282" Width="423" RenderTransformOrigin="0.494,0.455" Height="16" Name="TranslateYSlider"  Value="0" Minimum="-20" …
Run Code Online (Sandbox Code Playgroud)

c# wpf canvas slider

1
推荐指数
1
解决办法
740
查看次数

如何使用 Google+ API 注销用户?

我一直在使用 Google+ API 在 C#(WPF) 中开发桌面应用程序。这是一个简单的应用程序,为 Googleplus+ 提供登录页面,当用户输入凭据并同意应用程序的权限请求时,它会检索并显示用户的个人资料信息。

使用 Google+ API,我能够从 Google+ 检索用户的个人资料信息。但是当我退出并再次打开应用程序时,它不是登录页面而是直接进入“请求批准”页面。

问题出在 Internet Explorer 中,因为它默认启用“保持登录”选项。我想在每次应用程序关闭时自动注销用户。

在谷歌搜索后,我发现通过将浏览器导航到这个“ https://accounts.google.com/Logout?&continue=http://www.google.com/ ”注销用户。

google+ 中是否有任何 API 可用于以编程方式注销用户,或者这是唯一的方法?

c# wpf google-api google-plus

0
推荐指数
1
解决办法
5437
查看次数