Exemple #1
0
    public Boolean ShowLine()
    {
        Random  randomGenerator = new Random();
        int     randomInt       = randomGenerator.Next(Enum.GetNames(typeof(Symbole)).Length);
        Symbole firstObject     = (Symbole)randomInt;

        randomInt = randomGenerator.Next(Enum.GetNames(typeof(Symbole)).Length);
        Symbole secondObject = (Symbole)randomInt;

        randomInt = randomGenerator.Next(Enum.GetNames(typeof(Symbole)).Length);
        Symbole thirdObject = (Symbole)randomInt;

        string firstObjectString  = addSpacesToTextForAligment(firstObject.ToString());
        string secondObjectString = addSpacesToTextForAligment(secondObject.ToString());
        string thirdObjectString  = addSpacesToTextForAligment(thirdObject.ToString());

        Console.WriteLine(String.Format("|{0,11}|{1,11}|{2,11}|", firstObjectString, secondObjectString, thirdObjectString));
        if (firstObject == secondObject && secondObject == thirdObject)
        {
            return(true);
        }
        else
        {
            return(false);
        }
    }
    public string FunctionBody()
    {
        string result = @"";

        if (connectionType == ConnectionType.Call)
        {
            foreach (var connection in connections)
            {
                result += connection.FunctionBody();
            }
        }
        if (connectionType == ConnectionType.Receive)
        {
            result = symbole.ToString();
            if (symbole.Call)
            {
                result += "," + symbole.Call.FunctionBody();
            }
        }
        return(result);
    }