我想回滚一下我最近在TFS中做出的改变.在Subversion中,这非常简单.然而,它似乎是TFS令人难以置信的头痛:
如何回滚到TFS中的先前变更集?
我正在WPF中构建一个演示应用程序,这对我来说是新的.我目前正在FlowDocument中显示文本,需要打印它.
我正在使用的代码如下所示:
PrintDialog pd = new PrintDialog();
fd.PageHeight = pd.PrintableAreaHeight;
fd.PageWidth = pd.PrintableAreaWidth;
fd.PagePadding = new Thickness(50);
fd.ColumnGap = 0;
fd.ColumnWidth = pd.PrintableAreaWidth;
IDocumentPaginatorSource dps = fd;
pd.PrintDocument(dps.DocumentPaginator, "flow doc");
Run Code Online (Sandbox Code Playgroud)
fd是我的FlowDocument,现在我使用默认打印机而不是允许用户指定打印选项.它工作正常,除了在文档打印后,屏幕上显示的FlowDocument已更改为使用我指定的设置进行打印.
我可以通过在打印后手动重置所有内容来解决这个问题,但这是最好的方法吗?我打印之前是否应该复制FlowDocument?或者我应该考虑另一种方法吗?
我需要能够使用C#在WinForms应用程序中嵌入和控制AVI文件的播放.视频需要嵌入到表单中,而不是在单独的媒体播放器窗口中启动.
这样做的最佳方法是什么?我找到了System.Media命名空间,听起来很有希望,但它似乎只对声音有用.
我是否使用DirectX执行此操作?MCI?还是其他一些方法?
我的应用程序中有一个使用TriState模式的CheckBox.此模式的正常行为似乎是在null,false,true之间循环.
我想改变这种行为,使其在null,true,false之间循环.
最好的方法是什么?
我尝试添加类似于此的点击处理程序:
void cb_Click(object sender, RoutedEventArgs e)
{
if (((CheckBox)e.Source).IsChecked.HasValue == false)
{
((CheckBox)e.Source).IsChecked = true;
return;
}
if (((CheckBox)e.Source).IsChecked == true)
{
((CheckBox)e.Source).IsChecked = false;
return;
}
if (((CheckBox)e.Source).IsChecked == false)
{
((CheckBox)e.Source).IsChecked = null;
return;
}
}
Run Code Online (Sandbox Code Playgroud)
但这似乎完全禁用了复选框.我很确定我错过了一些显而易见的东西.
我正在从数据源动态构建WPF FlowDocument.其中一个数据元素是HTML的一个片段 - 我需要找到一种方法来解析它并将其插入到我的FlowDocument中.
我发现HTMLToXAMLConverter将返回HTML的XAML表示,但我仍然不确定如何最好地实例化该XAML片段,以便我可以将其插入到我的FlowDocument中.
我有一个中型SQL Server 2008数据库,其中包含精算数据.它的所有用例都是只读查询.在这种情况下,我应该考虑哪些特殊优化?或者我应该坚持优化数据库的常规规则?
我最近发现我可以创建Swift命令行脚本.
我决定看看我是否可以使用它来构建我的Xamarin项目.
不幸的是我收到以下错误,我不知道如何解决它.
***由于未捕获的异常'NSInvalidArgumentException'终止应用程序,原因:'启动路径无法访问'
这是我的脚本:
#!/usr/bin/env swift
import Foundation
print("Building Script")
let fileManager = NSFileManager.defaultManager()
let path = fileManager.currentDirectoryPath
func shell(launchPath: String, arguments: [String] = []) -> NSString? {
let task = NSTask()
task.launchPath = launchPath
task.arguments = arguments
let pipe = NSPipe()
task.standardOutput = pipe
task.launch()
let data = pipe.fileHandleForReading.readDataToEndOfFile()
let output = NSString(data: data, encoding: NSUTF8StringEncoding)
return output
}
if let output = shell("/Applications/Xamarin\\ Studio.app/Contents/MacOS/mdtool", arguments: ["-v build", "\"--configuration:Beta|iPhone\"", "MyApp.iOS.sln"]) {
print(output)
}
Run Code Online (Sandbox Code Playgroud)
有什么想法吗?
我有一个我正在构建的WPF表单.我想为窗口指定一个背景图像,这很容易.但是,我还想指定一种颜色,以使图像未覆盖的表格区域为白色.我已经看到一些示例显示使用两个不同的背景画笔,但当我尝试VS.NET告诉我,我不能有多个画笔.
这是我正在使用的XAML
<Window x:Class="Consent.Client.Shell"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cal="http://www.codeplex.com/CompositeWPF"
Title="Shell" WindowStyle="None" WindowState="Maximized" FontSize="24">
<Window.Background>
<ImageBrush AlignmentX="Left" AlignmentY="Top" Stretch="None" TileMode="None" ImageSource="logo_header2.png" />
</Window.Background>
<ItemsControl Background="White" VerticalAlignment="Center" cal:RegionManager.RegionName="MainRegion" >
</ItemsControl>
</Window>
Run Code Online (Sandbox Code Playgroud)
这适用于图像,但图像未覆盖的背景为黑色.我怎么把它变成白色?改变图像本身并不是一种选择.
我正在首次涉足WPF - 我有一个简单的表单,其中有一个为内联帮助定义的弹出窗口.我正在使用圆角,由于某种原因,黑色背景在角落周围流血.我不明白哪个元素导致了这个问题.
alt text http://www.awbrey.net/rounded.jpg
我认为这是一件非常明显的事情,我只是没有看到.这是我正在使用的XAML:
<Window x:Class="Consent.Client.SubjectNumberEntry"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" FontSize="24"
Title="SubjectNumberEntry" WindowStyle="None" WindowState="Maximized"
xmlns:h="clr-namespace:Consent.Client" KeyDown="windowOuter_KeyDown" Background="White" Name="windowOuter" AllowsTransparency="true" Loaded="Window_Loaded">
<StackPanel Height="400" DockPanel.Dock="Top" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10">
<StackPanel Height="60" Orientation="Horizontal" VerticalAlignment="Center">
<TextBox Name="txtSubjectNumber" Margin="10" Width="400" KeyDown="txtSubjectNumber_KeyDown" h:HelpProvider.HelpString="Enter the subject identifier, or scan their wristband">
<TextBox.ToolTip>This is a textbox</TextBox.ToolTip>
</TextBox>
<Button Name="btnEnter" Margin="10" Width="100" Click="btnEnter_Click">Enter</Button>
<Button Width="50" Name="btnHelp" Margin="10" Click="btnHelp_Click">?</Button>
<Button Width="50" Name="btnExit" Margin="10" Click="btnExit_Click">Exit</Button>
</StackPanel>
<Label Name="lblValue" Margin="10"></Label>
<Popup Placement="Bottom" HorizontalAlignment="Center" VerticalOffset="10" MouseDown="popHelp_MouseDown" PopupAnimation="Fade" Name="popHelp" PlacementTarget="{Binding ElementName=txtSubjectNumber}">
<Border Padding="10" Margin="10" …
Run Code Online (Sandbox Code Playgroud) 我在Visual Studio 2015更新2中开始了空白的跨平台项目:Visual C# - >跨平台 - >空白应用程序(Xamarin.Forms portable).
它在解决方案中创建了6个项目.然后我尝试更新所有这些的块包.不用说我遇到的第一个问题是对*design程序集的不必要的引用.我设法纠正了它.
然后,当我看到6个nuget包准备好更新时,我得到了以下消息,其中5个用于Andriod,1个是更新版本的Xamarin.Forms.
Unable to resolve dependencies. 'Xamarin.Android.Support.Design 23.2.1' is not compatible with 'Xamarin.Forms 2.1.0.6529 constraint: Xamarin.Android.Support.Design (= 23.0.1.3)'.
那么当Xamarin发布新版本的软件包时,没有考虑它们之间的兼容性?
wpf ×5
xamarin ×2
xaml ×2
background ×1
c# ×1
checkbox ×1
flowdocument ×1
html ×1
optimization ×1
printing ×1
rollback ×1
sql-server ×1
swift ×1
tfs ×1
video ×1
winforms ×1
xamarin.ios ×1