Ejemplo n.º 1
0
        public void StartCreator(int threads)
        {
            _threadManager.StopAll();

            for (int i = 0; i < threads; i++)
            {
                _threadManager.CreateThread(CreateDot);
            }

            _threadManager.StartAll();
        }
Ejemplo n.º 2
0
 public bool CreateThread(string name, Guid?creatorID)
 {
     try
     {
         IThreadManager m = ThreadManagerFactory.ThreadManager();
         return(m.CreateThread(name, creatorID));
     }
     catch (Exception ex)
     {
         throw new FaultException(ex.Message + "\n" + ex.StackTrace);
     }
 }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            IThreadManager m = ThreadManagerFactory.ThreadManager();

            m.CreateThread("Test Thread", null);

            //IForumUnitOfWork uow = ForumUOWFactory.ForumUnitOfWork();
            //uow.UserRepository.Create(new User { Username = "******" });
            //uow.SaveChanges();
            ////uow.PostRepository.Create(new Post { Content = "Hello!!" });
            ////uow.SaveChanges();

            //List<Post> posts = uow.PostRepository.All().ToList();

            //foreach(Post p in posts)
            //{
            //    Console.WriteLine(p.Content);
            //}


            //Console.ReadLine();


            //ServiceReference1.Service1Client client = new ServiceReference1.Service1Client();

            //ShowPosts(client.GetPosts().ToList());

            //string input = Console.ReadLine();

            //while (input != "exit")
            //{

            ////    bool added =client.AddPost(input);

            //    if(added)
            //    {
            //        ShowPosts(client.GetPosts().ToList());
            //    }
            //    input = Console.ReadLine();
            //}
        }
Ejemplo n.º 4
0
 public void StartDrawing()
 {
     _threadManager.CreateThread(DoWorker);
     _threadManager.StartAll();
 }
Ejemplo n.º 5
0
 private void ExecuteAssemblyWithArguments(IFunctionName moduleFunction, byte[] arguments, bool waitForThreadExit)
 {
     _threadManager.CreateThread(moduleFunction.Module, moduleFunction.Function, arguments, waitForThreadExit);
 }