随笔分类 - C#&dotNet开发
摘要:INTELLISENSE FOR OVERRIDESIn VS2008, you have IntelliSense support for implementing overrides. If you’re in a derived class and type public override and then type a space, IntelliSense will appe...
阅读全文
摘要:The primary purpose of partial types is to support in separating machine-generated code from the code you work with. For example, VS2008 ASP.NET and Windows Forms project and item wizards create skele...
阅读全文
摘要:To know the future of C#, look at The Future of C#To know the future ofprogramming, look at Microsoft Perspectives on the Future ofProgramming有一点小小的认识:从C#的版本发展来看,每个版本都增加了新特性。增加的新特性大体上是为了:C#1.0, 2.0:集中...
阅读全文
摘要:The pattern of properties encapsulating a single field is so common that C# 3.0 introduced auto-implemented properties. Here’s an example:public int Rating { get; set; }This Rating property enca...
阅读全文
摘要:readonly fields are similar to constant fields in that they can’t be modified after initialization. The biggest difference between the two is when they’re initialized: Constants areinitial...
阅读全文
摘要:因为新项目将主要用到CSharp,并同时会涉及Mix programming的问题,与Native C++ and C++ CLI (common language infrastructure),今天迅速的google下,做些初步了解先。现在的理解:1. 这里说的mix programming的意思应该是:让CSharp的module,Native C++ module和C++ CLI的modu...
阅读全文
摘要:Snippet is so convenient to use in C#!I need to get the way / list of getting snippets in C# later on really!Now give a good example of using snippet to write switch:enum Months { Jan, Feb, Mar, Apr, ...
阅读全文
摘要:ARRAYS ARE REFERENCE TYPESAn array is a reference type object. Therefore, assigning one array to another just makes the variable assigned to contain an identical reference to the same object inmemory.
阅读全文
摘要:In C#, content regards with string includes:1. String typeIts features: a. built-in reference type. b. immutable (meaning that a string can’t be modified once created) and sealed (meaning that...
阅读全文
摘要:This problem, not being able to assign null to value types, was alleviated in C# 2.0 with the introduction of a feature called nullable types. It essentially allows you to declarenullable value types ...
阅读全文
摘要:C# Aliases and the CTSC# types are specified with keywords that alias .NET CLR types. Table 4.1 shows all the .NET types and which C# keywords alias them.
阅读全文
摘要:1. Class is reference type while Struct is value type.2. Referece type data will be allocated on the heap always, while value type data will be either on the stack as local variable for example or on ...
阅读全文
摘要:We should know boxing and unboxing clearly. But what's the actual performance affect happened in that process? Below diagram can give a overview:A boxing process will bring in two copies of the same d...
阅读全文
摘要:Labels are program elements that simply identify a location in a program. Their only practical use is to support the goto statement. The goto statement allows program control tojump to the place where...
阅读全文
摘要:C# provides two operators: CHECKED/UNCHECKED to handle whether to treat the overflow/underflow as system error or ignore it. By default, this option is unchecked. As an alternative, you can set this a...
阅读全文
摘要:Logical OperatorsLogical operators perform Boolean logic on two expressions. There are three types of logical operators in C#: bitwise, Boolean, and conditional.The bitwise logical operators perform B...
阅读全文
摘要:The tradeoff between decimal and double is precision versus range. The decimal is the best choice when precision is required, but choose a double for the greatest range. The decimaltype is well suited...
阅读全文
摘要:there are three types of commenting syntax in C#:multiline, single line, and XML.XML Documentation CommentsIn addition to providing code commenting, an XML documentation comment supports tools that ex...
阅读全文
摘要:On the Debug menu, there are two options to run a program, Start Debugging (F5) and Start Without Debugging (Ctrl+F5). The differences between these two options are thatStart Debugging stops on breakp...
阅读全文

浙公网安备 33010602011771号