You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

ConnectionInfo.cs 1.1 kB

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace ClickForensics.Quartz.Manager
  6. {
  7. public class ConnectionInfo
  8. {
  9. public ConnectionInfo()
  10. {
  11. }
  12. public static ConnectionInfo Parse(string connectionString)
  13. {
  14. if (connectionString == null)
  15. {
  16. return null;
  17. }
  18. string[] parameters = connectionString.Split(new string[] { "|" }, StringSplitOptions.None);
  19. if (parameters.Length != 3)
  20. {
  21. return null;
  22. }
  23. return new ConnectionInfo { ServerName = parameters[0], Port = int.Parse(parameters[1]), SchedulerName = parameters[2] };
  24. }
  25. public string ServerName { get; set; }
  26. public int Port { get; set; }
  27. public string SchedulerName { get; set; }
  28. public override string ToString()
  29. {
  30. return string.Format("{0}|{1}|{2}", ServerName, Port, SchedulerName);
  31. }
  32. }
  33. }