我有一个定制的清理工作,几乎就是'那里'.
但是,R#似乎想要对成员方法进行排序,但至少它看起来不是按字母顺序排列的.
有没有办法强制排序?
(注-这是一个重新出任我的第一个问题,下得了错误标题发布:这里对不起!)
我有一个标准的WPF树视图,并有绑定项目来查看模型类.
我现在希望在双击项目时处理行为(打开文档visual-studio-style).
我可以在树视图(显示xaml)的控件中触发事件处理程序,但是如何绑定到视图模型类上的特定行为 - 例如ProjectViewModel?
最好绑定到ICommand-implementationmen,因为这在别处使用...
<TreeView ItemsSource="{Binding Projects}" MouseDoubleClick="TreeView_MouseDoubleClick">
<TreeView.ItemContainerStyle>
<!--
This Style binds a TreeViewItem to a TreeViewItemViewModel.
-->
<Style TargetType="{x:Type TreeViewItem}">
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
<Setter Property="FontWeight" Value="Normal" />
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="FontWeight" Value="Bold" />
</Trigger>
</Style.Triggers>
</Style>
</TreeView.ItemContainerStyle>
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type Implementations:ProjectViewModel}" ItemsSource="{Binding Children}">
<StackPanel Orientation="Horizontal">
<Image Width="16" Height="16" Margin="3,0" Source="Images\Region.png" />
<TextBlock Text="{Binding DisplayName}" />
</StackPanel>
</HierarchicalDataTemplate>
<HierarchicalDataTemplate DataType="{x:Type Implementations:PumpViewModel}" ItemsSource="{Binding Children}"> …Run Code Online (Sandbox Code Playgroud) 我想编辑一个如下所示的对象.我想用UsersSelectedList填充UsersGrossList中的一个或多个用户.
使用mvc中的标准编辑视图,我只得到映射的字符串和布尔值(下面未显示).我在谷歌上找到的许多例子都使用了mvc框架的早期版本,而我使用的是官方的1.0版本.
任何观点的例子都表示赞赏.
public class NewResultsState
{
public IList<User> UsersGrossList { get; set; }
public IList<User> UsersSelectedList { get; set; }
}
Run Code Online (Sandbox Code Playgroud) 我希望使用 docker-images / docker-for-windows 在我的开发机器上运行 Prometheus 和 Grafana。
我正在开发系统,ASP.Net core,在 localhost:5001 上运行,指标在 https://localhost:5001/metrics 上显示得很好。
下面列出了 Docker-compose.yml 和 prometheus.yml。
我究竟做错了什么?有什么意见欢迎留言!
version: '3.8'
services:
prometheus:
image: prom/prometheus
container_name: gradle_docker-prometheus
#network_mode: host
ports:
- 9090:9090
volumes:
- prometheus-storage:/var/lib/prometheus
- /c/Data/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
command:
- '--config.file=/etc/prometheus/prometheus.yml'
grafana:
image: grafana/grafana
container_name: gradle_docker-grafana
ports:
- "3000:3000"
volumes:
- grafana-storage:/opt/grafana/data
depends_on:
- prometheus
volumes:
prometheus-storage: {}
grafana-storage: …Run Code Online (Sandbox Code Playgroud) 我在我的数据库模型之上有一个模型,并在我的存储库中映射对象.
然而,显然我是否直接在我的GetUsers中"选择新"或"选择工厂结果"如下所示.我在运行时得到错误,方法CreateFromDbModel没有转换为sql(System.NotSupportedException).
有没有解决的办法?我能以某种方式修补它吗?
想要使用工厂方法的原因是我可能会在其他地方实例化对象,并希望将"映射代码"保存在一个地方......
感谢任何评论,安德斯
public IQueryable<User> GetUsers(bool includeTeams)
{
return from u in _db.sc_Players
where (includeTeams || (!u.aspnet_User.sc_Player.IsTeam))
select UserFactory2.CreateFromDbModel(u);
}
public static User CreateFromDbModel(sc_Player player)
{
return new User
{
Id = player.sc_PlayerID,
FirstName = player.FirstName.Trim(),
LastName = player.LastName.Trim(),
PresentationName = player.FirstName.Trim() + " " + player.LastName.Trim(),
LoginName = player.aspnet_User.LoweredUserName,
IsTeam = player.IsTeam,
Email = player.aspnet_User.aspnet_Membership.Email,
Password = player.aspnet_User.aspnet_Membership.Password
};
}
Run Code Online (Sandbox Code Playgroud) 我在ccnet.config文件中有各种设置,并希望将它们传递给我的构建文件,以便将这些常量保存在一个位置.
我怎么做?!
谢谢,
丹麦安德斯
我们在每个存储库中开发了多种产品。我们使用 Azure DevOps 来处理拉取请求。我们有一个Pull Request 模板,我们希望在所有存储库上使用它,并希望在一个位置进行维护。
这可能吗?如何实现?
在构建服务器 TeamCity 上运行测试时,我的日志中出现 [subject],并且步骤失败。
该代码是包含相当多代码的结果,这使得很难准确指出我做错了什么(而且我宁愿不回滚更改并以小步骤再次执行)。
我怎样才能解决这个问题?我怎样才能查明问题所在?
我正在使用 x64/v4.0 在构建服务器上运行 - nunit nuget 3.10.1(撰写本文时的最新官方版本) - nunit.console 3.8.0
在我的开发机器上本地运行(通过 R#),我没有看到任何问题。
这些测试是基于数据库的测试,我为测试(案例)创建一个新数据库,然后在测试完成时将其删除。
欢迎任何建议!
BR-安德斯
[14:31:35]Step 3/6: NUnit - non-selenium (NUnit) (1m:05s)
[14:32:41]Step 4/6: OctopusDeploy: Create release (8s)
[14:32:50]Step 5/6: OctopusDeploy: Deploy release CI (OctopusDeploy: Deploy release) (1m:02s)
[14:33:52]Step 6/6: NUnit - selenium (NUnit) (1m:24s)
[14:33:53][Step 6/6] Starting: C:\TeamCity\buildAgent\tools\JetBrains.dotCover.CommandLineTools.bundled\dotCover.exe cover C:\TeamCity\buildAgent\temp\buildTmp\eBhHYI0b3Hab7OnsiQarKgWFi56r6tlg.dotCover /ReturnTargetExitCode /NoCheckForUpdates
[14:33:53][Step 6/6] in directory: C:\TeamCity\buildAgent\work\f7928b43a423b8ff\Src\JCI.ITC.COMP2.Search.IntegrationTests
[14:33:53][Step 6/6] JetBrains dotCover Console Runner 2017.2.2. Build 109.0.20171006.131113
[14:33:53][Step 6/6] Copyright (c) 2009-2018 JetBrains s.r.o. …Run Code Online (Sandbox Code Playgroud) 我正在CruiseControl.Net构建服务器上构建一个C++应用程序.
构建本身由msbuild完成并通过cruisecontrol.net我可以获得所需的版本 - 但是我无法将其标记为c ++输出.
下面是我的msbuild项目文件.
任何意见表示赞赏,
丹麦安德斯
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="FullBuild" ToolsVersion="3.5">
<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>
<UsingTask TaskName="NCover.MSBuildTasks.NCover" AssemblyFile="C:\Program Files\NCover\Build Task Plugins\NCover.MSBuildTasks.dll"/>
<UsingTask TaskName="NCover.MSBuildTasks.NCoverReporting" AssemblyFile="C:\Program Files\NCover\Build Task Plugins\NCover.MSBuildTasks.dll"/>
<ItemGroup>
<MyBinaries Include="Build\*.*"/>
</ItemGroup>
<PropertyGroup>
<CCNetLabel Condition="$(CCNetLabel)==''">2.0.0.0</CCNetLabel>
</PropertyGroup>
<ItemGroup>
<Projects Include="$(vsproject)" />
</ItemGroup>
<Target Name="Rebuild">
<MSBuild Projects="@(Projects)" StopOnFirstFailure="true" ContinueOnError="false" Targets="Rebuild" Properties="version=$(CCNetLabel)" />
</Target>
</Project>
Run Code Online (Sandbox Code Playgroud) 我有一个要构建和部署的 dotnet 核心项目。
目前我在TC上有3个步骤;
在 OD 中,我希望使用 OD 在内置存储库中收到的包中标记的版本。
几乎可以用了!
然而!
TC 始终构建为 Ajf.IdentityServer.1.0.0-54.nupkg 之类的文件(第 2 步,dotnet pack)。
第 2 步,dotnet pack,有一个选项 - 版本后缀 - 我当前使用的是 %build.counter%。
我希望版本形成为 1.0.0.54,而不是 1.0.0-54。
显然,OD 中没有问题(我可以部署那些格式错误的版本),但只是感觉……错误?
如何使用 TC 计算出的“正确”版本标记我的版本?
谢谢!;)
我需要用不同颜色,厚度等的线条绘制相同的图纸.
我可以创建两个PathGeometry实例,但我不能在它们上设置颜色.
我可以创建两个Path实例,但无法在控件中显示它们.
我究竟做错了什么?
谢谢你的评论!
丹麦安德斯.
下面的代码只在我的控件中显示"集合",但我认为这可能是答案的起点......
var pathFigure1 = new PathFigure(new Point(0, 0),
new List<PathSegment> {new LineSegment(new Point(10, 10), true)}, false);
var pathFigure2 = new PathFigure(new Point(20, 20),
new List<PathSegment> {new LineSegment(new Point(30, 30), true)}, false);
var g1 = new PathGeometry(new List<PathFigure> {pathFigure1});
var g2 = new PathGeometry(new List<PathFigure> {pathFigure2});
var p1 = new System.Windows.Shapes.Path
{
Data = g1,
Stroke = new SolidColorBrush(Color.FromRgb(0, 0, 0))
};
var p2 = new System.Windows.Shapes.Path
{
Data = g2,
Stroke = new SolidColorBrush(Color.FromRgb(170, …Run Code Online (Sandbox Code Playgroud) 我有一个自定义控件和一个视图模型对象.视图模型上的属性绑定到自定义控件,我可以看到自定义控件实际上从视图模型对象接收vaule - 但我的处理程序代码(GeometryText.Set)未执行.我究竟做错了什么?!
注意自定义控件上的事件处理程序我放置了断点 - 如果我改变窗口的大小,我可以检查监视窗口中的GeometryText属性 - 并且在我期望的情况下它会明显更新.
感谢您的任何意见,
丹麦安德斯
ComponentDrawing.xaml.cs
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using Rap1D.ServiceLayer.Interfaces.Services;
using StructureMap;
namespace Rap1D.Rap1D_WPF.Controls
{
/// <summary>
/// Interaction logic for ComponentDrawing.xaml
/// </summary>
public partial class ComponentDrawing
{
public static DependencyProperty GeometryTextProperty =DependencyProperty.Register("GeometryText", typeof (string), typeof (ComponentDrawing), new FrameworkPropertyMetadata
(
"",
FrameworkPropertyMetadataOptions
.
None));
private Canvas _canvas;
public ComponentDrawing()
{
InitializeComponent();
}
public string GeometryText
{
get { return ((string) GetValue(GeometryTextProperty)); }
set
{
SetValue(GeometryTextProperty, value);
ReadGeometryTextIntoDrawing(value);
}
}
private …Run Code Online (Sandbox Code Playgroud) wpf ×3
c# ×2
.net-core ×1
asp.net-mvc ×1
azure-devops ×1
c++ ×1
data-binding ×1
docker ×1
linq-to-sql ×1
mouseevent ×1
msbuild ×1
multi-select ×1
mvvm ×1
nant ×1
nunit ×1
path ×1
pathgeometry ×1
prometheus ×1
resharper ×1
teamcity ×1
version ×1