我有两个自定义对话框(加上所需的项目ExitDlg,FatalErrorDlg等),第一个设置使用Edit控件的属性,第二个显示了使用文本控件这个属性.这是有意义的代码:
<Dialog Id="DialogA" ...>
<Control Id="ControlEdit" Type="Edit" Property="MY_PROPERTY" .../>
<Control Id="ControlNext" Type="PushButton" ...>
<Publish Event="EndDialog" Value="Return" /></Control>
</Dialog>
Run Code Online (Sandbox Code Playgroud)
然后是第二个对话框:
<Dialog Id="DialogB" ...>
<Control Id="ControlText" Type="Text" Text="[MY_PROPERTY]" .../>
<Control Id="ControlBack" Type="PushButton" ...>
<Publish Event="EndDialog" Value="Return" /></Control>
<Control Id="ControlNext" Type="PushButton" ...>
<Publish Event="EndDialog" Value="Return" /></Control>
</Dialog>
Run Code Online (Sandbox Code Playgroud)
动作顺序:
<InstallUISequence>
<Show Dialog="DialogA" Before="MyCustomAction" />
<Custom Action="MyCustomAction" Before="DialogB" />
<Show Dialog="DialogB" Before="ExecuteAction" />
</InstallUISequence>
Run Code Online (Sandbox Code Playgroud)
自定义操作会更改值MY_PROPERTY.我的问题是如何使返回按钮DialogB回来DialogA.使用NewDialog很简单,但是我无法在对话框之间执行自定义操作,或者我可以吗?
编辑 - 2013-05-02
在@caveman_dick的答案之后,我试图改变它DialogA几乎就像他说的那样,但是EndDialog我没有使用,而是改为 …
使用此代码时(简化为询问):
var rows1 = (from t1 in db.TABLE1
where (t1.COLUMN_A == 1)
select new { t1.COLUMN_B, t1.COLUMN_C });
var rows2 = (from t2 in db.TABLE2
where (rows1.Contains(t2.COLUMN_A))
select t2;
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
无法从用法推断出方法'System.Linq.Enumerable.Contains(System.Collections.Generic.IEnumerable,TSource)'的类型参数.尝试显式指定类型参数.
我需要通过COLUMN_B过滤第一个结果,但我不知道如何.有没有办法过滤它?
我想在安装过程中显示自定义操作的进度文本.我在WiX Progress Text中为自定义操作实现了代码,但它不起作用.
显示所有其他文本(例如文件副本),正确填充ActionText表,并且ActionText.Action与CustomAction.Actuib值匹配.有谁知道出了什么问题?这是代码:
主要WiX项目:
<Product>
<CustomAction Id="MyCA" BinaryKey="MyCALib"
DllEntry="MyCAMethod" Execute="deferred"
Return="check" />
<InstallExecuteSequence>
<Custom Action="MyCA" Before="InstallFinalize" />
</InstallExecuteSequence>
<UI>
<UIRef Id="MyUILibraryUI" />
</UI>
</Product>
Run Code Online (Sandbox Code Playgroud)
UI库:
<Wix ...><Fragment>
<UI Id="MyUILibraryUI">
<ProgressText Action="MyCA">Executing my funny CA...
</ProgressText>
...
<Dialog Id="Dialog_Progress" ...>
<Control Id="Ctrl_ActionText"
Type="Text" ...>
<Subscribe Event="ActionData" Attribute="Text" />
</Control>
...
Run Code Online (Sandbox Code Playgroud)
C#自定义动作库:
public class MyCALib
{
[CustomAction]
public static ActionResult MyCAMethod(Session session)
{
System.Threading.Thread.Sleep(10000); // to show text
// do something
System.Threading.Thread.Sleep(10000); // to show text
return ActionResult.Success;
} …Run Code Online (Sandbox Code Playgroud) 如何使用VerticalAlignment="Stretch"带有Label内Canvas?我正在尝试将按钮中的文本"取消"居中,如下面的代码所示.使用固定高度和宽度的标签不是一个理想的选择.
<Button Name="buttonCancel" Width="80" Height="40" IsCancel="True" Padding="0" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
<Canvas>
<Label Canvas.Top="0" Canvas.Left="0" Padding="0" FontSize="10">Esc</Label>
<Label VerticalContentAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">Cancel</Label>
</Canvas>
</Button>
Run Code Online (Sandbox Code Playgroud) 有没有办法强制自动登录WiX?
目前,要生成日志,我需要使用以下参数执行我的包:
application.msi /l*v log.txt
Run Code Online (Sandbox Code Playgroud)
我想在<Product>标签中找到一种方法- 例如 - 强制始终启用日志.我知道这在InstallShield中是可行的.
我在不同的命名空间中有两个相同的类:
namespace ClassLibrary1
class Class1
{
public readonly int field1;
public Class1(int value) { field1 = value; }
}
Run Code Online (Sandbox Code Playgroud)
和命名空间中的相同类定义ClassLibrary2.
当我尝试使用AutoMapper时,我得到以下异常:
表达式必须是可写的参数名称:left
这是AutoMapper的代码:
Mapper.CreateMap<ClassLibrary1.Class1, ClassLibrary2.Class1>();
var result = Mapper.Map<ClassLibrary2.Class1>(class1);
Run Code Online (Sandbox Code Playgroud)
但是,如果我尝试使用此AutoMapper排除字段它不起作用,使用此:
Mapper.CreateMap<ClassLibrary1.Class1, ClassLibrary2.Class1>()
.ForMember(a => a.field1, a => a.Ignore());
Run Code Online (Sandbox Code Playgroud)
当然,它可以将它更改为具有公共get和private设置的属性(比如在Automapper中忽略readonly属性),但我想阻止将来的开发人员在构造函数之后设置值.
有没有办法使用AutoMapper解决这个问题?
在我的 Kendo Grid 中,我需要绑定到我的数据源和 inCell 可编辑的三个单选按钮。问题出在编辑器上。当我单击一列(并且我创建了一个 div 墙以强制调用编辑器)时,该值没有为编辑器正确设置。当我单击另一行和不同的列时,该值不会保存。如果我单击同一列的另一行,则名称(无线电组)设置不正确(两个编辑器行具有相同的名称)。有没有办法让编辑器正确运行?
我使用 JavaScript 定义了以下网格:
编辑 1: 我在模板和编辑器中添加了一些换行符以提高可读性,但它们不应该存在于代码中。
编辑 2: 修复了输入标签验证中的错误。
<html>
<!-- head code -->
<body>
<div id="grid"></div>
<script>
$(document).ready(function() {
var grid = $("grid").kendoGrid({
dataSource: [{
id: 1, name: "John", period: "F"
}, {
id: 2, name: "Mary", period: "S"
}],
editable: true,
columns: [{
field: "name",
title: "First Name"
}, {
field: "period",
title: "Period",
template: '<div style="position:relative">
<input type="radio" name="group#: id#" value="F" #= period=="F" ? checked="checked" : "" # />First …Run Code Online (Sandbox Code Playgroud) wix ×3
c# ×2
.net-4.0 ×1
automapper ×1
canvas ×1
installer ×1
javascript ×1
jquery ×1
kendo-grid ×1
kendo-ui ×1
linq ×1
sql ×1
wpf ×1
xaml ×1