FxCop 10抱怨以下几点:
using XYZ.Blah; //CA1709 - "XYZ"
using Xyz.Blah; //No complaint.
using XylophoneSuperDuperLongFullName.Blah; //I don't want to have a long full name for my company name.
问题是。我希望我的公司名称全部大写,因为XYZ是一个缩写。该名称的长版本太长,不是一个有用的名称空间。微软之所以能逃过这一劫,是因为他们的缩写只有2个字母。
using MS.Something; //
我正在用C#创建一个基于的应用程序。我的窗体的构造函数接受参数string title,然后将该值保存到string this.Title属性,最后创建一个标签为Label this.Title的窗口。
问题很明显:我的Label和string具有相同的名称,我对C#中的命名约定很好奇。我该怎么办?
下面是完整的代码:
// BNForm.cs
public partial class BNForm : Form
{
public string Title;
public BNForm(string title)
{
this.Title = titl
我已经在F#库中声明了一些数据类型,我希望从C#代码中填充这些类型。我遇到的问题是,只有DU的get作为类“导出”,请考虑这个示例文件Test.fs:
module Test
type SimpleType = string
type SimpleList = string list
type SimpleDU =
| A
| B
type SimpleRecord = { Text : string }
一开始,当引用F#项目不允许我在C#中使用SimpleType和SimpleList类型时,我感到困惑。我查看了使用ILDasm生成的ILDasm库,只找到Sim
我刚刚为C#中的一个简单的数据包侦察创建了一个github存储库。这是我第一次使用C# (新轴3D引擎逻辑除外),因为我更熟悉C#。下面是我想改进的代码的主要部分。您可以看到所有的代码这里。如果你有任何建议,请分享。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using S
一个简短的缩写词类似于ID或DB,它只有2个字符。
当pascal大小写(属性或类名)和驼峰大小写(输入参数,参数)时如何命名?
我知道每家公司都有自己的标准,但我正在寻找一个更普遍接受的标准。
例如,当pascal大小写:
ProductID or ProductId?
IDOfProduct or IdOfProduct?
DBRate or DbRate?
RateOfDB or RateOfDb?
当驼峰壳出现时:
productID or productId?
idOfProduct?
dbRate?
rateOfDb or rateOfDB?
我有一个F#库,我在其中定义了一个模块。在模块内部,定义了两种类型。我是从C#项目访问这个库的(目前它只是一个测试项目,不过这可能并不重要)。
我可以从C#访问其中一种类型,但另一种类型不可用。
下面是我的F#代码:
module Stock
open FSharp.Data
open InstrumentQueryBuilder
type Stock = CsvProvider<"..\prototype_historical_data.csv">
type StockData(symbol) =
member this.Symbol = symb