我正在使用与Visual Studio 2010捆绑在一起的客户端报告功能.我已经定义了一个RDLC文件,目前在报告的顶部有用于品牌推广的嵌入式图像.图像是用户公司的徽标.它与报告数据没有任何关系......它只是一个标题.
我希望能够打破嵌入图像的依赖性,因为我开始不得不扩展应用程序.相反,我希望能够动态设置图像.不幸的是,没有参数类型似乎支持这一点.
我已经看过将源从嵌入式切换到外部,并且可能在程序启动时发出徽标的图像文件(徽标作为资源嵌入到单独的程序集中),然后将其称为一般命名的文件.资源.我不确定我有多喜欢这个选项,因为它似乎是一个黑客.在测试显式设置路径图像时,我也会收到错误,有效地说该对象未设置为实例.例如,我甚至试图将它设置为D:\ test.jpg,并在设计时得到错误...所以我更不愿意尝试这个选项.
我还看过在RDLC文件中调用引用程序集中的类,但我似乎无法让它工作.看起来我可以引用一个程序集,然后通过一个名为Code的特殊对象进行调用.因为我的类是静态的,它应该是Code.className.method,但这似乎不起作用.
我也考虑过将标题分成子报告,但我仍然认为我没有解决我的依赖问题.它仍然需要相同的维护量.
我应该提一下,我正在使用对象作为我的数据源.我应该选择什么选择?我错过了一些明显的东西吗
我在使用Ninject的InSingletonScope与Web Api RC绑定时遇到了一些困难.无论我如何创建绑定,看起来Web Api可能正在处理范围/生命周期而不是Ninject.
我尝试了一些关于连接Ninject的变种.最常见的是与此处的答案相同: ASP.NET Web API与ninject的绑定
我也试过这个版本:http: //www.peterprovost.org/blog/2012/06/19/adding-ninject-to-web-api/
在两者中,我实际上创建了一个开箱即用的Web Api项目,然后添加Ninject包,如任一帖子中所述.最后,我正在为StackOverflow版本添加Resolver和Scope类,例如:
public class NinjectDependencyScope : IDependencyScope
{
private IResolutionRoot resolver;
internal NinjectDependencyScope(IResolutionRoot resolver)
{
Contract.Assert(resolver != null);
this.resolver = resolver;
}
public void Dispose()
{
IDisposable disposable = resolver as IDisposable;
if (disposable != null)
disposable.Dispose();
resolver = null;
}
public object GetService(Type serviceType)
{
if (resolver == null)
throw new ObjectDisposedException("this", "This scope has already been disposed");
return resolver.TryGet(serviceType);
}
public IEnumerable<object> GetServices(Type serviceType)
{
if …Run Code Online (Sandbox Code Playgroud) 我正在使用优秀的MVVM Light Toolkit.我的ViewModel公开了:
public const string CourtCodesTypeCourtPropertyName = "CourtCodesTypeCourt";
private List<CourtType> _courtCodesTypes = new List<CourtType>();
public List<CourtType> CourtCodesTypeCourt
{
get
{
return _courtCodesTypes;
}
set
{
if (_courtCodesTypes == value)
{
return;
}
var oldValue = _courtCodesTypes;
_courtCodesTypes = value;
// Update bindings and broadcast change using GalaSoft.MvvmLight.Messenging
RaisePropertyChanged(CourtCodesTypeCourtPropertyName, oldValue, value, true);
}
}
public const string CourtCodesPropertyName = "CourtCodes";
private List<Court> _courtCodes = null;
public List<Court> CourtCodes
{
get
{
return _courtCodes;
}
set
{
if (_courtCodes == value) …Run Code Online (Sandbox Code Playgroud) 我有一个WPF DataGrid,它有一个AlternatingRowBackground画笔.它被配置为每隔一行着色.我想在鼠标上做一些突出当前行的事情.但是,样式触发器似乎输给了AlternatingRowBackground画笔.我在鼠标上获得了所需的行颜色...但仅限于未使用AlternatingRowBackground画笔绘制的行.
这是Windows中的Style.Resources:
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Skins/MainSkin.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style TargetType="{x:Type DataGridRow}">
<Style.Triggers>
<Trigger Property="IsMouseOver"
Value="True">
<Setter Property="Background"
Value="Red" />
<Setter Property="FontWeight"
Value="ExtraBold" />
<Setter Property="Height"
Value="20" />
</Trigger>
</Style.Triggers>
</Style>
</ResourceDictionary>
</Window.Resources>
Run Code Online (Sandbox Code Playgroud)
这是DataGrid:
<DataGrid Margin="25,15,25,0"
VerticalAlignment="Top"
ItemsSource="{Binding DocumentTypeList}"
AutoGenerateColumns="False"
Height="500"
AlternationCount="2"
FrozenColumnCount="2"
AlternatingRowBackground="{DynamicResource AlternatingRow}">
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Abbreviation}"
Header="Abbreviation" />
<DataGridTextColumn Binding="{Binding Title}"
Header="Title" />
<DataGridTextColumn Binding="{Binding Fee}"
Header="Fee" />
<DataGridTextColumn Binding="{Binding SpecialInstructions}"
Header="Special Instructions" />
</DataGrid.Columns>
</DataGrid>
Run Code Online (Sandbox Code Playgroud)
有没有办法宣布绝对赢家?这个问题是一个层次结构吗?在我看来,AlternatingRowBackground画笔胜出,因为它直接与声明的最具体部分相关联.
更新: 根据@ Val的指导,这是正确的语法:
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Skins/MainSkin.xaml" /> …Run Code Online (Sandbox Code Playgroud) 我有一个处理一些敏感数据的WCF服务.我想确保我保持这些数据不被公开,所以我正在看netTCPBinding ...主要是因为我可以控制它运行的网络,性能是一个高优先级.
我认识到有两个区域可以加密:传输级别和消息级别.我打算使用证书在传输级加密,我理解使用TLS over TCP.
呼叫客户也是我的,所以我控制运输水平.由于我预计传输层没有变化,我是否需要打扰消息级加密?除非我想要改变运输的灵活性,否则似乎没有必要.
我正在使用Web Api,并且客户端每n秒发送一次心跳通知.有一个心跳对象是在POST而不是PUT中发送的,因为我看到它们正在创建一个新的心跳而不是更新现有的心跳.
此外,客户端要求他们检索所有其他当前在线客户端以及单个客户端具有的未读消息数.在我看来,我有两个选择:
选项#2 stubped out看起来像这样:
public HeartbeatEcho Post(Heartbeat heartbeat)
{
}
Run Code Online (Sandbox Code Playgroud)
HeartbeatEcho是一个类,其中包含其他在线客户端的属性和未读消息的数量.
Web Api当然支持选项#2,但仅仅因为我可以做某事并不意味着我应该这样做.选项#2是憎恶,过早优化还是实用主义?
.net ×2
wpf ×2
wpfdatagrid ×2
encryption ×1
image ×1
mvvm ×1
mvvm-light ×1
networking ×1
ninject ×1
reporting ×1
rest ×1
tcp ×1
wcf ×1