小编abe*_*nci的帖子

如何在TFS团队项目中的新文件夹下移动文件夹?

假设您有一个TFS集合,Samples其中包含一个包含Visual Studio解决方案文件的项目.

现在,您要添加一个名为的文件夹,SamplesProductA并移动其中的所有文件,而不会丢失源控制历史记录.你怎么能这样做?

谢谢.

tfs visual-studio-2010

6
推荐指数
1
解决办法
2万
查看次数

http://schemas.microsoft.com/winfx/2006/xaml/presentation定义

在Visual Studio中创建新的WpfApplication项目时,您将获得以下XAML.将URL http://schemas.microsoft.com/winfx/2006/xaml/presentation复制并粘贴到浏览器中我希望看到XSD文件定义,但是我收到错误.为什么?

谢谢.

<Window x:Class="WpfApplication1.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="350" Width="525">
  <Grid>

  </Grid>
</Window>
Run Code Online (Sandbox Code Playgroud)

.net c# wpf visual-studio-2010 wpf-controls

6
推荐指数
1
解决办法
9251
查看次数

传递接口集合

假设您有以下课程:

class Car : IPainting
{
 ...
}
Run Code Online (Sandbox Code Playgroud)

然后像这样的函数:

void AddCars(IEnumerable<Car> collection)
Run Code Online (Sandbox Code Playgroud)

然后像这样的代码片段:

Car bmw = new Car();
Car mercedes = new Car();

IPainting a = (IPainting) bmw;
IPainting b = (IPainting) mercedes;

IPainting[] paintings = new IPainting[] {a, b};

AddCars(paintings); // fails to compile
Run Code Online (Sandbox Code Playgroud)

这当然不能编译,因为AddCars()方法只接受Cars的集合,但它是'painting'数组的组成部分.

我知道C#4.0可能会为此提供解决方案.今天有没有解决方法呢?

谢谢,

阿尔贝托

c# generics collections interface

5
推荐指数
2
解决办法
1467
查看次数

Parallel.For()循环中的进度更新

你可以猜到Parallel.For()循环的索引从一个值跳转到另一个值.我如何估算完成的工作量?

谢谢.

.net parallel-extensions

5
推荐指数
1
解决办法
2005
查看次数

ASP.NET MVC3中的TempData单元测试

如何将以下类移植到ASP.NET MVC3?它是MVC的一部分:使用基于ASP.NET MVC2的TempData文章的单元测试控制器操作.RenderView()方法不再存在,并且具有不同的参数.

谢谢.

// Test-specific subclass for HomeController. This won't be
// needed in the next release of ASP.NET MVC.
private sealed class TestHomeController : HomeController {
    public RouteValueDictionary RedirectValues;
    public string RenderViewName;
    public string RenderMasterName;
    public object RenderViewData;

    protected override void RedirectToAction(RouteValueDictionary values) {
        RedirectValues = values;
    }

    protected override void RenderView(string viewName, string masterName,
        object viewData) {
        RenderViewName = viewName;
        RenderMasterName = masterName;
        RenderViewData = viewData;
    }
}
Run Code Online (Sandbox Code Playgroud)

asp.net unit-testing asp.net-mvc-3

5
推荐指数
1
解决办法
2738
查看次数

需要SharpDXElement替代品.解决方法sharpDX WPF闪烁

我有一个非常接近完成的SharpDX项目.它使用Kinect进行交互.因此,我的项目将WPF用于Kinect区域和KinectUserViewer对象.到目前为止,SharpDX已经为一切工作做得很好,然而,当它到达使用direct3D的程序的某个部分时,它开始闪烁.这显然与D3Dimage(由MainWindow.xaml中的SharpDXElement使用)可能"从根本上被破坏并且不适合WPF中的有效D3D渲染"这一事实有关[1].有没有办法保持我的WPF元素,而不是使用direct3D闪烁?

c# wpf xaml sharpdx d3dimage

5
推荐指数
1
解决办法
1949
查看次数

C#:受保护成员字段的命名规则

在我们的.NET软件组件中,我们使用以下命名约定.当客户使用我们的VB.NET DLL时,编译器无法区分distance成员字段和Distance属性.你推荐什么解决方法?

谢谢.

public class Dimension : Text
{
    private string _textPrefix;

    protected double distance;

    /// <summary>
    /// Gets the real measured distance.
    /// </summary>
    public double Distance
    {
        get { return Math.Abs(distance); }
    }
}
Run Code Online (Sandbox Code Playgroud)

.net c# naming-conventions

5
推荐指数
1
解决办法
5974
查看次数

合并params和IList <T>构造函数

有没有办法将这两个构造函数合并为一个?基本上他们接受相同的Point3D类型.

public Curve(int degree, params Point3D[] points) {} 

public Curve(int degree, IList<Point3D> points) {}
Run Code Online (Sandbox Code Playgroud)

谢谢.

.net c# constructor visual-studio

5
推荐指数
1
解决办法
106
查看次数

OOP对象创建指南

假设有一个像这样的多边形类:

public class Polygon 
{
   Point[] _vertices;

   public class Polygon(Point[] vertices)
   {
       _vertices = vertices;
   }
}
Run Code Online (Sandbox Code Playgroud)

要制作三角形,正方形,六边形,你宁愿:

  • 从Polygon继承您的Triangle,Square等类,它提供特定的构造函数并以编程方式生成点?
  • 添加一个CreateSquare返回现成的Polygon类的静态方法?

这个:

public class Square : Polygon
{
   public class Polygon(double size)
   {
       _vertices = new Point[]{ new Point(0,0), new Point(size,0), new Point(size,size), new Point(0,size)};
   }
}
Run Code Online (Sandbox Code Playgroud)

或这个:

public class Polygon 
{
    Point[] _vertices;

    public class Polygon(Point[] vertices)
    {
       _vertices = vertices;
    }

    public static Polygon CreateSquare(double size)
    {
        double verts = new Point[]{ new Point(0,0), new Point(size,0), new …
Run Code Online (Sandbox Code Playgroud)

.net c# oop

5
推荐指数
1
解决办法
175
查看次数

VStudio 2019 中缺少“合并工具中的合并更改”、“获取服务器版本”等按钮

最新的 Visual Studio 2019,合并工具 \xe2\x80\x9d、\xe2\x80\x9cTake 服务器版本\xe2\x80\x9d 等中的 \xe2\x80\x9c 合并更改按钮缺失。我们使用 Team Foundation Server 作为源代码控制。

\n\n

https://developercommunity.visualstudio.com/content/problem/499815/merge-tools-in-resolve-conflicts-not-shown.html

\n\n

我真的应该安装旧版本的 Visual Studio 还是有人找到了解决此问题的方法?

\n

c# tfs visual-studio

5
推荐指数
1
解决办法
1549
查看次数