小编cre*_*ive的帖子

Visual Studio使用Xamarin发布到应用商店

我找不到任何关于如何从Visual Studio将应用程序发布到应用程序商店的文档?这是您准备提交应用程序后必须使用Xamarin Studio的情况吗?

似乎有点奇怪的是,xamarin为您提供了使用Visual Studio的机会,但之后绝对没有关于如何创建捆绑包以将您的应用程序提交到应用商店的说明.

有关如何使用Visual Studio执行此操作的任何提示都会很棒.

xamarin.ios xamarin visual-studio-2012 xamarin-studio

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

从命令行调用时无法识别Powershell函数

我有一个简单的问题。我的powershell脚本包含几个函数,该脚本调用这些函数没有问题。

但是,当我尝试从命令行运行powershell来执行脚本时,会出现错误;

The term 'MyFunction' is not recognized as the name of a cmdlet....'
Run Code Online (Sandbox Code Playgroud)

到处都告诉我,我需要从命令行像这样运行脚本,脚本才能正常工作。

powershell "& "'C:\My Path\script.ps1'"
Run Code Online (Sandbox Code Playgroud)

这将运行脚本,但是功能仍然无法正常工作。无论我的脚本调用哪个函数之一,我都会得到错误。我究竟做错了什么?我什至只创建了一个脚本,只写一行。

. C:\My Path\script.ps1
Run Code Online (Sandbox Code Playgroud)

再次运行正常,但是在命令行中运行时失败,并出现相同的错误。任何帮助,将不胜感激!

编辑:函数是这样定义的;

function MyFunction ($id1, $id2) {
    ....
}
Run Code Online (Sandbox Code Playgroud)

它被这样称呼;

MyFunction $var1 $var2
Run Code Online (Sandbox Code Playgroud)

以下脚本文件解决了我的问题,可以从命令行正常运行;

Import-Module 'C:\My Path\script.ps1'
MyStartFunction  # calls other functions

powershell "& "'C:\My Path\AboveScriptFile.ps1'"
Run Code Online (Sandbox Code Playgroud)

powershell powershell-2.0

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

DispatcherTimer用于显示秒数

我想显示一个简单的第二个计数器.我有一个调度时间间隔为1秒的调度程序和一个文本框,我在tick处理程序中用当前的秒数更新.tick处理程序中有很少的工作,即在某些int上调用'tostring()'.

我的问题是秒数比它们应该慢.即使我将间隔设置为100毫秒并在经过时进行检查,它仍然比它应该更慢.(在一分钟内它大约慢了6秒).

有人能指出我正确的方向显示准确的第二个计数器吗?

编辑:这里的一些代码(在.xaml.cs中).它取自一个工作正常的例子.不同之处在于我设置了TextBox的Text属性,而不是另一个控件的Value属性.

...
        this.timer.Interval = TimeSpan.FromMilliseconds(100);
...

    private void OnDispatcherTimer_Tick(object sender, EventArgs e) {
        if (this.currentValue > TimeSpan.Zero) {
            this.currentValue = this.currentValue.Value.Subtract(TimeSpan.FromMilliseconds(100));
        } else {
            // stop timer etc
        }

        this.seconds.Text = this.currentValue.Value.Seconds.ToString();
    }
Run Code Online (Sandbox Code Playgroud)

wpf windows-mobile windows-phone-7

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