我们的View1需要鼠标点击和拖动"忽略",但工具提示仍必须在该视图中运行.原因是View1在Z-Order中高于View2,因此View1可以将View2着色为红色并通过ToolTip显示警告; 但是,如果IsHitTestVisible ="False",View1附带的工具提示将不起作用.
任何人都知道一个解决方法,因此ToolTip将在鼠标移动/结束时显示,其余的鼠标事件将被View1忽略并转到View2?
谢谢,
肖恩
我正在寻找相当于在某些Rake宏之前运行"文件 - >全部保存".
到目前为止我所拥有的是:
Private Sub Pre_Rake()
Dim i As Integer
DTE.Documents.SaveAll()
For i = 1 To DTE.Solution.Projects.Count
If Not DTE.Solution.Projects.Item(i).Saved Then
DTE.Solution.Projects.Item(i).Save()
End If
Next
End Sub
Run Code Online (Sandbox Code Playgroud)
DTE.Documents.SaveAll工作正常,但for循环不会像我期望的那样保存项目文件.
如果我在解决方案资源管理器中制作文件的副本,则在运行Pre_Rake()之后,该文件不会包含在项目文件(.CSPROJ)中.我仍然需要按CTRL-SHIFT-S或文件 - >全部保存.
那么,如何使用Visual Studio宏保存所有内容?
SampleConfirmationDialog可以通过哪些方式进行单元测试?SampleConfirmationDialog将通过验收测试来执行,但是我们如何对它进行单元测试,因为MessageBox不是抽象的而且没有匹配的接口?
public interface IConfirmationDialog
{
/// <summary>
/// Confirms the dialog with the user
/// </summary>
/// <returns>True if confirmed, false if not, null if cancelled</returns>
bool? Confirm();
}
/// <summary>
/// Implementation of a confirmation dialog
/// </summary>
public class SampleConfirmationDialog : IConfirmationDialog
{
/// <summary>
/// Confirms the dialog with the user
/// </summary>
/// <returns>True if confirmed, false if not, null if cancelled</returns>
public bool? Confirm()
{
return MessageBox.Show("do operation x?", "title", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes;
} …Run Code Online (Sandbox Code Playgroud)