在我的gulp构建中,我完成了一项任务,在完成所有编译,丑化和缩小之后运行.此任务只是将src中的所有内容复制到以前的任务未触及/处理的dest目录中.我遇到的小问题是这导致dest目录中的空目录.
有没有办法告诉gulp.src
glob只包含模式匹配中的文件(比如提供'is_file'
标志)?
谢谢.
我对WPF世界很陌生,我在使用ItemsControl模板化项目时遇到了一些问题.我需要的是在ItemsControl(或类似)中模板元素(主要是按钮).
如果我使用以下XAML代码...
<ItemsControl>
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type Button}">
<Border BorderBrush="AliceBlue"
BorderThickness="3">
<TextBlock Text="Templated!"/>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
<Button>Not templated</Button>
<TextBlock>Text not templated</TextBlock>
</ItemsControl>
Run Code Online (Sandbox Code Playgroud)
...我得到这个结果:http://img444.imageshack.us/img444/2167/itemscontrolnottemplate.gif
该ItemsControl的没有模板套用到按钮也不到TextBlock的控制.如果我将ItemsControl更改为ListBox,如下所示:
<ListBox>
<ListBox.ItemTemplate>
<DataTemplate DataType="{x:Type Button}">
<Border BorderBrush="AliceBlue"
BorderThickness="3">
<TextBlock Text="Templated!"/>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
<Button>Not templated</Button>
<TextBlock>Text not templated</TextBlock>
</ListBox>
Run Code Online (Sandbox Code Playgroud)
...然后我得到了这个结果:img814.imageshack.us/img814/6204/listboxtoomuchtemplatin.gif
现在模板应用于两个子控件(即使我将DataType设置为Button).
我想合并/合并多个Observable,当每个Observable完成时,执行finally函数。该merge
操作似乎在并行执行每个订阅,这正是我需要的,但如果其中任何引发错误的停止执行。
RxJS 版本4具有一个操作符mergeDelayError,该操作符应使所有订阅都一直执行到所有订阅都完成为止,但是该操作符在版本5中未实现。
我应该恢复为其他运营商吗?
var source1 = Rx.Observable.of(1,2,3).delay(3000);
var source2 = Rx.Observable.throw(new Error('woops'));
var source3 = Rx.Observable.of(4,5,6).delay(1000);
// Combine the 3 sources into 1
var source = Rx.Observable
.merge(source1, source2, source3)
.finally(() => {
// finally is executed before all
// subscriptions are completed.
console.log('finally');
});
var subscription = source.subscribe(
x => console.log('next:', x),
e => console.log('error:', e),
() => console.log('completed'));
Run Code Online (Sandbox Code Playgroud)
联合会
我是WPF和MVVM的新手(本周开始尝试它)并尝试在运行时绑定图像资源.我正在尝试显示的项目包含一个枚举属性,指示项目的类型或状态:
public class TraceEvent
{
/// <summary>
/// Gets or sets the type of the event.
/// </summary>
/// <value>The type of the event.</value>
public TraceEventType EventType { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
据我所知,Image的Source属性有一个值转换器,它接受字符串并返回Uri对象.
<Image Source="{Binding Path=EventType, StringFormat={}/AssemblyName;component/Images/{0}Icon.ico}" />
Run Code Online (Sandbox Code Playgroud)
那么为什么上面的工作没有呢?如果我直接输入uri(没有绑定),图像就会完美显示.实际上,如果我在TextBlock中进行绑定并在Image中使用该值的结果也没有问题:
<TextBlock Visibility="Collapsed" Name="bindingFix" Text="{Binding Path=EventType, StringFormat={}/AssemblyName;component/Images/{0}Icon.ico}"/>
<Image Source="{Binding ElementName=bindingFix, Path=Text}" />
Run Code Online (Sandbox Code Playgroud)
我非常肯定我正在做一些与图像这么明显的事情有关的错误.
谢谢.
我想设置为我的javascript CONCAT在建任务水珠阵列一饮而尽.目录结构如下所示:
??? about
? ??? about.js
??? assets
??? contact
??? core
? ??? navbar
? ? ??? navbar.js
? ? ??? navbar.test.js
? ??? routing.js
? ??? routing.test.js
? ??? utils.js
? ??? utils.test.js
??? generated
? ??? footer.js
? ??? header.js
? ??? templates.js
??? home
??? app.js
??? config.js
Run Code Online (Sandbox Code Playgroud)
文件的顺序很重要:
我已经疯狂地尝试了各种通配符的组合,但对我来说并不强烈.
var inputFiles = [
'generated/header.js',
'app.js',
'!(generated)**/*.js', // <=---- ???
'generated/templates.js',
'generated/footer.js',
'!**/*.test.js' …
Run Code Online (Sandbox Code Playgroud) glob ×2
gulp ×2
node.js ×2
wpf ×2
binding ×1
gulp-glob ×1
image ×1
itemscontrol ×1
itemtemplate ×1
javascript ×1
listbox ×1
minimatch ×1
mvvm ×1
rxjs ×1
rxjs5 ×1