disable broken tests on net_4_0
[mcs.git] / docs / ecma334 / 17.5.7.xml
blobbee8b4b7c31f259e819dee0718e57203f7f647d2
1 <?xml version="1.0"?>
2 <clause number="17.5.7" title="External methods">
3   <paragraph>When a method declaration includes an extern modifier, the method is said to be an external method. External methods are implemented externally, typically using a language other than C#. Because an external method declaration provides no actual implementation, the <non_terminal where="17.5">method-body</non_terminal> of an external method simply consists of a semicolon. </paragraph>
4   <paragraph>The mechanism by which linkage to an external method is achieved, is implementation-defined. </paragraph>
5   <paragraph>
6     <example>[Example: The following example demonstrates the use of the extern modifier in combination with a DllImport attribute that specifies the name of the external library in which the method is implemented: <code_example><![CDATA[
7 using System.Text;  
8 using System.Security.Permissions;  
9 using System.Runtime.InteropServices;  
10 class Path  
11 {  
12    [DllImport("kernel32", SetLastError=true)]  
13    static extern bool CreateDirectory(string name, SecurityAttribute sa);  
14    [DllImport("kernel32", SetLastError=true)]  
15    static extern bool RemoveDirectory(string name);  
16    [DllImport("kernel32", SetLastError=true)]  
17    static extern int GetCurrentDirectory(int bufSize, StringBuilder buf);  
18    [DllImport("kernel32", SetLastError=true)]  
19    static extern bool SetCurrentDirectory(string name);  
20 }  
21 ]]></code_example>end example]</example>
22   </paragraph>
23 </clause>