Show/Hide Toolbars

XSharp

Purpose

Declare a class name to the compiler.

Syntax

 [Attributes] [Modifiers]        CLASS <idClass> [FROM <idParentClass>]  [SHARING <idParentClass,...>]
 [IMPLEMENTS <idInterface>[, <IdInterface2>,..]

 [ClassMembers]

 ENDCLASS

 [CLASS] METHOD [<ClassName>:] <MethodName> [( [<Parameters,...>] )]

         [<Body>]

 

Arguments

AttributesAn optional list of one or more attributes that describe meta information for am entity, such as for example the [TestMethod] attribute on a method containing tests in a MsTest class library. Please note that Attributes must be on the same line or suffixed with a semi colon when they are written on the line above that keyword.        

 

ModifiersAn optional list of modifiers that specify the visibility or scope of the entity, allowed values are STATIC, FREEZE and FINAL

 

<idClass>A valid identifier name for the class.  A class is an entity and, as such, shares the same name space as other entities.  This means that it is not possible to have a class and a global variable, for example, with the same name.

 

FROM <idParentClass>The name of an existing class (called a superclass) from which the new class inherits methods and instance variables (with the exception of HIDDEN). X# does NOT allow multiple inheritance.

 

SHARING <idParentClass>This clause is not supported by X#.

 

IMPLEMENTS <idInterface>The name(s) of the interface(s) that this class implements

 

ClassMembersThis may be a list of variable declarations, method declarations and inline method implementations

 

[CLASS] METHODThis implements one or more methods outside of the class declaration. The CLASS keyword indicates that it is a STATIC method, as opposed to an INSTANCE method.

ClassMembers

Fields

Method Declarations

Method Implementation

 

See Also