Start() public méthode

public Start ( ) : void
Résultat void
Exemple #1
0
        static void Main(string[] args)
        {
            if (!EnsureSingleLoad())
            {
                Console.WriteLine("{0}: Another Instance Currently Runing", DateTime.Now);
                return;
            }

            var streamMonitors = new List <DualStreamMonitor>();

            UsersCollection.PrimaryUsers().AsParallel()
            .ForAll(u =>
            {
                var streamMonitor = new DualStreamMonitor(u, Console.Out);
                streamMonitor.Start();

                lock (streamMonitors)
                {
                    streamMonitors.Add(streamMonitor);
                }
            });

            while (Console.ReadLine() != "exit")
            {
                ;
            }

            streamMonitors.ForEach(s => s.Stop());
        }
Exemple #2
0
        static void Main(string[] args)
        {
            if (!EnsureSingleLoad())
            {
                Console.WriteLine("{0}: Another Instance Currently Runing", DateTime.Now);
                return;
            }

            var streamMonitors = new List<DualStreamMonitor>();

            UsersCollection.PrimaryUsers().AsParallel()
                .ForAll(u =>
            {
                var streamMonitor = new DualStreamMonitor(u, Console.Out);
                streamMonitor.Start();

                lock (streamMonitors)
                {
                    streamMonitors.Add(streamMonitor);
                }
            });

            while (Console.ReadLine() != "exit") ;

            streamMonitors.ForEach(s => s.Stop());
        }
Exemple #3
0
        static void Main(string[] args)
        {
            if (!EnsureSingleLoad())
            {
                Console.WriteLine("{0}: Another Instance Currently Runing", DateTime.Now);
                return;
            }

            var streamMonitor = new DualStreamMonitor(Console.Out);
            streamMonitor.Start();

            while (Console.ReadLine() != "exit") ;
            streamMonitor.Stop();
        }
Exemple #4
0
        static void Main(string[] args)
        {
            if (!EnsureSingleLoad())
            {
                Console.WriteLine("{0}: Another Instance Currently Runing", DateTime.Now);
                return;
            }

            var streamMonitor = new DualStreamMonitor(Console.Out);

            streamMonitor.Start();

            while (Console.ReadLine() != "exit")
            {
                ;
            }
            streamMonitor.Stop();
        }
Exemple #5
0
        static void Main(string[] args)
        {
            if (!EnsureSingleLoad())
            {
                Console.WriteLine("{0}: Another Instance Currently Running", DateTime.Now);
                return;
            }

            /*
            var botClient = new BotClient(HandleBotManagerCommunication);
            botClient.Start();

            if (UsersCollection.PrimaryUser() == null)
            {
                Console.WriteLine("{0}: No Primary User Found", DateTime.Now);
                Console.Write("{0}: Waiting For PrimaryUser to be Set by BotManager", DateTime.Now);
                while (UsersCollection.PrimaryUser() == null)
                {
                    Thread.Sleep(1000);
                    Console.Write(".");
                }
                Console.WriteLine("");
                Console.WriteLine("{0}: BotManager Set PrimaryUser to be {1}", DateTime.Now, UsersCollection.PrimaryUser().TwitterScreenName);
            }
            */

            var streamMonitors = new List<DualStreamMonitor>();

            UsersCollection.PrimaryUsers().AsParallel().ForAll(u =>
            {
                var streamMonitor = new DualStreamMonitor(u, Console.Out);
                streamMonitor.Start();

                lock (streamMonitors)
                {
                    streamMonitors.Add(streamMonitor);
                }
            });

            while (Console.ReadLine() != "exit") ;
            //botClient.Stop();
            streamMonitors.ForEach(s => s.Stop());
        }