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.

URIParseForm.cs 1.7 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Text;
  7. using System.Windows.Forms;
  8. using System.Diagnostics;
  9. using Microsoft.Win32;
  10. using Shadowsocks.Controller;
  11. using Shadowsocks.Model;
  12. using Shadowsocks.Properties;
  13. namespace Shadowsocks.View
  14. {
  15. public partial class URIParseForm : Form
  16. {
  17. public bool Parsed { get; set; }
  18. public Server server;
  19. public URIParseForm()
  20. {
  21. Parsed = false;
  22. server = Configuration.GetDefaultServer();
  23. this.Font = System.Drawing.SystemFonts.MessageBoxFont;
  24. InitializeComponent();
  25. // a dirty hack
  26. this.PerformLayout();
  27. UpdateTexts();
  28. this.Icon = Icon.FromHandle(Resources.ssw128.GetHicon());
  29. }
  30. private void UpdateTexts()
  31. {
  32. this.URIParseButton.Text = I18N.GetString("&Parse");
  33. this.URIParseExit.Text = I18N.GetString("Quit");
  34. this.URILable.Text = I18N.GetString("Shadowsocks URI");
  35. this.Text = I18N.GetString("Shadowsocks URI Parse");
  36. }
  37. private void URIParseButton_Click(object sender, EventArgs e)
  38. {
  39. Parsed = Configuration.parse_uri(URITextBox.Text, ref server);
  40. if (!Parsed)
  41. server = null;
  42. this.Close();
  43. }
  44. private void URIParseExit_Click(object sender, EventArgs e)
  45. {
  46. Parsed = false;
  47. server = null;
  48. this.Close();
  49. }
  50. }
  51. }