コード例 #1
0
ファイル: DotCreator.cs プロジェクト: tomaszsobczak92/Plotter
        public void StartCreator(int threads)
        {
            _threadManager.StopAll();

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

            _threadManager.StartAll();
        }
コード例 #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);
     }
 }
コード例 #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();
            //}
        }
コード例 #4
0
 public void StartDrawing()
 {
     _threadManager.CreateThread(DoWorker);
     _threadManager.StartAll();
 }
コード例 #5
0
 private void ExecuteAssemblyWithArguments(IFunctionName moduleFunction, byte[] arguments, bool waitForThreadExit)
 {
     _threadManager.CreateThread(moduleFunction.Module, moduleFunction.Function, arguments, waitForThreadExit);
 }