小编Mat*_* M.的帖子

将Git与Visual Source Safe 6.0一起使用

对不起,这个可怕的,可怕的问题..但是我没办法不使用VSS.

我希望能够在使用Visual Source Safe 6时在本地使用Git进行分支开发等.我对Git的所有细节的了解目前是有限的,因为我是最近的转换.

问题:
我希望能够在Git存储库中工作.我想这样做,并获得所有这些将允许分支等的好东西.在我的一天结束时,或在其他需要的时刻,我希望能够采取我正在做的任何工作并放置它进入主存储库,然后我将其放入VSS.

理想情况下,在工作日的开始我会得到VSS最新版本..将此提交给Git ..然后在备用分支上工作,当需要提交VSS时将更改重新置于主数据库中.

因为我是一个相对git新手,可能是实现这一目标的最佳方式..以及发布/设置此方法的最佳命令.

*注意:Source Safe需要检查文件,然后才能对其进行更改.也许有一些工具/脚本我可以用来帮助自动化这个以将更改推回VSS?

git visual-sourcesafe

30
推荐指数
1
解决办法
5561
查看次数

有没有办法拖放到两个visual studio 2008实例之间复制文件?

有没有办法在两个Visual Studio 2008实例之间复制文件?插件,设置还是其他什么?目前,将文件从一个实例拖动到另一个实例不会执行任何操作(鼠标显示它是无效操作).

右键单击文件并从实例1中选择"复制",并在实例2中粘贴会导致以下错误:

在此解决方案中找不到此操作的源文件.

任何想法或解决方案?

visual-studio-2008

28
推荐指数
3
解决办法
9332
查看次数

如何设置具有多个值的ExportMetaData以及单个w/custom属性?

我在我的类上设置了以下ExportMetaData属性:

  [Export(typeof(IDocumentViewer))]
  [ExportMetadata("Name", "MyViewer")]
  [ExportMetadata("SupportsEditing", true)]
  [ExportMetadata("Formats", DocFormat.DOC, IsMultiple = true)]
  [ExportMetadata("Formats", DocFormat.DOCX, IsMultiple = true)]
  [ExportMetadata("Formats", DocFormat.RTF, IsMultiple = true)]  
Run Code Online (Sandbox Code Playgroud)

