1Oct/110
Code Issues specific to partial methods
There are several conditions that are applied to partial methods, such as:
Partial methods must be void
Signatures of both parts of partial methods must match
Access modifiers are not allowed for partial methods
Partial methods must be declared in partial classes
etc
You don’t have to remember all these conditions if you have the CodeRush code issues feature turned on. When the rule of the partial method declaration is violated, code issues will show you an error or a hint, and you can fix it before you compile the code. These code issues are:
Partial method cannot have access modifiers or the virtual, abstract, override, new, sealed, or extern modifiers
If a partial method has an invalid modifier (e.g., virtual, abstract, override, new, sealed, extern, or an access modifier) you will see an error in the code editor, because partial methods cannot have these type of modifiers:
CodeRush Partial method cannot have modifiers
CodeRush Partial method cannot have access modifiers
Partial method cannot have out parameters
Out parameters are not allowed for partial methods. If a partial method is declared with ‘out’ parameters, you will see an error:
CodeRush Partial method cannot have out parameters
Partial method must be declared within a partial class or partial struct
Partial methods can only reside inside a partial class or a partial structure, otherwise, an error is shown:
CodeRush Partial method must be declared within a partial class
Partial method has only single part
When the partial method has only a single part without a declaration, it does not need to be declared as partial. This code issue has a hint type:
CodeRush Partial method has only single part
2May/100
Explain the concepts of CTS and CLS(Common Language Specification).
CTS
When different languages are integrated and want to communicate, it is certain that the languages have their own data types and different declaration styles. CTS define how these different variables are declared and used in run time. E.g. VB offers an Integer data type while C++ offers long data type. Using CTS, these data types are converted to System32 which itself a data type of CLS.
CLS
Any language(s) that intend to use the Common Language Infrastructure needs to communicate with other CLS-Compliant language. This communication is based on set of rules laid by CLS. These rules define a subset of CTS.