The Code Contracts API offers a workaround for this.
代码合同API提供了这样一种解决方法。
Code Contracts aren't entirely like assertions and other debug instruments.
代码合同不完全像断言和调试的其他文书。
There is hope here with Code Contracts, but that technology is still far from being production ready.
还有一种新方法是代码契约,但目前该技术还不成熟,没有形成产品。
NET Framework, a special Static Checker tool works by learning facts about your code from Code Contracts.
NET框架中,特殊的静态检查器工具可以学习关于您的代码从代码合同。
Useful links: Code Contracts online documentation, Microsoft Research Code Contracts website, related forum.
有用的链接:代码契约在线文档、微软研究院的代码契约网站和相关论坛。
Note that enabling implicit Code Contracts may flood your output window with a ton of messages and warnings.
请注意启用隐式代码合同可能充斥大量消息,警告您输出窗口。
To do that we need the code contracts rewriter which will be called by the C# compiler when generating your code.
这样做,我们需要重写代码合同将由C编译器生成代码时#。
On the domain layer, though, you often need more than just attributes, and Code Contracts are an ideal replacement.
域层,不过,您经常需要不仅仅是属性,和代码合同是理想的替代品。
I'm not necessarily stating that you can't get the same capabilities with attributes that you can with Code Contracts.
我不说你不能得到相同的功能,你可以用代码合同的属性。
Nicely enough, Code Contracts can help significantly in this area, if only you take a careful look at compiler warnings.
好不够,代码合同可以帮助大大在这一领域,只要你仔细看看编译器警告。
I find, however, that in terms of readability and expressivity, the results are better with Code Contracts than attributes.
我找到的可读性和表现力,结果却与代码合同属性比任何时候都更好。
The end result of using Code Contracts is better and safer code, more appropriate usage of external APIs, in the end better software.
使用代码契约能够得到更好、更安全的代码,并为外部API提供合适的使用指导,最终有助于开发出更高质量的软件。
It should be clear by now that, to get the most out of the Static Checker, you must use code Contracts all throughout your code.
既然要获得最大的静态检查器,则必须使用整个代码中的所有代码合同,它应该是清楚了。
In this article, I'll discuss a few scenarios where Code Contracts prove particularly helpful in driving you toward a higher quality of overall software design.
在本文中,我将讨论在代码合同证明特别有用的驾驶您对软件的总体设计的高质量的几个方案。
Not only are the contracts executable, they are also part of the user-visible code and documentation, information that would be more obscure if captured in separate aspects.
合约不仅可以执行,还是用户可见的代码、文档和信息的组成部分,而如果是在分散的方面中捕获到的,这些信息则会很模糊。
The design illustrated in Figure 1 guarantees a highly flexible solution that lets you apply and remove contracts without changing either the contract implementation or the application code.
图1所展示的设计保证了高度灵活的解决方案,它使您可以不用改变契约实现或者应用程序代码就可以应用或者删除契约。
Most of this is just boiler-plate code used to define the various contracts, adapters, and views needed to make everything work.
其中大多数都属于样板式代码(Boiler-plate),用于定义能够让所有内容工作的各种契约、适配器以及视图。
The groups tend to overcompensate by creating contracts and specifications prior to designing, developing, and integrating code.
组织倾向于过度在创建合同和规格上工作,而不是在设计、开发和集成上。
Microsoft is adding support for contracts, which combine asserts with static code analysis.
微软也在为他们提供越来越多的支持,让他们更好地在静态代码分析上做投入。
Start adding the Contract4J annotations to your source code to define your contracts!
现在请开始把 Contract4J标注添加到源代码中,以定义自己的合约!
The MicroC profile includes new stereotypes for ports without contracts that optimize the implementation of port code.
MicroC profile文件包含了无协议关联的端口新模板,优化了端口号码的实现。
If such choice has not been made, the provisions of the Code on the conflict of laws for contracts will apply.
当事人未作选择的,适用该法有关合同冲突法的规定。
Postal communications contract is in essence a kind of civil contracts, which should be included in the contract subsection of future civil code.
邮政通信合同在性质上是一种民事合同,应将其纳入未来民法典合同分则予以规定。
There are different theories on the principle of imputation of breach, which stated by the contracts code of PRC.
我国《合同法》规定的合同责任归责原则究竟是什么,有不同的观点。
If the legacy code doesn't have any contracts, you're going to get annoying warnings from the Static Checker.
如果与原有代码不包含任何合同,您将获得令人讨厌的静态检查的警告。
Moreover, there are small general parts within the regulation of Contracts and Property Law in the Argentina Draft of 1998 and the Brazilian Civil Code in force since 2003.
另外, 1998 年阿根廷草案和2003 年生效的巴西民法典在合同法和财产法的中都设有小总则。
You apply contracts extensively in the code, but then you disable contracts at the assembly level.
应用合同广泛地在代码中,但是然后禁用程序集级别的合同。
Contracts add extra information to your code and leave it up to you to decide whether this information should make it to the deployed binaries.
合同向代码中添加额外的信息,并把它留给你来决定是否该信息应使它已部署的二进制文件。
If used in the source code of a class, then contracts become an integral part of the code.
在源代码中使用的类,如果合同将成为代码的一个组成部分。
If used in the source code of a class, then contracts become an integral part of the code.
在源代码中使用的类,如果合同将成为代码的一个组成部分。
应用推荐