Program.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using NHibernate.Cfg;
  7. using NHibernate.Tool.hbm2ddl;
  8. using TaskDatabase.Model;
  9. using TaskDatabase;
  10. using NettyClient;
  11. using System.Threading;
  12. using Client;
  13. namespace Test
  14. {
  15. class Program
  16. {
  17. static void Main(string[] args)
  18. {
  19. //cfg.AddAssembly(typeof(TaskModel).Assembly);
  20. testMain();
  21. //testClientInfo();
  22. }
  23. public static void test1() {
  24. var cfg = new Configuration();
  25. cfg.Configure();
  26. cfg.AddAssembly(typeof(TaskModel).Assembly);
  27. //new SchemaExport(cfg).Execute(false, true, false, false);
  28. new SchemaExport(cfg).Execute(true, true, false);
  29. }
  30. public static void select()
  31. {
  32. var cfg = new Configuration();
  33. cfg.Configure();
  34. TaskService service = new TaskService();
  35. IList<TaskModel> tasks = service.GetTasksByStatus(0);
  36. }
  37. public static void testMain() {
  38. ClientApp client = new ClientApp("127.0.0.1", 6666, "E:\\", 3, new myRevitCmdExecutor(), 5);
  39. client.Start();
  40. Console.ReadLine();
  41. client.Close();
  42. }
  43. public static void testClientInfo() {
  44. string ipv4 = ClientInfoUtil.GetClientLocalIPv4Address();
  45. string mac = ClientInfoUtil.GetMacAddress();
  46. string userName = ClientInfoUtil.GetUserName();
  47. }
  48. }
  49. public class myRevitCmdExecutor : IRevitCommandExcutor
  50. {
  51. public string ExecuteCmd(string revitCmd, string param, HashSet<string> filePathList)
  52. {
  53. return "{abcdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd}";
  54. }
  55. }
  56. }