-3
Je sais que cette question a déjà été posée ici mais je ne trouve pas ce qui ne va pas avec mon code.Jeton invalide dans la classe const C#
class Slider
{
public int const DEFAULT_SIZE = 20; // Problem is here. Invalid token in class
private int rise { get; set; }
private int run { get; set; }
private int size { get; set; }
int positionX = 0;
int positionY = 0;
private int leftBoundX { get; set;}
private int leftBoundY { get; set; }
private int rightBoundX { get; set; }
private int rightBoundY { get; set; }
// Constructor
Slider()
{
size = DEFAULT_SIZE;
}
private void Bound()
{
if (positionX > leftBoundX)
positionX = rightBoundX;
else if (positionY > leftBoundY)
positionY = rightBoundY;
else if (positionX > leftBoundX)
positionX = rightBoundX;
else if (positionX > leftBoundX)
positionX = rightBoundX;
}
Je googlé des choses, on m'a dit d'inclure System.Collection et je l'ai encore, mais même erreur
S'il vous plaît notez ce que vous avez essayé et où les méthodes précédemment proposées ont échoué. –
Avez-vous essayé la chose [Google] (http://bit.ly/QXiPOo)? – Magnus