我无法导航到/users我的应用程序中,因为它不会触发我想到它应该获取的所有查询.
我的应用程序包含一个App组件和一些包含实际内容的组件,如Dashboard或UserList.还有一个,EnsureAuthenticationContainer但这只是一个组件,当用户通过身份验证时,只需呈现它的子项.这是我的路线设置:
const ViewerQueries = {
viewer: () => Relay.QL`query { viewer }`
};
Run Code Online (Sandbox Code Playgroud)
[...]
<Router history={browserHistory} render={applyRouterMiddleware(useRelay.default)} environment={Relay.Store}>
<Route path="/" component={App} queries={ViewerQueries}>
<Route path="login" component={Login} />
<Route component={EnsureAuthenticationContainer}>
<IndexRoute component={Dashboard} />
<Route path="users" component={UserList} queries={ViewerQueries} />
<many more routes />
</Route>
</Route>
</Router>
Run Code Online (Sandbox Code Playgroud)
问题是,这两个App和UserList定义fragements,似乎只有的查询UserList被发送.
片段App:
fragments: {
viewer: () => {
return Relay.QL`
fragment on ViewerType {
loggedInUser {
id
} …Run Code Online (Sandbox Code Playgroud) 这个问题类似于这个问题:How to use different tsconfig file for tests? 但我要求 Visual Studio 代码。
我有两个tsconfig文件:
tsconfig.json 对于所有应用程序文件tsconfig.test.json 对于所有测试文件tsconfig.jsonexclude all*.spec.ts而tsconfig.test.json只包含这些文件。
如何让 Visual Studio 代码了解打开的.spec.ts文件属于tsconfig.test.json?
我不想将我的所有测试分开到一个test包含它自己的目录中,tsconfig.json而是将它们放在应用程序文件旁边。
我想构建一个Web应用程序,前端使用Javascript,后端使用C#,我想确定GraphQL的值.
现在,对于我的后端,我实现了一个示例模式,如下例所示:
public class StarWarsSchema : Schema
{
public StarWarsSchema()
{
Query = new StarWarsQuery();
}
}
Run Code Online (Sandbox Code Playgroud)
在我的前端,我现在需要以某种方式告诉Relay这个架构.至少这是我在阅读教程时所理解的,因为出于某种原因需要转换GraphQL查询.这是一个例子,我想加载所有机器人:
class Content extends React.Component<ContentProps, { }> {
...
}
export default Relay.createContainer(Content, {
fragments: {
viewer: () => Relay.QL`
fragment on User {
query HeroNameQuery {
droids {
id
name
}
}
}
`,
}
});
Run Code Online (Sandbox Code Playgroud)
在Relay的一个例子中,我看到babel-relay-plugin用于转换.它获取一个模式文件(JSON).该入门继电器的指南显示,如何建立这样的架构graphql-JS和graphql继电器JS.
现在我的问题:
好像我的multibinding有问题.
场景:
我有一个带有两个日期选择器和一个列表视图的窗口.listliew包含一些称为"条目"的数据绑定元素.条目具有名为"date"的属性.
我只想让我的listview显示日期在我的两个日期选择日期之间的条目.
我的xaml代码用于将listview绑定到条目和日期:
<ListView.ItemsSource>
<MultiBinding Converter="{StaticResource EntriesFilterConv}"
UpdateSourceTrigger="PropertyChanged">
<Binding Path="Entries" UpdateSourceTrigger="PropertyChanged"/>
<Binding ElementName="EntryFromDate" Path="SelectedDate"
UpdateSourceTrigger="PropertyChanged"/>
<Binding ElementName="EntryToDate" Path="SelectedDate"
UpdateSourceTrigger="PropertyChanged"/>
</MultiBinding>
</ListView.ItemsSource>
Run Code Online (Sandbox Code Playgroud)
但是,这不起作用.当SelectedDate发生更改时调用我的转换器,但在条目更改时从不调用它.
使用这样的普通数据绑定:
<ListView ItemsSource="{Binding Entries}">
...
</ListView>
Run Code Online (Sandbox Code Playgroud)
列表视图正常更新.任何的想法?
新的反射API引入了TypeInfo类:https:
//msdn.microsoft.com/en-us/library/system.reflection.typeinfo(v = vs.110).aspx
我可以通过写作获得一个(例如,a )的TypeInfo实例TypeCar
TypeInfo typeInfo = typeof(Car).GetTypeInfo();
Run Code Online (Sandbox Code Playgroud)
现在,如果我只有一个TypeInfo实例,我如何得到Type它的引用呢?我可以写吗
Type type = typeInfo.GetType();
Run Code Online (Sandbox Code Playgroud)
或者这将返回一个type等于typeof(TypeInfo)?
我想在控制台上使用log4net进行一些信息记录,并在每一行中使用多种颜色.这是我目前的简化配置:
...
<appender name="ConsoleDebug" type="log4net.Appender.ColoredConsoleAppender">
<filter type="log4net.Filter.LevelRangeFilter">
<levelMin value="INFO" />
</filter>
<mapping>
<level value="INFO" />
<foreColor value="Green, HighIntensity" />
</mapping>
...
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%logger{1} %message%newline" />
</layout>
</appender>
...
Run Code Online (Sandbox Code Playgroud)
这将我的所有日志消息输出为绿色文本.是否可以输出%logger为白色文本和%message绿色?
我正在为 Visual Studio 代码编写一个扩展,我想在其中评估 javascript 调试会话的当前变量。当打开该部分下的调试窗格时,通常会显示这些变量VARIABLES。请参阅随附的屏幕截图。
我想在用户右键单击编辑器时访问这些变量,但我不知道如何操作。
我当前的扩展设置是这样的:在package.json我已经注册了一个菜单贡献和一个命令:
"contributes": {
"menus": {
"editor/context": [{
"command": "extension.showVariables",
"group": "navigation"
}]
}
}
Run Code Online (Sandbox Code Playgroud)
在我的 extension.ts 中,我注册了这样的命令:
export function activate(context: vscode.ExtensionContext) {
let disposable = vscode.commands.registerCommand('extension.showVariables', () => {
// TODO: let variables = vscode.debug.activeDebugSession.variables.toString();
vscode.window.showInformationMessage(variables);
});
}
Run Code Online (Sandbox Code Playgroud)
我试图让它们通过,vscode.debug.activeDebugSession但这里没有变量的 API。我还尝试注册一个事件处理程序,vscode.debug.onDidReceiveDebugSessionCustomEvent但我不知道在哪里搜索调试变量。
是否可以在 vs 扩展中访问这些变量,或者我是否需要实现自己的调试器?
我在我的应用程序中有一个视图,可以显示巨大的数据表.数据显示在两个嵌套的UniformGrids中.UniformGrids是ItemsControls中的ItemPanels,并绑定到某些ViewModel.请参阅以下图像和一些示例XAML-Code:
view和viewmodel http://img593.imageshack.us/img593/8825/stackoverflowuniformgri.png
<!-- The green boxes -->
<ItemsControl ItemsSource="{Binding BigCells}">
<ItemsControl.ItemPanel>
<PanelTemplate>
<UniformGrid />
</PanelTemplate>
</ItemsControl.ItemPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<!-- The blue boxes -->
<ItemsControl ItemsSource="{Binding SmallCells}">
<ItemsControl.ItemPanel>
<PanelTemplate>
<UniformGrid />
</PanelTemplate>
</ItemsControl.ItemPanel>
</ItemsControl>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
Run Code Online (Sandbox Code Playgroud)
现在,我希望我的视图可以调整大小,但由于计算了每个小盒子的布局,因此它的性能不佳.
这至少对于盒子大小只能进行一次,因为它对于所有盒子都是相同的.
在WPF中显示大量控件的最佳实践/我可以在哪里开始优化?关键字已经帮助我继续发现WPF中UniformGrids的性能优化.
我正在创建一个带有自定义用户界面的WPF设置应用程序.我从Bryan P. Johnston的教程开始:http://bryanpjohnston.com/2012/09/28/custom-wix-managed-bootstrapper-application/
在我看来的某个地方,我有一个简单的TextBox绑定到InstallationPath我的房产MainViewModel.
现在,我希望在用户单击"安装"时使用此路径.为此,我有一个绑定到我的按钮InstallCommand.调用以下方法(直接从教程中获取):
private void InstallExecute()
{
Bootstrapper.Engine.Plan(LaunchAction.Install);
}
Run Code Online (Sandbox Code Playgroud)
如何将软件包安装到我的属性目录中InstallationPath?
编辑:
我在Stackoverflow上发现了一个类似的问题:
在Burn托管引导程序内指定WiX中的软件包的INSTALLLOCATION
答案来自Bob Arnson
为每个MsiPackage使用MsiProperty子项指定INSTALLLOCATION = [BurnVariable].然后使用Engine.StringVariables设置BurnVariable.
现在,我想我可以访问StringVariables我的InstallExecute喜欢这个
private void InstallExecute()
{
Bootstrapper.Engine.StringVariables["BurnVariable"] = InstallationPath;
Bootstrapper.Engine.Plan(LaunchAction.Install);
}
Run Code Online (Sandbox Code Playgroud)
但是在哪里定义这个变量?我想在Product.wxs的某个地方?
我在更新 npm 包时遇到问题,这表明我缺乏理解peerDependencies和/或^ caret版本范围。
我的项目my-app依赖于awesome-lib版本 中的包6.1.0。\n它还依赖于miracle-lib版本 中的包3.2.0-alpha.2。
该包miracle-lib@3.2.0-alpha.2有一个peerDependencyto awesome-lib@^6.1.0(注意^ caret)。
跑步npm install跑得很好。\xe2\x9c\x93
我想使用awesome-lib从一个6.1.0版本更新到另一个版本6.2.0-alpha.1
npm install awesome-lib@6.2.0-alpha.1\nRun Code Online (Sandbox Code Playgroud)\n但这会产生以下错误:
\nnpm ERR! code ERESOLVE\nnpm ERR! ERESOLVE unable to resolve dependency tree\nnpm ERR!\nnpm ERR! While resolving: my-app@1.0.0\nnpm ERR! Found: awesome-lib@6.2.0-alpha.1\nnpm ERR! node_modules/awesome-lib\nnpm ERR! awesome-lib@"6.2.0-alpha.1" from …Run Code Online (Sandbox Code Playgroud) javascript dependency-management npm semantic-versioning typescript
c# ×4
javascript ×2
reactjs ×2
typescript ×2
wpf ×2
xaml ×2
.net-core ×1
asp.net-core ×1
bootstrapper ×1
data-binding ×1
graphql ×1
log4net ×1
npm ×1
performance ×1
react-router ×1
reflection ×1
relay ×1
relayjs ×1
tsconfig ×1
wix ×1