public static void initSocketCli()
    {
        VoicenterRealtime voicenterRealtime = new VoicenterRealtime(LogLevel.Info);

        Logger.onLog += OnLogHandler;

        var values = EnumUtil.GetValues <Identity>();

        foreach (Identity val in values)
        {
            Console.WriteLine((int)val + "." + val);
        }

        Console.Write("Choose you Login Identity:");
        Lidentity = Console.ReadLine();
        var Method = typeof(VoicenterRealtime).GetMethod(((Identity)int.Parse(Lidentity)).ToString());

        PrintClassParamters(Method);

        switch ((Identity)int.Parse(Lidentity))
        {
        case Identity.Account:
        {
            socket = voicenterRealtime.Account(paramterArray[0], paramterArray[1]).Init();
            break;
        }

        case Identity.User:
        {
            socket = voicenterRealtime.User(paramterArray[0], paramterArray[1]).Init();
            break;
        }

        case Identity.Token:
            socket = voicenterRealtime.Token(paramterArray[0]).Init();
            break;

        default:
            break;
        }

        MyListener listen = new MyListener(socket);

        Console.ReadLine();
        Console.ReadLine();
    }
Beispiel #2
0
        static void Main(string[] args)
        {
            VoicenterRealtime voicenterRealtime = new VoicenterRealtime();

            //Logger
            Logger.onLog += (object sender, VoicenterRealtimeLogger e) =>
            {
                Console.WriteLine(e.message);
            };
            //

            //Listener
            VoicenterRealtimeListener socket = voicenterRealtime.Token("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx").Init();

            socket.OnEvent += OnEventHandler;
            socket.Listen();

            Console.ReadLine();
        }