该.vscode文件夹是否已提交给源代码管理?
在新项目中,文件夹为空,settings.json文件除外.什么样的东西会进入这个文件夹?它是特定于机器的,特定于开发人员的.vs文件夹,因此不会被提交吗?或者应该所有开发人员共享此文件夹,因此应该提交?
文件顶部的注释.vscode/settings.json指出:
// Place your settings in this file to overwrite default and user settings.
{
}
Run Code Online (Sandbox Code Playgroud)
这似乎暗示该文件夹应包含项目特定的设置,因此包含在源中.此外,这篇关于UserVoice的帖子似乎意味着某些类型会出现在那里,也暗示它应该被提交.
我注意到有一个npm组织@types,它包含输入包,但找不到任何文档.这些意味着如何使用?
它是否意味着与打字工具一起使用?如果是这样,如何安装它们?例如,有一个@types/openlayers包,但typings search npm:openlayers什么都不返回.
它是否意味着与打字工具分开使用?例如直接安装npm?
使用.NET Core/ASP.NET Core项目设置项目版本有哪些选项?
发现到目前为止:
设置version酒店project.json.来源:DNX概述,使用DNX项目.这似乎设定AssemblyVersion,AssemblyFileVersion并且AssemblyInformationalVersion除非属性覆盖(请参阅下一点).
设置AssemblyVersion,AssemblyFileVersion,AssemblyInformationalVersion属性也似乎工作,并覆盖version在指定的属性project.json.
例如,包括'version':'4.1.1-*'在project.json和设置[assembly:AssemblyFileVersion("4.3.5.0")]在一个.cs文件将导致AssemblyVersion=4.1.1.0,AssemblyInformationalVersion=4.1.1.0和AssemblyFileVersion=4.3.5.0
是否通过属性设置版本号,例如AssemblyFileVersion仍然支持?
我错过了什么 - 还有其他方法吗?
我正在看的场景是在多个相关项目之间共享一个版本号.一些项目使用.NET Core(project.json),其他项目使用完整的.NET Framework(.csproj).所有这些在逻辑上都是单个系统的一部分并且一起版本化.
我们到目前为止使用的策略是SharedAssemblyInfo.cs使用AssemblyVersion和AssemblyFileVersion属性在我们的解决方案的根目录下创建一个文件.项目包括文件的链接.
我正在寻找与.NET Core项目实现相同结果的方法,即只需修改一个文件.
我正在调查为什么我的Angular 2.0 TypeScript项目的编译时间在相对较短的时间内从大约4秒到大约15秒.
我遇到了非常有用但看似无记录的--diagnostics开关.
例如,这是我tsc --noEmit --diagnostics现在在项目上运行时得到的结果:
Files: 231
Lines: 50872
Nodes: 170067
Identifiers: 65994
Symbols: 7712123
Types: 407677
Memory used: 600554K
I/O read: 0.43s
I/O write: 0.00s
Parse time: 1.13s
Bind time: 0.34s
Check time: 10.17s
Emit time: 0.00s
Total time: 11.64s
Run Code Online (Sandbox Code Playgroud)
这是我在早期版本的项目上运行相同命令时得到的结果.
Files: 197
Lines: 30882
Nodes: 124208
Identifiers: 46201
Symbols: 5856945
Types: 10989
Memory used: 80412K
I/O read: 0.03s
I/O write: 0.00s
Parse time: 0.60s
Bind time: 0.27s
Check time: 0.93s
Emit time: …Run Code Online (Sandbox Code Playgroud) 我正在尝试在Silverlight 2.0中制作一个简单的填字游戏.我正在研究一个UserControl-ish组件,它代表了拼图中的一个正方形.我将UserControl的属性与其元素绑定在一起时遇到了麻烦.我终于(有点)让它工作了(可能对某些人有所帮助 - 它花了我几个小时),但是想让它更"优雅".
我想象它应该有内容的隔间和标签(在右上角),可选地包含它的'数字.内容控件可能是TextBox,而标签控件可能是TextBlock.所以我用这个基本结构创建了一个UserControl(这个值在这个阶段是硬编码的):
<UserControl x:Class="XWord.Square"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
FontSize="30"
Width="100" Height="100">
<Grid x:Name="LayoutRoot" Background="White">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock x:Name="Label" Grid.Row="0" Grid.Column="1"
Text="7"/>
<TextBox x:Name="Content" Grid.Row="1" Grid.Column="0"
Text="A"
BorderThickness="0" />
</Grid>
</UserControl>
Run Code Online (Sandbox Code Playgroud)
我也在Square类中创建了DependencyProperties,如下所示:
public static readonly DependencyProperty LabelTextProperty;
public static readonly DependencyProperty ContentCharacterProperty;
// ...(static constructor with property registration, .NET properties
// omitted for brevity)...
Run Code Online (Sandbox Code Playgroud)
现在我想弄清楚如何将Label和Content元素绑定到两个属性.我是这样做的(在代码隐藏文件中):
Label.SetBinding( TextBlock.TextProperty, new Binding { Source = this, Path = new PropertyPath( "LabelText" ), Mode …Run Code Online (Sandbox Code Playgroud) 我有一个WPF画布,我在其中动态地从代码创建对象.通过设置RenderTransform属性来转换这些对象,并且需要在其中一个转换中应用动画.目前,我无法将任何变换的属性设置为动画(虽然不会引发异常并且动画似乎运行 - 已完成的事件被引发).
此外,如果动画系统受到压力,有时则永远不会引发Storyboard.Completed事件.
我所有的例子都是来自XAML的转换动画.MSDN文档建议必须设置变换的x:Name属性才能使其可动画,但我还没有找到一种从代码中设置它的工作方式.
有任何想法吗?
这是重现问题的完整代码清单:
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace AnimationCompletedTest {
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window {
Canvas panel;
public MainWindow() {
InitializeComponent();
MouseDown += DoDynamicAnimation;
Content = panel = new Canvas();
}
void DoDynamicAnimation(object sender, MouseButtonEventArgs args) {
for (int i = 0; i < 12; ++i) {
var e = new …Run Code Online (Sandbox Code Playgroud) 在Angular 2 RC中操作DOM的正确方法是什么?
例如,我正在构建一个用于调试目的的服务来交换文档中的.css文件引用.
在Angular 2 RC之前,可以使用BrowserDomAdapterDOM操作,如下所示:
import { BrowserDomAdapter } from 'angular2/platform/browser';
...
constructor(private domAdapter: BrowserDomAdapter) {
}
...
const document = this.domAdapter.defaultDoc();
Run Code Online (Sandbox Code Playgroud)
这得益于该Title服务(现在@angular/platform-browser).似乎该Title服务仍在内部使用它,但它不再导出在Angular之外使用.即
import { BrowserDomAdapter } from "@angular/platform-browser";
Run Code Online (Sandbox Code Playgroud)
结果是:
Module '".../@angular/platform-browser/index"' has no exported member 'BrowserDomAdapter'
Run Code Online (Sandbox Code Playgroud) 我正在构建一个简单的报表Web应用程序,用于使用ASP.NET MVC3 + WebForms呈现报表.报表本身由ReportViewer ASP.NET WebForms控件呈现,但我想使用ASP.NET MVC创建参数条目.
我希望所有请求都遵循'〜/ {controller}/{action}/{parameters}'的默认路由方案,除了请求之外~/Report,应该转到报表呈现WebForm.这样做的正确方法是什么?
扩大一点..
我有两个路由Global.asax.cs- 默认的一个,一个用于WebForms页面.
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
routes.MapPageRoute("report-rendering", "Report", "~/Render.aspx");
}
Run Code Online (Sandbox Code Playgroud)
URL被渲染得很好,但问题在于,当请求进入时,第一个路由也会占用第二个路由的URL,即~/Report?id=7尝试调用该Index方法ReportController(不存在).
如果我更改它以便'报告呈现'路线在'默认'路线之前,如下所示:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapPageRoute("report-rendering", "Report", "~/Render.aspx");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with …Run Code Online (Sandbox Code Playgroud) angular ×2
typescript ×2
.net-core ×1
animation ×1
asp.net-core ×1
asp.net-mvc ×1
c# ×1
data-binding ×1
silverlight ×1
wpf ×1