MainForm.cs 63 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Configuration;
  5. using System.Diagnostics;
  6. using System.Drawing;
  7. using System.IO;
  8. using System.Net;
  9. using System.Reflection;
  10. using System.Threading;
  11. using System.Web;
  12. using System.Windows.Forms;
  13. using CefSharp;
  14. using CefSharp.Event;
  15. using CefSharp.WinForms;
  16. using FarsiLibrary.Win;
  17. using prBrowser.Properties;
  18. using prBrowser.Weblogic;
  19. using System.Xml.Linq;
  20. using prBrowserUpdate;
  21. namespace prBrowser
  22. {
  23. internal class MainForm : Form
  24. {
  25. private string appPath = Path.GetDirectoryName(Application.ExecutablePath) + "\\";
  26. public static MainForm Instance;
  27. public static string Branding = "prBrowser";
  28. public static string UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.1.360.0 Safari/537.36";
  29. //public static string AcceptLanguage = "en-US,en;q=0.9";
  30. public static string AcceptLanguage = "zh-CN,zh;q=0.9,en;q=0.8";
  31. public string HomepageURL = ConfigurationManager.AppSettings["DefaultUrl"];
  32. public string NewTabURL = ConfigurationManager.AppSettings["DefaultUrl"];
  33. public static string InternalURL = "prBrowser";
  34. public static string DownloadsURL = "prBrowser://storage/downloads.html";
  35. public static string FileNotFoundURL = "prBrowser://storage/errors/notFound.html";
  36. public static string CannotConnectURL = "prBrowser://storage/errors/cannotConnect.html";
  37. public static string SearchURL = "https://www.baidu.com/s?ie=utf-8&f=8&rsv_bp=1&rsv_idx=1&tn=baidu&wd=";
  38. public bool WebSecurity = true;
  39. public bool CrossDomainSecurity = true;
  40. public bool WebGL = true;
  41. public bool ApplicationCache = true;
  42. public static Assembly assembly = null;
  43. private FATabStripItem newStrip;
  44. private FATabStripItem downloadsStrip;
  45. private string currentFullURL;
  46. private string currentCleanURL;
  47. private string currentTitle;
  48. private int currentZoom;
  49. public HostHandler host;
  50. private DownloadHandler dHandler;
  51. private ContextMenuHandler mHandler;
  52. private LifeSpanHandler lHandler;
  53. private KeyboardHandler kHandler;
  54. private RequestHandler rHandler;
  55. public Dictionary<int, DownloadItem> downloads;
  56. public Dictionary<int, string> downloadNames;
  57. public List<int> downloadCancelRequests;
  58. private bool searchOpen = false;
  59. private string lastSearch = "";
  60. private IContainer components = null;
  61. private FATabStrip TabPages;
  62. private FATabStripItem tabStrip1;
  63. private FATabStripItem tabStripAdd;
  64. private System.Windows.Forms.Timer timer1;
  65. private ContextMenuStrip menuStripTab;
  66. private ToolStripMenuItem menuCloseTab;
  67. private ToolStripMenuItem menuCloseOtherTabs;
  68. private Button BtnForward;
  69. private Button BtnBack;
  70. private Button BtnStop;
  71. private Button BtnRefresh;
  72. private Button BtnDownloads;
  73. private TextBox TxtURL;
  74. private Panel PanelToolbar;
  75. private Panel PanelStatus;
  76. private Panel PanelSearch;
  77. private TextBox TxtSearch;
  78. private Button BtnCloseSearch;
  79. private Button BtnPrevSearch;
  80. private Button BtnNextSearch;
  81. private Button BtnSettings;
  82. private ContextMenuStrip settingMenuStrip;
  83. private ToolStripMenuItem toolStripMenuItemDevTool;
  84. private ToolStripMenuItem toolStripMenuItemViewSource;
  85. private ToolStripMenuItem toolStripMenuItemDelCache;
  86. private ToolStripSeparator toolStripSeparator3;
  87. private ToolStripMenuItem toolStripMenuItemMinus;
  88. private ToolStripTextBox toolStripTextBoxZoom;
  89. private ToolStripMenuItem toolStripMenuItemAdd;
  90. private ToolStripMenuItem toolStripMenuItemResume;
  91. private ToolStripMenuItem toolStripMenuItemFullScreen;
  92. private ToolStripSeparator toolStripSeparator4;
  93. private ToolStripMenuItem toolStripMenuItemExit;
  94. private ToolStripMenuItem toolStripMenuItemServer;
  95. private ToolStripMenuItem toolStripMenuItemUpdate;
  96. //QY 此处定义更新窗体,可直接访问更新程序及其方法
  97. prBrowserUpdate.MainForm updateMain = new prBrowserUpdate.MainForm();
  98. private int CurIndex
  99. {
  100. get
  101. {
  102. return TabPages.Items.IndexOf(TabPages.SelectedItem);
  103. }
  104. set
  105. {
  106. TabPages.SelectedItem = TabPages.Items[value];
  107. }
  108. }
  109. private int LastIndex => TabPages.Items.Count - 2;
  110. public ChromiumWebBrowser CurBrowser
  111. {
  112. get
  113. {
  114. if (TabPages.SelectedItem != null && TabPages.SelectedItem.Tag != null)
  115. {
  116. return ((SharpTab)TabPages.SelectedItem.Tag).Browser;
  117. }
  118. return null;
  119. }
  120. }
  121. public SharpTab CurTab
  122. {
  123. get
  124. {
  125. if (TabPages.SelectedItem != null && TabPages.SelectedItem.Tag != null)
  126. {
  127. return (SharpTab)TabPages.SelectedItem.Tag;
  128. }
  129. return null;
  130. }
  131. }
  132. public int CurTabLoadingDur
  133. {
  134. get
  135. {
  136. if (TabPages.SelectedItem != null && TabPages.SelectedItem.Tag != null)
  137. {
  138. return (int)(DateTime.Now - CurTab.DateCreated).TotalMilliseconds;
  139. }
  140. return 0;
  141. }
  142. }
  143. public List<int> CancelRequests => downloadCancelRequests;
  144. public Dictionary<int, DownloadItem> Downloads => downloads;
  145. public MainForm()
  146. {
  147. try
  148. {
  149. checkServerUrl();
  150. InitCache();
  151. Instance = this;
  152. InitializeComponent();
  153. //QY
  154. //doUpdate();
  155. InitBrowser();
  156. SetFormTitle(null);
  157. //string AutoUpdate = ConfigurationManager.AppSettings["AutoUpdate"];
  158. //if (AutoUpdate == "Y")
  159. //{
  160. //doUpdate();
  161. //}
  162. }
  163. catch (Exception ex)
  164. {
  165. MessageBox.Show(ex.Message);
  166. Application.Exit();
  167. //QY 完全退出程序,Application.Exit()无效
  168. //System.Environment.Exit(0);
  169. }
  170. }
  171. /// <summary>
  172. /// 主窗体加载事件
  173. /// </summary>
  174. /// <param name="sender"></param>
  175. /// <param name="e"></param>
  176. private void MainForm_Load(object sender, EventArgs e)
  177. {
  178. InitTooltips(base.Controls);
  179. InitHotkeys();
  180. }
  181. private void InitAppIcon()
  182. {
  183. assembly = Assembly.GetAssembly(typeof(MainForm));
  184. base.Icon = new Icon(GetResourceStream("prBrowser.ico"), new Size(64, 64));
  185. }
  186. public Stream GetResourceStream(string filename, bool withNamespace = true)
  187. {
  188. try
  189. {
  190. return assembly.GetManifestResourceStream("prBrowser.Resources." + filename);
  191. }
  192. catch
  193. {
  194. }
  195. return null;
  196. }
  197. /// <summary>
  198. /// 加载热键列表
  199. /// </summary>
  200. private void InitHotkeys()
  201. {
  202. KeyboardHandler.AddHotKey(this, CloseActiveTab, Keys.W, ctrl: true);
  203. KeyboardHandler.AddHotKey(this, CloseActiveTab, Keys.Escape, ctrl: true);
  204. KeyboardHandler.AddHotKey(this, AddBlankWindow, Keys.N, ctrl: true);
  205. KeyboardHandler.AddHotKey(this, AddBlankTab, Keys.T, ctrl: true);
  206. KeyboardHandler.AddHotKey(this, RefreshActiveTab, Keys.F5);
  207. KeyboardHandler.AddHotKey(this, OpenDeveloperTools, Keys.F12);
  208. KeyboardHandler.AddHotKey(this, NextTab, Keys.Tab, ctrl: true);
  209. KeyboardHandler.AddHotKey(this, PrevTab, Keys.Tab, ctrl: true, shift: true);
  210. KeyboardHandler.AddHotKey(this, MinusZoom, Keys.OemMinus, ctrl: true);
  211. KeyboardHandler.AddHotKey(this, PlusZoom, Keys.Oemplus, ctrl: true);
  212. KeyboardHandler.AddHotKey(this, FullScreen, Keys.F11);
  213. KeyboardHandler.AddHotKey(this, OpenSearch, Keys.F, ctrl: true);
  214. KeyboardHandler.AddHotKey(this, CloseSearch, Keys.Escape);
  215. KeyboardHandler.AddHotKey(this, StopActiveTab, Keys.Escape);
  216. }
  217. public void InitTooltips(Control.ControlCollection parent)
  218. {
  219. foreach (Control ui in parent)
  220. {
  221. Button btn = ui as Button;
  222. if (btn != null && btn.Tag != null)
  223. {
  224. ToolTip tip = new ToolTip();
  225. int num3 = (tip.ReshowDelay = (tip.InitialDelay = 200));
  226. tip.ShowAlways = true;
  227. tip.SetToolTip(btn, btn.Tag.ToString());
  228. }
  229. Panel panel = ui as Panel;
  230. if (panel != null)
  231. {
  232. InitTooltips(panel.Controls);
  233. }
  234. }
  235. }
  236. private string getXMLValue(string path, string attr)
  237. {
  238. string xmlValue = "";
  239. XDocument document = XDocument.Load(path);
  240. XElement root = document.Root;
  241. XElement settingEle = root.Element("appSettings");
  242. IEnumerable<XElement> enumerable = settingEle.Elements();
  243. foreach (XElement item in enumerable)
  244. {
  245. if (item.Attribute("key").Value == attr)
  246. {
  247. xmlValue = item.Attribute("value").Value;
  248. }
  249. }
  250. return xmlValue;
  251. }
  252. /// <summary>
  253. /// 载入浏览器
  254. /// </summary>
  255. private void InitBrowser()
  256. {
  257. HomepageURL = ConfigurationManager.AppSettings["DefaultUrl"];
  258. NewTabURL = ConfigurationManager.AppSettings["DefaultUrl"];
  259. currentZoom = 100;
  260. try
  261. {
  262. currentZoom = Convert.ToInt32(getXMLValue("prBrowser.exe.config", "DefaultZoom"));
  263. }
  264. catch (Exception ex)
  265. {
  266. currentZoom = 100; //设置页面分辨率为100
  267. }
  268. if (currentZoom == 0) currentZoom = 100; //设置页面分辨率为100
  269. CefSharpSettings.LegacyJavascriptBindingEnabled = true;
  270. CefSharpSettings.WcfEnabled = false;
  271. CefSettings settings = new CefSettings(); //QY 运行时此处存在则异常
  272. settings.RegisterScheme(new CefCustomScheme
  273. {
  274. SchemeName = InternalURL,
  275. SchemeHandlerFactory = new SchemeHandlerFactory()
  276. });
  277. Cef.EnableHighDPISupport();
  278. string insecureUrl = ConfigurationManager.AppSettings["InsecureUrl"];
  279. settings.Locale = "zh-CN";
  280. settings.CefCommandLineArgs.Add("--enable-npapi", "1");
  281. settings.CefCommandLineArgs.Add("--disable-web-security", "1");
  282. settings.CefCommandLineArgs.Remove("enable-system-flash");
  283. settings.CefCommandLineArgs.Add("enable-system-flash", "1");
  284. settings.CefCommandLineArgs.Add("enable-media-stream", "1");
  285. settings.CefCommandLineArgs.Add("enable-speech-input", "1");
  286. settings.CefCommandLineArgs.Add("no-proxy-server", "1");
  287. settings.CefCommandLineArgs.Add("--unsafely-treat-insecure-origin-as-secure", insecureUrl);
  288. settings.CefCommandLineArgs.Add("--use-system-default-printer", "1");
  289. settings.CefCommandLineArgs.Add("-enable-print-preview", "1");
  290. settings.CefCommandLineArgs.Add("ppapi-flash-version", "32.0.0.321");
  291. settings.CefCommandLineArgs.Add("ppapi-flash-path", AppDomain.CurrentDomain.BaseDirectory + "pepflashplayer.dll");
  292. settings.UserAgent = UserAgent;
  293. settings.AcceptLanguageList = AcceptLanguage;
  294. settings.IgnoreCertificateErrors = true;
  295. settings.CachePath = GetAppDir("Cache");
  296. settings.EnablePrintPreview();
  297. Cef.Initialize(settings);
  298. dHandler = new DownloadHandler(this);
  299. lHandler = new LifeSpanHandler(this);
  300. mHandler = new ContextMenuHandler(this);
  301. kHandler = new KeyboardHandler(this);
  302. rHandler = new RequestHandler(this);
  303. InitDownloads();
  304. host = new HostHandler(this);
  305. AddNewBrowser(tabStrip1, HomepageURL);
  306. initBrowserZoom();
  307. }
  308. private void ConfigureBrowser(ChromiumWebBrowser browser)
  309. {
  310. BrowserSettings config = new BrowserSettings();
  311. config.FileAccessFromFileUrls = (!CrossDomainSecurity).ToCefState();
  312. config.UniversalAccessFromFileUrls = (!CrossDomainSecurity).ToCefState();
  313. config.WebSecurity = WebSecurity.ToCefState();
  314. config.WebGl = WebGL.ToCefState();
  315. config.ApplicationCache = ApplicationCache.ToCefState();
  316. browser.BrowserSettings = config;
  317. }
  318. private static string GetAppDir(string name)
  319. {
  320. string appPath = Path.GetDirectoryName(Application.ExecutablePath) + "\\";
  321. return appPath + name + "\\";
  322. }
  323. private void LoadURL(string url)
  324. {
  325. string newUrl = url;
  326. string urlLower = url.Trim().ToLower();
  327. SetTabTitle(CurBrowser, "加载中...");
  328. if (urlLower == "localhost")
  329. {
  330. newUrl = "http://localhost/";
  331. }
  332. else if (url.CheckIfFilePath() || url.CheckIfFilePath2())
  333. {
  334. newUrl = url.PathToURL();
  335. }
  336. else
  337. {
  338. Uri.TryCreate(url, UriKind.Absolute, out var outUri);
  339. if (!urlLower.StartsWith("http") && !urlLower.StartsWith(InternalURL) && (outUri == null || outUri.Scheme != Uri.UriSchemeFile))
  340. {
  341. newUrl = "http://" + url;
  342. }
  343. if (!urlLower.StartsWith(InternalURL + ":") && (!Uri.TryCreate(newUrl, UriKind.Absolute, out outUri) || (((!(outUri.Scheme == Uri.UriSchemeHttp) && !(outUri.Scheme == Uri.UriSchemeHttps)) || !newUrl.Contains(".")) && !(outUri.Scheme == Uri.UriSchemeFile))))
  344. {
  345. newUrl = SearchURL + HttpUtility.UrlEncode(url);
  346. }
  347. }
  348. CurBrowser.Load(newUrl);
  349. SetFormURL(newUrl);
  350. EnableBackButton(canGoBack: true);
  351. EnableForwardButton(canGoForward: false);
  352. }
  353. private void SetFormTitle(string tabName)
  354. {
  355. if (tabName.CheckIfValid())
  356. {
  357. Text = tabName + " - " + Branding;
  358. currentTitle = tabName;
  359. }
  360. else
  361. {
  362. Text = Branding;
  363. currentTitle = "新标签";
  364. }
  365. }
  366. private void SetFormURL(string URL)
  367. {
  368. currentFullURL = URL;
  369. currentCleanURL = URL;
  370. TxtURL.Text = currentCleanURL;
  371. CurTab.CurURL = currentFullURL;
  372. CloseSearch();
  373. }
  374. private string CleanURL(string url)
  375. {
  376. if (url.BeginsWith("about:"))
  377. {
  378. return "";
  379. }
  380. url = url.RemovePrefix("http://");
  381. url = url.RemovePrefix("https://");
  382. url = url.RemovePrefix("file://");
  383. url = url.RemovePrefix("/");
  384. return url.DecodeURL();
  385. }
  386. private bool IsBlank(string url)
  387. {
  388. return url == "" || url == "about:blank";
  389. }
  390. private bool IsBlankOrSystem(string url)
  391. {
  392. return url == "" || url.BeginsWith("about:") || url.BeginsWith("chrome:") || url.BeginsWith(InternalURL + ":");
  393. }
  394. public void AddBlankWindow()
  395. {
  396. ProcessStartInfo info = new ProcessStartInfo(Application.ExecutablePath, "");
  397. info.LoadUserProfile = true;
  398. info.UseShellExecute = false;
  399. info.RedirectStandardError = true;
  400. info.RedirectStandardOutput = true;
  401. info.RedirectStandardInput = true;
  402. Process.Start(info);
  403. }
  404. public void AddBlankTab()
  405. {
  406. AddNewBrowserTab("");
  407. this.InvokeOnParent(delegate
  408. {
  409. TxtURL.Focus();
  410. });
  411. }
  412. /// <summary>
  413. /// 新增浏览器标签
  414. /// </summary>
  415. /// <param name="url">标签地址</param>
  416. /// <param name="focusNewTab"></param>
  417. /// <param name="refererUrl"></param>
  418. /// <returns></returns>
  419. public ChromiumWebBrowser AddNewBrowserTab(string url, bool focusNewTab = true, string refererUrl = null)
  420. {
  421. return (ChromiumWebBrowser)Invoke((Func<ChromiumWebBrowser>)delegate
  422. {
  423. foreach (FATabStripItem fATabStripItem in TabPages.Items)
  424. {
  425. SharpTab sharpTab = (SharpTab)fATabStripItem.Tag;
  426. if (sharpTab != null && sharpTab.CurURL == url)
  427. {
  428. TabPages.SelectedItem = fATabStripItem;
  429. return sharpTab.Browser;
  430. }
  431. }
  432. FATabStripItem item = new FATabStripItem
  433. {
  434. Title = "新标签"
  435. };
  436. TabPages.Items.Insert(TabPages.Items.Count - 1, item);
  437. newStrip = item;
  438. SharpTab sharpTab2 = AddNewBrowser(newStrip, url);
  439. sharpTab2.RefererURL = refererUrl;
  440. if (focusNewTab)
  441. {
  442. timer1.Enabled = true;
  443. }
  444. return sharpTab2.Browser;
  445. });
  446. }
  447. /// <summary>
  448. /// 新增浏览器窗体
  449. /// </summary>
  450. /// <param name="tabStrip"></param>
  451. /// <param name="url"></param>
  452. /// <returns></returns>
  453. private SharpTab AddNewBrowser(FATabStripItem tabStrip, string url)
  454. {
  455. if (url == "")
  456. {
  457. url = NewTabURL;
  458. }
  459. ChromiumWebBrowser browser = new ChromiumWebBrowser(url);
  460. ConfigureBrowser(browser);
  461. browser.Dock = DockStyle.Fill;
  462. tabStrip.Controls.Add(browser);
  463. browser.BringToFront();
  464. browser.StatusMessage += Browser_StatusMessage;
  465. browser.LoadingStateChanged += Browser_LoadingStateChanged;
  466. browser.TitleChanged += Browser_TitleChanged;
  467. browser.LoadError += Browser_LoadError;
  468. browser.AddressChanged += Browser_URLChanged;
  469. browser.DownloadHandler = dHandler;
  470. browser.MenuHandler = mHandler;
  471. browser.LifeSpanHandler = lHandler;
  472. browser.KeyboardHandler = kHandler;
  473. browser.RequestHandler = rHandler;
  474. SharpTab tab = (SharpTab)(tabStrip.Tag = new SharpTab
  475. {
  476. IsOpen = true,
  477. Browser = browser,
  478. Tab = tabStrip,
  479. OrigURL = url,
  480. CurURL = url,
  481. Title = "新标签",
  482. DateCreated = DateTime.Now
  483. });
  484. if (url.StartsWith(InternalURL + ":"))
  485. {
  486. browser.JavascriptObjectRepository.Register("host", host, isAsync: true, BindingOptions.DefaultBinder);
  487. }
  488. else
  489. {
  490. browser.JavascriptObjectRepository.ResolveObject += delegate (object s, JavascriptBindingEventArgs eve)
  491. {
  492. IJavascriptObjectRepository objectRepository = eve.ObjectRepository;
  493. if (eve.ObjectName == "xysCefToJavaScripts")
  494. {
  495. objectRepository.Register("xysCefToJavaScripts", new BrowserToJavaScript(browser, this), isAsync: true, BindingOptions.DefaultBinder);
  496. }
  497. };
  498. }
  499. return tab;
  500. }
  501. public SharpTab GetTabByBrowser(IWebBrowser browser)
  502. {
  503. foreach (FATabStripItem tab2 in TabPages.Items)
  504. {
  505. SharpTab tab = (SharpTab)tab2.Tag;
  506. if (tab != null && tab.Browser == browser)
  507. {
  508. return tab;
  509. }
  510. }
  511. return null;
  512. }
  513. public void RefreshActiveTab()
  514. {
  515. CurBrowser.Load(CurBrowser.Address);
  516. firstCalculateZoom(currentZoom);
  517. }
  518. /// <summary>
  519. /// 关闭标签页
  520. /// </summary>
  521. public void CloseActiveTab()
  522. {
  523. if (CurTab != null && TabPages.Items.Count > 2)
  524. {
  525. int index = TabPages.Items.IndexOf(TabPages.SelectedItem);
  526. TabPages.RemoveTab(TabPages.SelectedItem);
  527. if (TabPages.Items.Count - 1 > index)
  528. {
  529. TabPages.SelectedItem = TabPages.Items[index];
  530. }
  531. return;
  532. }
  533. if (DownloadsInProgress() && MessageBox.Show("有下载任务是否关闭?", "确认关闭", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
  534. {
  535. foreach (TabPage tab2 in TabPages.Items)
  536. {
  537. ChromiumWebBrowser browser2 = (ChromiumWebBrowser)tab2.Controls[0];
  538. browser2.Dispose();
  539. Application.Exit();
  540. }
  541. return;
  542. }
  543. try
  544. {
  545. foreach (TabPage tab in TabPages.Items)
  546. {
  547. ChromiumWebBrowser browser = (ChromiumWebBrowser)tab.Controls[0];
  548. browser.Dispose();
  549. Application.Exit();
  550. }
  551. }
  552. catch
  553. {
  554. Application.Exit();
  555. }
  556. }
  557. private void OnTabClosed(object sender, EventArgs e)
  558. {
  559. }
  560. private void OnTabClosing(TabStripItemClosingEventArgs e)
  561. {
  562. if (CurTab == null)
  563. {
  564. e.Cancel = true;
  565. }
  566. else if (TabPages.Items.Count <= 2)
  567. {
  568. AddBlankTab();
  569. }
  570. }
  571. private void StopActiveTab()
  572. {
  573. CurBrowser.Stop();
  574. }
  575. private bool IsOnFirstTab()
  576. {
  577. return TabPages.SelectedItem == TabPages.Items[0];
  578. }
  579. private bool IsOnLastTab()
  580. {
  581. return TabPages.SelectedItem == TabPages.Items[TabPages.Items.Count - 2];
  582. }
  583. private void NextTab()
  584. {
  585. if (IsOnLastTab())
  586. {
  587. CurIndex = 0;
  588. }
  589. else
  590. {
  591. CurIndex++;
  592. }
  593. }
  594. private void PrevTab()
  595. {
  596. if (IsOnFirstTab())
  597. {
  598. CurIndex = LastIndex;
  599. }
  600. else
  601. {
  602. CurIndex--;
  603. }
  604. }
  605. /// <summary>
  606. /// 浏览器地址变更
  607. /// </summary>
  608. /// <param name="sender"></param>
  609. /// <param name="e"></param>
  610. private void Browser_URLChanged(object sender, AddressChangedEventArgs e)
  611. {
  612. InvokeIfNeeded(delegate
  613. {
  614. if (sender == CurBrowser)
  615. {
  616. if (!Utils.IsFocussed(TxtURL))
  617. {
  618. SetFormURL(e.Address);
  619. }
  620. EnableBackButton(CurBrowser.CanGoBack);
  621. EnableForwardButton(CurBrowser.CanGoForward);
  622. SetTabTitle((ChromiumWebBrowser)sender, "加载中...");
  623. BtnRefresh.Visible = false;
  624. BtnStop.Visible = true;
  625. CurTab.DateCreated = DateTime.Now;
  626. float divisor = currentZoom;
  627. float beDivisor = 100;
  628. float curZoomPecent = (divisor - beDivisor) / 25;
  629. CurBrowser.SetZoomLevel(curZoomPecent);
  630. }
  631. });
  632. }
  633. private void Browser_LoadError(object sender, LoadErrorEventArgs e)
  634. {
  635. }
  636. private void Browser_TitleChanged(object sender, TitleChangedEventArgs e)
  637. {
  638. InvokeIfNeeded(delegate
  639. {
  640. ChromiumWebBrowser browser = (ChromiumWebBrowser)sender;
  641. SetTabTitle(browser, e.Title);
  642. });
  643. }
  644. private void SetTabTitle(ChromiumWebBrowser browser, string text)
  645. {
  646. text = text.Trim();
  647. if (IsBlank(text))
  648. {
  649. text = "新标签";
  650. }
  651. browser.Tag = text;
  652. FATabStripItem tabStrip = (FATabStripItem)browser.Parent;
  653. if (tabStrip != null)
  654. {
  655. tabStrip.Title = text;
  656. }
  657. if (browser == CurBrowser)
  658. {
  659. SetFormTitle(text);
  660. }
  661. }
  662. private void Browser_LoadingStateChanged(object sender, LoadingStateChangedEventArgs e)
  663. {
  664. if (sender != CurBrowser)
  665. {
  666. return;
  667. }
  668. EnableBackButton(e.CanGoBack);
  669. EnableForwardButton(e.CanGoForward);
  670. if (!e.IsLoading)
  671. {
  672. InvokeIfNeeded(delegate
  673. {
  674. BtnRefresh.Visible = true;
  675. BtnStop.Visible = false;
  676. });
  677. }
  678. }
  679. public void InvokeIfNeeded(Action action)
  680. {
  681. if (base.InvokeRequired)
  682. {
  683. BeginInvoke(action);
  684. }
  685. else
  686. {
  687. action();
  688. }
  689. }
  690. private void Browser_StatusMessage(object sender, StatusMessageEventArgs e)
  691. {
  692. }
  693. public void WaitForBrowserToInitialize(ChromiumWebBrowser browser)
  694. {
  695. while (!browser.IsBrowserInitialized)
  696. {
  697. Thread.Sleep(100);
  698. }
  699. }
  700. private void EnableBackButton(bool canGoBack)
  701. {
  702. InvokeIfNeeded(delegate
  703. {
  704. BtnBack.Enabled = canGoBack;
  705. });
  706. }
  707. private void EnableForwardButton(bool canGoForward)
  708. {
  709. InvokeIfNeeded(delegate
  710. {
  711. BtnForward.Enabled = canGoForward;
  712. });
  713. }
  714. private void OnTabsChanged(TabStripItemChangedEventArgs e)
  715. {
  716. ChromiumWebBrowser browser = null;
  717. try
  718. {
  719. browser = (ChromiumWebBrowser)e.Item.Controls[0];
  720. }
  721. catch
  722. {
  723. }
  724. if (e.ChangeType == FATabStripItemChangeTypes.SelectionChanged)
  725. {
  726. if (TabPages.SelectedItem == tabStripAdd)
  727. {
  728. AddBlankTab();
  729. }
  730. else
  731. {
  732. browser = CurBrowser;
  733. SetFormURL(browser.Address);
  734. SetFormTitle(browser.Tag.ConvertToString() ?? "新标签");
  735. EnableBackButton(browser.CanGoBack);
  736. EnableForwardButton(browser.CanGoForward);
  737. }
  738. }
  739. if (e.ChangeType == FATabStripItemChangeTypes.Removed)
  740. {
  741. if (e.Item == downloadsStrip)
  742. {
  743. downloadsStrip = null;
  744. }
  745. browser?.Dispose();
  746. }
  747. if (e.ChangeType == FATabStripItemChangeTypes.Changed && browser != null && currentFullURL != "about:blank")
  748. {
  749. browser.Focus();
  750. }
  751. }
  752. private void timer1_Tick(object sender, EventArgs e)
  753. {
  754. TabPages.SelectedItem = newStrip;
  755. timer1.Enabled = false;
  756. }
  757. private void menuCloseTab_Click(object sender, EventArgs e)
  758. {
  759. CloseActiveTab();
  760. }
  761. private void menuCloseOtherTabs_Click(object sender, EventArgs e)
  762. {
  763. List<FATabStripItem> listToClose = new List<FATabStripItem>();
  764. foreach (FATabStripItem tab2 in TabPages.Items)
  765. {
  766. if (tab2 != tabStripAdd && tab2 != TabPages.SelectedItem)
  767. {
  768. listToClose.Add(tab2);
  769. }
  770. }
  771. foreach (FATabStripItem tab in listToClose)
  772. {
  773. TabPages.RemoveTab(tab);
  774. }
  775. }
  776. private void bBack_Click(object sender, EventArgs e)
  777. {
  778. CurBrowser.Back();
  779. }
  780. private void bForward_Click(object sender, EventArgs e)
  781. {
  782. CurBrowser.Forward();
  783. }
  784. private void txtUrl_TextChanged(object sender, EventArgs e)
  785. {
  786. }
  787. private void bDownloads_Click(object sender, EventArgs e)
  788. {
  789. AddNewBrowserTab(DownloadsURL);
  790. }
  791. private void bRefresh_Click(object sender, EventArgs e)
  792. {
  793. RefreshActiveTab();
  794. }
  795. private void bStop_Click(object sender, EventArgs e)
  796. {
  797. StopActiveTab();
  798. }
  799. private void TxtURL_KeyDown(object sender, KeyEventArgs e)
  800. {
  801. if (e.IsHotkey(Keys.Return) || e.IsHotkey(Keys.Return, ctrl: true))
  802. {
  803. LoadURL(TxtURL.Text);
  804. e.Handled = true;
  805. e.SuppressKeyPress = true;
  806. Focus();
  807. }
  808. if (e.IsHotkey(Keys.C, ctrl: true) && Utils.IsFullySelected(TxtURL))
  809. {
  810. Clipboard.SetText(CurBrowser.Address, TextDataFormat.UnicodeText);
  811. e.Handled = true;
  812. e.SuppressKeyPress = true;
  813. }
  814. }
  815. private void txtUrl_Click(object sender, EventArgs e)
  816. {
  817. if (!Utils.HasSelection(TxtURL))
  818. {
  819. TxtURL.SelectAll();
  820. }
  821. }
  822. private void OpenDeveloperTools()
  823. {
  824. CurBrowser.ShowDevTools();
  825. }
  826. private void tabPages_MouseClick(object sender, MouseEventArgs e)
  827. {
  828. }
  829. private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
  830. {
  831. if (DownloadsInProgress() && MessageBox.Show("有下载任务是否关闭?", "确认关闭", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
  832. {
  833. e.Cancel = true;
  834. foreach (TabPage tab2 in TabPages.Items)
  835. {
  836. ChromiumWebBrowser browser2 = (ChromiumWebBrowser)tab2.Controls[0];
  837. browser2.Dispose();
  838. }
  839. return;
  840. }
  841. try
  842. {
  843. foreach (TabPage tab in TabPages.Items)
  844. {
  845. ChromiumWebBrowser browser = (ChromiumWebBrowser)tab.Controls[0];
  846. browser.Dispose();
  847. }
  848. }
  849. catch
  850. {
  851. }
  852. }
  853. private void InitDownloads()
  854. {
  855. downloads = new Dictionary<int, DownloadItem>();
  856. downloadNames = new Dictionary<int, string>();
  857. downloadCancelRequests = new List<int>();
  858. }
  859. public void UpdateDownloadItem(DownloadItem item)
  860. {
  861. lock (downloads)
  862. {
  863. if (item.SuggestedFileName != "")
  864. {
  865. downloadNames[item.Id] = item.SuggestedFileName;
  866. }
  867. if (item.SuggestedFileName == "" && downloadNames.ContainsKey(item.Id))
  868. {
  869. item.SuggestedFileName = downloadNames[item.Id];
  870. }
  871. downloads[item.Id] = item;
  872. }
  873. }
  874. public string CalcDownloadPath(DownloadItem item)
  875. {
  876. return item.SuggestedFileName;
  877. }
  878. public bool DownloadsInProgress()
  879. {
  880. foreach (DownloadItem item in downloads.Values)
  881. {
  882. if (item.IsInProgress)
  883. {
  884. return true;
  885. }
  886. }
  887. return false;
  888. }
  889. private void btnDownloads_Click(object sender, EventArgs e)
  890. {
  891. OpenDownloadsTab();
  892. }
  893. public void OpenDownloadsTab()
  894. {
  895. if (downloadsStrip != null && ((ChromiumWebBrowser)downloadsStrip.Controls[0]).Address == DownloadsURL)
  896. {
  897. TabPages.SelectedItem = downloadsStrip;
  898. return;
  899. }
  900. ChromiumWebBrowser brw = AddNewBrowserTab(DownloadsURL);
  901. downloadsStrip = (FATabStripItem)brw.Parent;
  902. }
  903. private void OpenSearch()
  904. {
  905. if (!searchOpen)
  906. {
  907. searchOpen = true;
  908. InvokeIfNeeded(delegate
  909. {
  910. PanelSearch.Visible = true;
  911. TxtSearch.Text = lastSearch;
  912. TxtSearch.Focus();
  913. TxtSearch.SelectAll();
  914. });
  915. }
  916. else
  917. {
  918. InvokeIfNeeded(delegate
  919. {
  920. TxtSearch.Focus();
  921. TxtSearch.SelectAll();
  922. });
  923. }
  924. }
  925. private void CloseSearch()
  926. {
  927. if (searchOpen)
  928. {
  929. searchOpen = false;
  930. InvokeIfNeeded(delegate
  931. {
  932. PanelSearch.Visible = false;
  933. CurBrowser.GetBrowser().StopFinding(clearSelection: true);
  934. });
  935. }
  936. }
  937. private void BtnClearSearch_Click(object sender, EventArgs e)
  938. {
  939. CloseSearch();
  940. }
  941. private void BtnPrevSearch_Click(object sender, EventArgs e)
  942. {
  943. FindTextOnPage(next: false);
  944. }
  945. private void BtnNextSearch_Click(object sender, EventArgs e)
  946. {
  947. FindTextOnPage();
  948. }
  949. private void FindTextOnPage(bool next = true)
  950. {
  951. bool first = lastSearch != TxtSearch.Text;
  952. lastSearch = TxtSearch.Text;
  953. if (lastSearch.CheckIfValid())
  954. {
  955. CurBrowser.GetBrowser().Find(0, lastSearch, forward: true, matchCase: false, !first);
  956. }
  957. else
  958. {
  959. CurBrowser.GetBrowser().StopFinding(clearSelection: true);
  960. }
  961. TxtSearch.Focus();
  962. }
  963. private void TxtSearch_TextChanged(object sender, EventArgs e)
  964. {
  965. FindTextOnPage();
  966. }
  967. private void TxtSearch_KeyDown(object sender, KeyEventArgs e)
  968. {
  969. if (e.IsHotkey(Keys.Return))
  970. {
  971. FindTextOnPage();
  972. }
  973. if (e.IsHotkey(Keys.Return, ctrl: true) || e.IsHotkey(Keys.Return, ctrl: false, shift: true))
  974. {
  975. FindTextOnPage(next: false);
  976. }
  977. }
  978. public void InitCache()
  979. {
  980. string cachePath = GetAppDir("Cache");
  981. if (Directory.Exists(cachePath))
  982. {
  983. Directory.Delete(cachePath, recursive: true);
  984. }
  985. }
  986. private void toolStripMenuItemDevTool_Click(object sender, EventArgs e)
  987. {
  988. OpenDeveloperTools();
  989. }
  990. private void toolStripMenuItemViewSource_Click(object sender, EventArgs e)
  991. {
  992. CurBrowser.ViewSource();
  993. }
  994. private void toolStripMenuItemDelCache_Click(object sender, EventArgs e)
  995. {
  996. Application.Exit();
  997. }
  998. private void initBrowserZoom()
  999. {
  1000. toolStripTextBoxZoom.Text = currentZoom.ToString();
  1001. //firstCalculateZoom(currentZoom);
  1002. }
  1003. private void toolStripMenuItemMinus_Click(object sender, EventArgs e)
  1004. {
  1005. MinusZoom();
  1006. }
  1007. private void toolStripMenuItemAdd_Click(object sender, EventArgs e)
  1008. {
  1009. PlusZoom();
  1010. }
  1011. private void toolStripMenuItemResume_Click(object sender, EventArgs e)
  1012. {
  1013. ResumeZoom();
  1014. }
  1015. public void MinusZoom()
  1016. {
  1017. calculateZoom("MINUS", 0);
  1018. }
  1019. public void PlusZoom()
  1020. {
  1021. calculateZoom("PLUS", 500);
  1022. }
  1023. public void ResumeZoom()
  1024. {
  1025. calculateZoom("RESUME", 100);
  1026. }
  1027. public void FullScreen()
  1028. {
  1029. string borderStyle = Instance.FormBorderStyle.ToString();
  1030. if (borderStyle == "Sizable")
  1031. {
  1032. Instance.FormBorderStyle = FormBorderStyle.None;
  1033. }
  1034. else
  1035. {
  1036. Instance.FormBorderStyle = FormBorderStyle.Sizable;
  1037. }
  1038. }
  1039. public void firstCalculateZoom(int defaultZoom)
  1040. {
  1041. toolStripTextBoxZoom.Text = defaultZoom.ToString();
  1042. float divisor = defaultZoom;
  1043. float beDivisor = 100f;
  1044. float curZoomPecent = (divisor - beDivisor) / 25f;
  1045. CurBrowser.SetZoomLevel(curZoomPecent);
  1046. currentZoom = defaultZoom;
  1047. }
  1048. public void calculateZoom(string type, int limitNum)
  1049. {
  1050. if (!(type != "RESUME") || currentZoom != limitNum)
  1051. {
  1052. if (type == "MINUS")
  1053. {
  1054. currentZoom -= 5;
  1055. }
  1056. if (type == "PLUS")
  1057. {
  1058. currentZoom += 5;
  1059. }
  1060. if (type == "RESUME")
  1061. {
  1062. currentZoom = 100;
  1063. }
  1064. toolStripTextBoxZoom.Text = currentZoom.ToString();
  1065. float divisor = currentZoom;
  1066. float beDivisor = 100f;
  1067. float curZoomPecent = (divisor - beDivisor) / 25f;
  1068. CurBrowser.SetZoomLevel(curZoomPecent);
  1069. if (type != "RESUME")
  1070. {
  1071. settingMenuStrip.Show();
  1072. }
  1073. }
  1074. }
  1075. private void toolStripMenuItemExit_Click(object sender, EventArgs e)
  1076. {
  1077. Application.Exit();
  1078. }
  1079. private void toolStripMenuItemFullScreen_Click(object sender, EventArgs e)
  1080. {
  1081. FullScreen();
  1082. }
  1083. private void BtnSettings_Click(object sender, EventArgs e)
  1084. {
  1085. settingMenuStrip.Show(sender as Button, (sender as Button).PointToClient(Cursor.Position), ToolStripDropDownDirection.BelowLeft);
  1086. }
  1087. private void settingMenuStrip_MouseLeave(object sender, EventArgs e)
  1088. {
  1089. settingMenuStrip.Hide();
  1090. }
  1091. private void toolStripMenuItemServer_Click(object sender, EventArgs e)
  1092. {
  1093. panelServerSetting serverSetting = new panelServerSetting();
  1094. serverSetting.ShowDialog();
  1095. }
  1096. private void checkServerUrl()
  1097. {
  1098. string DefaultUrl = ConfigurationManager.AppSettings["DefaultUrl"];
  1099. string InsecureUrl = ConfigurationManager.AppSettings["InsecureUrl"];
  1100. panelServerSetting serverSetting = new panelServerSetting();
  1101. if (!UrlIsExist(DefaultUrl))
  1102. {
  1103. serverSetting.ShowDialog();
  1104. HomepageURL = ConfigurationManager.AppSettings["DefaultUrl"];
  1105. NewTabURL = ConfigurationManager.AppSettings["DefaultUrl"];
  1106. }
  1107. }
  1108. private bool UrlIsExist(string url)
  1109. {
  1110. Uri u = null;
  1111. try
  1112. {
  1113. u = new Uri(url);
  1114. }
  1115. catch
  1116. {
  1117. return false;
  1118. }
  1119. bool isExist = false;
  1120. HttpWebRequest request = WebRequest.Create(u) as HttpWebRequest;
  1121. request.Method = "HEAD";
  1122. try
  1123. {
  1124. HttpWebResponse response = request.GetResponse() as HttpWebResponse;
  1125. if (response.StatusCode == HttpStatusCode.OK)
  1126. {
  1127. isExist = true;
  1128. }
  1129. }
  1130. catch (WebException ex)
  1131. {
  1132. try
  1133. {
  1134. isExist = (ex.Response as HttpWebResponse).StatusCode != HttpStatusCode.NotFound;
  1135. }
  1136. catch
  1137. {
  1138. isExist = ex.Status == WebExceptionStatus.Success;
  1139. }
  1140. }
  1141. return isExist;
  1142. }
  1143. private void toolStripMenuItemUpdate_Click(object sender, EventArgs e)
  1144. {
  1145. doUpdate();
  1146. }
  1147. private void doUpdate()
  1148. {
  1149. FTPHelper ftpObj = new FTPHelper();
  1150. int checkFlag = ftpObj.CheckUpdate();
  1151. if (checkFlag == 1)
  1152. {
  1153. if (MessageBox.Show("发现更新,是否更新?", "更新消息", MessageBoxButtons.OKCancel) == DialogResult.OK)
  1154. {
  1155. //ftpObj.ExecuteAsAdmin("prBrowserUpdate.exe");
  1156. //Environment.Exit(0);
  1157. //QY 调用更新程序
  1158. updateMain.Show();
  1159. }
  1160. }
  1161. else
  1162. {
  1163. MessageBox.Show("已是最新版,无需更新!");
  1164. }
  1165. }
  1166. protected override void Dispose(bool disposing)
  1167. {
  1168. if (disposing && components != null)
  1169. {
  1170. components.Dispose();
  1171. }
  1172. base.Dispose(disposing);
  1173. }
  1174. private void InitializeComponent()
  1175. {
  1176. components = new System.ComponentModel.Container();
  1177. System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(prBrowser.MainForm));
  1178. menuStripTab = new System.Windows.Forms.ContextMenuStrip(components);
  1179. menuCloseTab = new System.Windows.Forms.ToolStripMenuItem();
  1180. menuCloseOtherTabs = new System.Windows.Forms.ToolStripMenuItem();
  1181. timer1 = new System.Windows.Forms.Timer(components);
  1182. TxtURL = new System.Windows.Forms.TextBox();
  1183. PanelToolbar = new System.Windows.Forms.Panel();
  1184. BtnSettings = new System.Windows.Forms.Button();
  1185. BtnRefresh = new System.Windows.Forms.Button();
  1186. BtnDownloads = new System.Windows.Forms.Button();
  1187. BtnStop = new System.Windows.Forms.Button();
  1188. BtnForward = new System.Windows.Forms.Button();
  1189. BtnBack = new System.Windows.Forms.Button();
  1190. settingMenuStrip = new System.Windows.Forms.ContextMenuStrip(components);
  1191. toolStripMenuItemDevTool = new System.Windows.Forms.ToolStripMenuItem();
  1192. toolStripMenuItemViewSource = new System.Windows.Forms.ToolStripMenuItem();
  1193. toolStripMenuItemDelCache = new System.Windows.Forms.ToolStripMenuItem();
  1194. toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
  1195. toolStripMenuItemMinus = new System.Windows.Forms.ToolStripMenuItem();
  1196. toolStripTextBoxZoom = new System.Windows.Forms.ToolStripTextBox();
  1197. toolStripMenuItemAdd = new System.Windows.Forms.ToolStripMenuItem();
  1198. toolStripMenuItemResume = new System.Windows.Forms.ToolStripMenuItem();
  1199. toolStripMenuItemFullScreen = new System.Windows.Forms.ToolStripMenuItem();
  1200. toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
  1201. toolStripMenuItemServer = new System.Windows.Forms.ToolStripMenuItem();
  1202. toolStripMenuItemUpdate = new System.Windows.Forms.ToolStripMenuItem();
  1203. toolStripMenuItemExit = new System.Windows.Forms.ToolStripMenuItem();
  1204. TabPages = new FarsiLibrary.Win.FATabStrip();
  1205. tabStrip1 = new FarsiLibrary.Win.FATabStripItem();
  1206. tabStripAdd = new FarsiLibrary.Win.FATabStripItem();
  1207. PanelStatus = new System.Windows.Forms.Panel();
  1208. PanelSearch = new System.Windows.Forms.Panel();
  1209. BtnNextSearch = new System.Windows.Forms.Button();
  1210. BtnPrevSearch = new System.Windows.Forms.Button();
  1211. BtnCloseSearch = new System.Windows.Forms.Button();
  1212. TxtSearch = new System.Windows.Forms.TextBox();
  1213. menuStripTab.SuspendLayout();
  1214. PanelToolbar.SuspendLayout();
  1215. settingMenuStrip.SuspendLayout();
  1216. ((System.ComponentModel.ISupportInitialize)TabPages).BeginInit();
  1217. TabPages.SuspendLayout();
  1218. PanelSearch.SuspendLayout();
  1219. SuspendLayout();
  1220. menuStripTab.Items.AddRange(new System.Windows.Forms.ToolStripItem[2] { menuCloseTab, menuCloseOtherTabs });
  1221. menuStripTab.Name = "menuStripTab";
  1222. menuStripTab.Size = new System.Drawing.Size(187, 48);
  1223. menuCloseTab.Name = "menuCloseTab";
  1224. menuCloseTab.ShortcutKeys = System.Windows.Forms.Keys.F4 | System.Windows.Forms.Keys.Control;
  1225. menuCloseTab.Size = new System.Drawing.Size(186, 22);
  1226. menuCloseTab.Text = "关闭标签页";
  1227. menuCloseTab.Click += new System.EventHandler(menuCloseTab_Click);
  1228. menuCloseOtherTabs.Name = "menuCloseOtherTabs";
  1229. menuCloseOtherTabs.Size = new System.Drawing.Size(186, 22);
  1230. menuCloseOtherTabs.Text = "关闭其他标签页";
  1231. menuCloseOtherTabs.Click += new System.EventHandler(menuCloseOtherTabs_Click);
  1232. timer1.Interval = 50;
  1233. timer1.Tick += new System.EventHandler(timer1_Tick);
  1234. TxtURL.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
  1235. TxtURL.BorderStyle = System.Windows.Forms.BorderStyle.None;
  1236. TxtURL.Font = new System.Drawing.Font("Segoe UI", 12f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
  1237. TxtURL.Location = new System.Drawing.Point(60, 5);
  1238. TxtURL.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
  1239. TxtURL.Name = "TxtURL";
  1240. TxtURL.Size = new System.Drawing.Size(757, 22);
  1241. TxtURL.TabIndex = 5;
  1242. TxtURL.Click += new System.EventHandler(txtUrl_Click);
  1243. TxtURL.TextChanged += new System.EventHandler(txtUrl_TextChanged);
  1244. TxtURL.KeyDown += new System.Windows.Forms.KeyEventHandler(TxtURL_KeyDown);
  1245. PanelToolbar.BackColor = System.Drawing.Color.White;
  1246. PanelToolbar.Controls.Add(BtnSettings);
  1247. PanelToolbar.Controls.Add(BtnRefresh);
  1248. PanelToolbar.Controls.Add(BtnDownloads);
  1249. PanelToolbar.Controls.Add(BtnStop);
  1250. PanelToolbar.Controls.Add(TxtURL);
  1251. PanelToolbar.Controls.Add(BtnForward);
  1252. PanelToolbar.Controls.Add(BtnBack);
  1253. PanelToolbar.Dock = System.Windows.Forms.DockStyle.Top;
  1254. PanelToolbar.Location = new System.Drawing.Point(0, 0);
  1255. PanelToolbar.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
  1256. PanelToolbar.Name = "PanelToolbar";
  1257. PanelToolbar.Size = new System.Drawing.Size(934, 30);
  1258. PanelToolbar.TabIndex = 6;
  1259. BtnSettings.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
  1260. BtnSettings.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
  1261. BtnSettings.ForeColor = System.Drawing.Color.White;
  1262. BtnSettings.Image = prBrowser.Properties.Resources.antd_setting_20;
  1263. BtnSettings.Location = new System.Drawing.Point(899, 0);
  1264. BtnSettings.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
  1265. BtnSettings.Name = "BtnSettings";
  1266. BtnSettings.Size = new System.Drawing.Size(32, 31);
  1267. BtnSettings.TabIndex = 6;
  1268. BtnSettings.Tag = "";
  1269. BtnSettings.UseVisualStyleBackColor = true;
  1270. BtnSettings.Click += new System.EventHandler(BtnSettings_Click);
  1271. BtnRefresh.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
  1272. BtnRefresh.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
  1273. BtnRefresh.ForeColor = System.Drawing.Color.White;
  1274. BtnRefresh.Image = prBrowser.Properties.Resources.antd_reload_20;
  1275. BtnRefresh.Location = new System.Drawing.Point(823, -1);
  1276. BtnRefresh.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
  1277. BtnRefresh.Name = "BtnRefresh";
  1278. BtnRefresh.Size = new System.Drawing.Size(35, 32);
  1279. BtnRefresh.TabIndex = 3;
  1280. BtnRefresh.Tag = "刷新";
  1281. BtnRefresh.UseVisualStyleBackColor = true;
  1282. BtnRefresh.Click += new System.EventHandler(bRefresh_Click);
  1283. BtnDownloads.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
  1284. BtnDownloads.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
  1285. BtnDownloads.ForeColor = System.Drawing.Color.White;
  1286. BtnDownloads.Image = prBrowser.Properties.Resources.antd_download_20;
  1287. BtnDownloads.Location = new System.Drawing.Point(860, 0);
  1288. BtnDownloads.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
  1289. BtnDownloads.Name = "BtnDownloads";
  1290. BtnDownloads.Size = new System.Drawing.Size(37, 30);
  1291. BtnDownloads.TabIndex = 4;
  1292. BtnDownloads.Tag = "下载";
  1293. BtnDownloads.UseVisualStyleBackColor = true;
  1294. BtnDownloads.Click += new System.EventHandler(bDownloads_Click);
  1295. BtnStop.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
  1296. BtnStop.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
  1297. BtnStop.ForeColor = System.Drawing.Color.White;
  1298. BtnStop.Image = prBrowser.Properties.Resources.antd_stop_20;
  1299. BtnStop.Location = new System.Drawing.Point(823, 0);
  1300. BtnStop.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
  1301. BtnStop.Name = "BtnStop";
  1302. BtnStop.Size = new System.Drawing.Size(34, 30);
  1303. BtnStop.TabIndex = 2;
  1304. BtnStop.Tag = "停止";
  1305. BtnStop.UseVisualStyleBackColor = true;
  1306. BtnStop.Click += new System.EventHandler(bStop_Click);
  1307. BtnForward.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
  1308. BtnForward.ForeColor = System.Drawing.Color.White;
  1309. BtnForward.Image = prBrowser.Properties.Resources.antd_right_20;
  1310. BtnForward.Location = new System.Drawing.Point(29, 0);
  1311. BtnForward.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
  1312. BtnForward.Name = "BtnForward";
  1313. BtnForward.Size = new System.Drawing.Size(25, 30);
  1314. BtnForward.TabIndex = 1;
  1315. BtnForward.Tag = "前进";
  1316. BtnForward.UseVisualStyleBackColor = true;
  1317. BtnForward.Click += new System.EventHandler(bForward_Click);
  1318. BtnBack.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
  1319. BtnBack.ForeColor = System.Drawing.Color.White;
  1320. BtnBack.Image = prBrowser.Properties.Resources.antd_left_20;
  1321. BtnBack.Location = new System.Drawing.Point(2, 0);
  1322. BtnBack.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
  1323. BtnBack.Name = "BtnBack";
  1324. BtnBack.Size = new System.Drawing.Size(25, 30);
  1325. BtnBack.TabIndex = 0;
  1326. BtnBack.Tag = "后退";
  1327. BtnBack.UseVisualStyleBackColor = true;
  1328. BtnBack.Click += new System.EventHandler(bBack_Click);
  1329. settingMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[12]
  1330. {
  1331. toolStripMenuItemDevTool, toolStripMenuItemViewSource, toolStripMenuItemDelCache, toolStripSeparator3, toolStripMenuItemMinus, toolStripTextBoxZoom, toolStripMenuItemAdd, toolStripMenuItemResume, toolStripMenuItemFullScreen, toolStripSeparator4,
  1332. toolStripMenuItemServer, toolStripMenuItemExit
  1333. });
  1334. settingMenuStrip.Name = "settingMenuStrip";
  1335. settingMenuStrip.Size = new System.Drawing.Size(201, 261);
  1336. settingMenuStrip.MouseLeave += new System.EventHandler(settingMenuStrip_MouseLeave);
  1337. toolStripMenuItemDevTool.Name = "toolStripMenuItemDevTool";
  1338. toolStripMenuItemDevTool.ShortcutKeys = System.Windows.Forms.Keys.F12;
  1339. toolStripMenuItemDevTool.Size = new System.Drawing.Size(200, 22);
  1340. toolStripMenuItemDevTool.Text = "开发者工具";
  1341. toolStripMenuItemDevTool.Click += new System.EventHandler(toolStripMenuItemDevTool_Click);
  1342. toolStripMenuItemViewSource.Name = "toolStripMenuItemViewSource";
  1343. toolStripMenuItemViewSource.Size = new System.Drawing.Size(200, 22);
  1344. toolStripMenuItemViewSource.Text = "查看源代码";
  1345. toolStripMenuItemViewSource.Click += new System.EventHandler(toolStripMenuItemViewSource_Click);
  1346. toolStripMenuItemDelCache.Name = "toolStripMenuItemDelCache";
  1347. toolStripMenuItemDelCache.Size = new System.Drawing.Size(200, 22);
  1348. toolStripMenuItemDelCache.Text = "强力清除缓存";
  1349. toolStripMenuItemDelCache.Click += new System.EventHandler(toolStripMenuItemDelCache_Click);
  1350. toolStripSeparator3.Name = "toolStripSeparator3";
  1351. toolStripSeparator3.Size = new System.Drawing.Size(197, 6);
  1352. toolStripMenuItemMinus.Name = "toolStripMenuItemMinus";
  1353. toolStripMenuItemMinus.ShortcutKeys = System.Windows.Forms.Keys.OemMinus | System.Windows.Forms.Keys.Control;
  1354. toolStripMenuItemMinus.Size = new System.Drawing.Size(200, 22);
  1355. toolStripMenuItemMinus.Text = "缩小";
  1356. toolStripMenuItemMinus.Click += new System.EventHandler(toolStripMenuItemMinus_Click);
  1357. toolStripTextBoxZoom.Font = new System.Drawing.Font("Microsoft YaHei UI", 9f);
  1358. toolStripTextBoxZoom.Name = "toolStripTextBoxZoom";
  1359. toolStripTextBoxZoom.ReadOnly = true;
  1360. toolStripTextBoxZoom.Size = new System.Drawing.Size(30, 23);
  1361. toolStripTextBoxZoom.Text = "100";
  1362. toolStripMenuItemAdd.Name = "toolStripMenuItemAdd";
  1363. toolStripMenuItemAdd.ShortcutKeys = System.Windows.Forms.Keys.Oemplus | System.Windows.Forms.Keys.Control;
  1364. toolStripMenuItemAdd.Size = new System.Drawing.Size(200, 22);
  1365. toolStripMenuItemAdd.Text = "放大";
  1366. toolStripMenuItemAdd.Click += new System.EventHandler(toolStripMenuItemAdd_Click);
  1367. toolStripMenuItemResume.Name = "toolStripMenuItemResume";
  1368. toolStripMenuItemResume.Size = new System.Drawing.Size(200, 22);
  1369. toolStripMenuItemResume.Text = "重置";
  1370. toolStripMenuItemResume.Click += new System.EventHandler(toolStripMenuItemResume_Click);
  1371. toolStripMenuItemFullScreen.Name = "toolStripMenuItemFullScreen";
  1372. toolStripMenuItemFullScreen.ShortcutKeys = System.Windows.Forms.Keys.F11;
  1373. toolStripMenuItemFullScreen.Size = new System.Drawing.Size(200, 22);
  1374. toolStripMenuItemFullScreen.Text = "全屏";
  1375. toolStripMenuItemFullScreen.Click += new System.EventHandler(toolStripMenuItemFullScreen_Click);
  1376. toolStripSeparator4.Name = "toolStripSeparator4";
  1377. toolStripSeparator4.Size = new System.Drawing.Size(197, 6);
  1378. toolStripMenuItemServer.Name = "toolStripMenuItemServer";
  1379. toolStripMenuItemServer.Size = new System.Drawing.Size(200, 22);
  1380. toolStripMenuItemServer.Text = "服务器设置";
  1381. toolStripMenuItemServer.Click += new System.EventHandler(toolStripMenuItemServer_Click);
  1382. //toolStripMenuItemUpdate.Name = "toolStripMenuItemUpdate";
  1383. //toolStripMenuItemUpdate.Size = new System.Drawing.Size(200, 22);
  1384. //toolStripMenuItemUpdate.Text = "检查更新";
  1385. //toolStripMenuItemUpdate.Click += new System.EventHandler(toolStripMenuItemUpdate_Click);
  1386. toolStripMenuItemExit.Name = "toolStripMenuItemExit";
  1387. toolStripMenuItemExit.Size = new System.Drawing.Size(200, 22);
  1388. toolStripMenuItemExit.Text = "完美退出";
  1389. toolStripMenuItemExit.Click += new System.EventHandler(toolStripMenuItemExit_Click);
  1390. TabPages.ContextMenuStrip = menuStripTab;
  1391. TabPages.Dock = System.Windows.Forms.DockStyle.Fill;
  1392. TabPages.Font = new System.Drawing.Font("Segoe UI", 10.8f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
  1393. TabPages.Items.AddRange(new FarsiLibrary.Win.FATabStripItem[2] { tabStrip1, tabStripAdd });
  1394. TabPages.Location = new System.Drawing.Point(0, 30);
  1395. TabPages.Name = "TabPages";
  1396. TabPages.SelectedItem = tabStrip1;
  1397. TabPages.Size = new System.Drawing.Size(934, 621);
  1398. TabPages.TabIndex = 4;
  1399. TabPages.Text = "faTabStrip1";
  1400. TabPages.TabStripItemSelectionChanged += new FarsiLibrary.Win.TabStripItemChangedHandler(OnTabsChanged);
  1401. TabPages.TabStripItemClosed += new System.EventHandler(OnTabClosed);
  1402. TabPages.MouseClick += new System.Windows.Forms.MouseEventHandler(tabPages_MouseClick);
  1403. tabStrip1.IsDrawn = true;
  1404. tabStrip1.Name = "tabStrip1";
  1405. tabStrip1.Selected = true;
  1406. tabStrip1.Size = new System.Drawing.Size(932, 591);
  1407. tabStrip1.TabIndex = 0;
  1408. tabStrip1.Title = "加载中...";
  1409. tabStripAdd.CanClose = false;
  1410. tabStripAdd.IsDrawn = true;
  1411. tabStripAdd.Name = "tabStripAdd";
  1412. tabStripAdd.Size = new System.Drawing.Size(931, 601);
  1413. tabStripAdd.TabIndex = 1;
  1414. tabStripAdd.Title = "+";
  1415. PanelStatus.Dock = System.Windows.Forms.DockStyle.Bottom;
  1416. PanelStatus.Location = new System.Drawing.Point(0, 651);
  1417. PanelStatus.Name = "PanelStatus";
  1418. PanelStatus.Size = new System.Drawing.Size(934, 20);
  1419. PanelStatus.TabIndex = 8;
  1420. PanelSearch.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
  1421. PanelSearch.BackColor = System.Drawing.Color.White;
  1422. PanelSearch.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
  1423. PanelSearch.Controls.Add(BtnNextSearch);
  1424. PanelSearch.Controls.Add(BtnPrevSearch);
  1425. PanelSearch.Controls.Add(BtnCloseSearch);
  1426. PanelSearch.Controls.Add(TxtSearch);
  1427. PanelSearch.Location = new System.Drawing.Point(625, 41);
  1428. PanelSearch.Name = "PanelSearch";
  1429. PanelSearch.Size = new System.Drawing.Size(307, 40);
  1430. PanelSearch.TabIndex = 9;
  1431. PanelSearch.Visible = false;
  1432. BtnNextSearch.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
  1433. BtnNextSearch.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
  1434. BtnNextSearch.ForeColor = System.Drawing.Color.White;
  1435. BtnNextSearch.Image = prBrowser.Properties.Resources.antd_down_20;
  1436. BtnNextSearch.Location = new System.Drawing.Point(239, 4);
  1437. BtnNextSearch.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
  1438. BtnNextSearch.Name = "BtnNextSearch";
  1439. BtnNextSearch.Size = new System.Drawing.Size(25, 30);
  1440. BtnNextSearch.TabIndex = 9;
  1441. BtnNextSearch.Tag = "查找下一条(Enter)";
  1442. BtnNextSearch.UseVisualStyleBackColor = true;
  1443. BtnNextSearch.Click += new System.EventHandler(BtnNextSearch_Click);
  1444. BtnPrevSearch.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
  1445. BtnPrevSearch.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
  1446. BtnPrevSearch.ForeColor = System.Drawing.Color.White;
  1447. BtnPrevSearch.Image = prBrowser.Properties.Resources.antd_up_20;
  1448. BtnPrevSearch.Location = new System.Drawing.Point(206, 4);
  1449. BtnPrevSearch.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
  1450. BtnPrevSearch.Name = "BtnPrevSearch";
  1451. BtnPrevSearch.Size = new System.Drawing.Size(25, 30);
  1452. BtnPrevSearch.TabIndex = 8;
  1453. BtnPrevSearch.Tag = "查找上一条(Shift+Enter)";
  1454. BtnPrevSearch.UseVisualStyleBackColor = true;
  1455. BtnPrevSearch.Click += new System.EventHandler(BtnPrevSearch_Click);
  1456. BtnCloseSearch.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
  1457. BtnCloseSearch.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
  1458. BtnCloseSearch.ForeColor = System.Drawing.Color.White;
  1459. BtnCloseSearch.Image = prBrowser.Properties.Resources.antd_close_20;
  1460. BtnCloseSearch.Location = new System.Drawing.Point(272, 4);
  1461. BtnCloseSearch.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
  1462. BtnCloseSearch.Name = "BtnCloseSearch";
  1463. BtnCloseSearch.Size = new System.Drawing.Size(25, 30);
  1464. BtnCloseSearch.TabIndex = 7;
  1465. BtnCloseSearch.Tag = "关闭 (Esc)";
  1466. BtnCloseSearch.UseVisualStyleBackColor = true;
  1467. BtnCloseSearch.Click += new System.EventHandler(BtnClearSearch_Click);
  1468. TxtSearch.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
  1469. TxtSearch.BorderStyle = System.Windows.Forms.BorderStyle.None;
  1470. TxtSearch.Font = new System.Drawing.Font("Segoe UI", 13.8f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
  1471. TxtSearch.Location = new System.Drawing.Point(10, 6);
  1472. TxtSearch.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
  1473. TxtSearch.Name = "TxtSearch";
  1474. TxtSearch.Size = new System.Drawing.Size(181, 25);
  1475. TxtSearch.TabIndex = 6;
  1476. TxtSearch.TextChanged += new System.EventHandler(TxtSearch_TextChanged);
  1477. TxtSearch.KeyDown += new System.Windows.Forms.KeyEventHandler(TxtSearch_KeyDown);
  1478. base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
  1479. base.ClientSize = new System.Drawing.Size(934, 671);
  1480. base.Controls.Add(PanelSearch);
  1481. base.Controls.Add(TabPages);
  1482. base.Controls.Add(PanelStatus);
  1483. base.Controls.Add(PanelToolbar);
  1484. Font = new System.Drawing.Font("Segoe UI", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
  1485. base.Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon");
  1486. base.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
  1487. base.Name = "MainForm";
  1488. base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
  1489. Text = "云HIS浏览器";
  1490. base.WindowState = System.Windows.Forms.FormWindowState.Maximized;
  1491. base.FormClosing += new System.Windows.Forms.FormClosingEventHandler(MainForm_FormClosing);
  1492. base.Load += new System.EventHandler(MainForm_Load);
  1493. menuStripTab.ResumeLayout(false);
  1494. PanelToolbar.ResumeLayout(false);
  1495. PanelToolbar.PerformLayout();
  1496. settingMenuStrip.ResumeLayout(false);
  1497. settingMenuStrip.PerformLayout();
  1498. ((System.ComponentModel.ISupportInitialize)TabPages).EndInit();
  1499. TabPages.ResumeLayout(false);
  1500. PanelSearch.ResumeLayout(false);
  1501. PanelSearch.PerformLayout();
  1502. ResumeLayout(false);
  1503. }
  1504. }
  1505. }