我也有一个支持界面:

  public interface IDocumentViewerMetaData {
    /// <summary>
    /// Gets the format.
    /// </summary>
    /// <value>The format.</value>
    IEnumerable<DocFormat> Formats { get; }
    /// <summary>
    /// Gets the name of the viewer
    /// </summary>
    /// <value>The name.</value>
    string Name { get; }
    /// <summary>
    /// Gets a value indicating whether this viewer supports editing
    /// </summary>
    /// <value><c>true</c> if [supports editing]; …
Run Code Online (Sandbox Code Playgroud)

c# mef interface

13
推荐指数
1
解决办法
4410
查看次数

C#使用Dynamic关键字通过字符串访问属性而不进行反射

我想写类似以下内容:

//  I will pass in a number of "properties" specified as strings that I want modified
string[] properties = new [] { "AllowEdit", "AllowDelete" };

//  Casting the component I'm using to a dynamic object of some sort ?
dynamic d = myGridComponent;

//  Iterate over the strings and set the properties
foreach(var s in properties) 
{
  //d.s = true; // 
  //d[s] = true; // this format would be ideal
}
Run Code Online (Sandbox Code Playgroud)

我在想,如果有一个简单的方法来做到这一点,而无需使用反射[ .GetProperty(...).GetValue(...,...)使用新的C#4.0关键字]: dynamic.

似乎可能有某种方式,......我只是不确定确切的机制,并且无法找到合适的资源来将所有部分组合在一起.

想法?

[编辑]看起来有一个名为"Clay"的包以某种方式实现了这种类型的功能. …

c# dynamic dynamic-keyword

12
推荐指数
1
解决办法
4527
查看次数

LINQ to SQL:针对订购系统的多个表的报告的汇总数据的复杂查询

我想将以下查询转换为LINQ语法.我在设法让它发挥作用方面遇到了很多麻烦.我实际上尝试从LINQ开始,但发现如果我以相反的方式编写它,我可能会有更好的运气.

SELECT
    pmt.guid,
    pmt.sku,
    pmt.name,
    opt.color,
    opt.size,
    SUM(opt.qty) AS qtySold,
    SUM(opt.qty * opt.itemprice) AS totalSales,
    COUNT(omt.guid) AS betweenOrders
FROM
    products_mainTable pmt 
        LEFT OUTER JOIN 
            orders_productsTable opt ON opt.products_mainTableGUID = pmt.guid
            LEFT OUTER JOIN orders_mainTable omt ON omt.guid = opt.orders_mainTableGUID AND
                (omt.flags & 1) = 1
GROUP BY
    pmt.sku, opt.color, opt.size, pmt.guid, pmt.name
ORDER BY
    pmt.sku
Run Code Online (Sandbox Code Playgroud)

最终结果是一个表格,向您显示有关产品的信息,如上所示.如何使用理解语法以LINQ格式编写此查询?

另外,我可能想要添加其他过滤器(例如,对orders_mainTable).

这是我尝试工作的一个例子,并且非常接近但不确定它是否是"正确"方式,并且无法按照orders_productsTable的大小和颜色对其进行分组.

from pmt in products_mainTable
let Purchases = 
        from opt in pmt.orders_productsTable
        where ((opt.orders_mainTable.flags & 1) == 1)
        where ((opt.orders_mainTable.date_completedon > Convert.ToDateTime("01/01/2009 00:00:00"))) …
Run Code Online (Sandbox Code Playgroud)

c# linq grouping aggregate-functions linq-to-sql

8
推荐指数
2
解决办法
8464
查看次数

通过Web服务在自定义对象中序列化名称/值对

这是一个非常复杂的问题,涉及如何在数据不是强类型时通过Web服务调用序列化数据.我会尝试尽可能地将它列出来.

样本存储对象:

[Serializable]
public class StorageObject {
  public string Name { get; set; }
  public string Birthday { get; set; }
  public List<NameValuePairs> OtherInfo { get; set; }  
}
[Serializable]   
public class NameValuePairs {
  public string Name { get; set; }
  public string Value { get; set; }
}
Run Code Online (Sandbox Code Playgroud)

样品使用:

[WebMethod]
    public List<StorageObject> GetStorageObjects() {
      List<StorageObject> o = new List<StorageObject>() {
        new StorageObject() { 
          Name = "Matthew",
          Birthday = "Jan 1st, 2008", 
          OtherInfo = new List<NameValuePairs>() {
            new NameValuePairs() { …
Run Code Online (Sandbox Code Playgroud)

php c# serialization web-services class-design

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

C#实体FrameWork MySQL慢查询计数()

我遇到了MySQL和Entity Framework 4.0的严重问题.我已将表格放到EF Designer表面上,一切似乎都没问题.但是,当我以下列方式执行查询时:

using(entityContext dc = new entityContext()) {
  int numRows = dc.myTable.Count();
}
Run Code Online (Sandbox Code Playgroud)

生成的查询看起来像这样:

SELECT `GroupBy1`.`A1` AS `C1`
FROM   (SELECT Count(1) AS `A1`
        FROM   (SELECT `pricing table`.`a`,
                       `pricing table`.`b`,
                       `pricing table`.`c`,
                       `pricing table`.`d`,
                       `pricing table`.`e`,
                       `pricing table`.`f`,
                       `pricing table`.`g`,
                       `pricing table`.`h`,
                       `pricing table`.`i`
                FROM   `pricing table` AS `pricing table`) AS `Extent1`) AS `GroupBy1`
Run Code Online (Sandbox Code Playgroud)

显而易见,这是一个令人难以置信的未经优化的查询.它正在选择每一行!这不是最佳的,我甚至不可能在此时使用MySQL + EF.

我已经尝试了MySQL 6.3.1 [安装很有趣]和DevArt的dotConnect for MySQL,两者都产生了相同的结果.这张表有150万条记录......需要6-11秒才能执行!

我究竟做错了什么 ?有没有办法优化这个[和其他查询]来生成合理的代码,如:

SELECT COUNT(*) FROM table
Run Code Online (Sandbox Code Playgroud)

使用SQLServer生成相同的查询几乎没有时间,并生成合理的代码.

救命!

编辑:我还想指出,我切换到DevArt dotConnect MySQL LINQ to SQL驱动程序,并使用L2S over EF快1000000倍.这也包括查询. …

c# mysql entity-framework

7
推荐指数
1
解决办法
1846
查看次数