Format
Plain text
Post date
2015-04-04 22:28
Période de publication
Illimité
  1. /*
  2. * Copyright (c) Daisuke OKAJIMA All rights reserved.
  3. *
  4. * $Id$
  5. */
  6. // This file is modified by panacoran.
  7. // Copyright (C) 2013 panacoran <panacoran@users.sourceforge.jp>
  8. // This program is part of OmegaChart.
  9. // OmegaChart is licensed under the Apache License, Version 2.0.
  10. using System;
  11. using System.Drawing;
  12. using System.Collections;
  13. using System.ComponentModel;
  14. using System.Windows.Forms;
  15. using System.Diagnostics;
  16. using System.Text;
  17. using Travis.Util;
  18. using Zanetti.Data;
  19. using Zanetti.Indicators;
  20. using Zanetti.SystemTrading;
  21. using Zanetti.SystemTrading.Screening;
  22. using Zanetti.Config; // for BookmarkFolder
  23. namespace Zanetti.Forms
  24. {
  25. /// <summary>
  26. /// ScreeningDialog の概要の説明です。
  27. /// </summary>
  28. internal class ScreeningDialog : System.Windows.Forms.Form
  29. {
  30. private ScreeningOrder _order;
  31. private System.Windows.Forms.Button _okButton;
  32. private System.Windows.Forms.Button _cancelButton;
  33. private System.Windows.Forms.GroupBox _filterGroup;
  34. private System.Windows.Forms.Label _messageLabel;
  35. private System.Windows.Forms.Label _filterLabel;
  36. private System.Windows.Forms.ComboBox _filterBox;
  37. private System.Windows.Forms.GroupBox _primaryIndicatorGroup;
  38. private System.Windows.Forms.Label _lCondition;
  39. private System.Windows.Forms.Label _primaryIndicatorLabel;
  40. private System.Windows.Forms.ComboBox _primaryIndicatorBox;
  41. private System.Windows.Forms.Label _countLabel;
  42. private System.Windows.Forms.ComboBox _numberBox;
  43. private System.Windows.Forms.GroupBox _dateGroup;
  44. private System.Windows.Forms.DateTimePicker _datePicker;
  45. private System.Windows.Forms.ProgressBar _progressBar;
  46. private System.Windows.Forms.ComboBox _favoriteBox;
  47. private System.Windows.Forms.Button _specBookmarkFolderButton;
  48. private System.Windows.Forms.TextBox _bookmarkFolderTextBox;
  49. private System.Windows.Forms.Label _filterBookmarkLabel;
  50. /// <summary>
  51. /// 必要なデザイナ変数です。
  52. /// </summary>
  53. private System.ComponentModel.Container components = null;
  54. private BookmarkFolder _bookmarkFolder;
  55. public ScreeningDialog()
  56. {
  57. //
  58. // Windows フォーム デザイナ サポートに必要です。
  59. //
  60. InitializeComponent();
  61. //
  62. // TODO: InitializeComponent 呼び出しの後に、コンストラクタ コードを追加してください。
  63. //
  64. _filterBox.Items.AddRange(EnumDescAttribute.For(typeof(FilterType)).DescriptionCollection());
  65. _numberBox.Items.AddRange(EnumDescAttribute.For(typeof(ResultCountType)).DescriptionCollection());
  66. _filterBox.SelectedIndex = 0;
  67. _numberBox.SelectedIndex = 0;
  68. InitUI();
  69. }
  70. public ScreeningOrder ScreeningOrder {
  71. get {
  72. return _order;
  73. }
  74. }
  75. /// <summary>
  76. /// 使用されているリソースに後処理を実行します。
  77. /// </summary>
  78. protected override void Dispose( bool disposing )
  79. {
  80. if( disposing )
  81. {
  82. if(components != null)
  83. {
  84. components.Dispose();
  85. }
  86. }
  87. base.Dispose( disposing );
  88. }
  89. #region Windows フォーム デザイナで生成されたコード
  90. /// <summary>
  91. /// デザイナ サポートに必要なメソッドです。このメソッドの内容を
  92. /// コード エディタで変更しないでください。
  93. /// </summary>
  94. private void InitializeComponent()
  95. {
  96. this._filterGroup = new System.Windows.Forms.GroupBox();
  97. this._specBookmarkFolderButton = new System.Windows.Forms.Button();
  98. this._bookmarkFolderTextBox = new System.Windows.Forms.TextBox();
  99. this._filterBookmarkLabel = new System.Windows.Forms.Label();
  100. this._filterBox = new System.Windows.Forms.ComboBox();
  101. this._filterLabel = new System.Windows.Forms.Label();
  102. this._messageLabel = new System.Windows.Forms.Label();
  103. this._favoriteBox = new System.Windows.Forms.ComboBox();
  104. this._primaryIndicatorGroup = new System.Windows.Forms.GroupBox();
  105. this._lCondition = new System.Windows.Forms.Label();
  106. this._numberBox = new System.Windows.Forms.ComboBox();
  107. this._countLabel = new System.Windows.Forms.Label();
  108. this._primaryIndicatorBox = new System.Windows.Forms.ComboBox();
  109. this._primaryIndicatorLabel = new System.Windows.Forms.Label();
  110. this._dateGroup = new System.Windows.Forms.GroupBox();
  111. this._datePicker = new System.Windows.Forms.DateTimePicker();
  112. this._progressBar = new System.Windows.Forms.ProgressBar();
  113. this._okButton = new System.Windows.Forms.Button();
  114. this._cancelButton = new System.Windows.Forms.Button();
  115. this._filterGroup.SuspendLayout();
  116. this._primaryIndicatorGroup.SuspendLayout();
  117. this._dateGroup.SuspendLayout();
  118. this.SuspendLayout();
  119. //
  120. // _filterGroup
  121. //
  122. this._filterGroup.Controls.Add(this._specBookmarkFolderButton);
  123. this._filterGroup.Controls.Add(this._bookmarkFolderTextBox);
  124. this._filterGroup.Controls.Add(this._filterBookmarkLabel);
  125. this._filterGroup.Controls.Add(this._filterBox);
  126. this._filterGroup.Controls.Add(this._filterLabel);
  127. this._filterGroup.Controls.Add(this._messageLabel);
  128. this._filterGroup.FlatStyle = System.Windows.Forms.FlatStyle.System;
  129. this._filterGroup.Location = new System.Drawing.Point(8, 8);
  130. this._filterGroup.Name = "_filterGroup";
  131. this._filterGroup.Size = new System.Drawing.Size(464, 96);
  132. this._filterGroup.TabIndex = 0;
  133. this._filterGroup.TabStop = false;
  134. this._filterGroup.Text = "1 フィルタの設定";
  135. //
  136. // _specBookmarkFolderButton
  137. //
  138. this._specBookmarkFolderButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
  139. this._specBookmarkFolderButton.Location = new System.Drawing.Point(368, 64);
  140. this._specBookmarkFolderButton.Name = "_specBookmarkFolderButton";
  141. this._specBookmarkFolderButton.Size = new System.Drawing.Size(80, 24);
  142. this._specBookmarkFolderButton.TabIndex = 6;
  143. this._specBookmarkFolderButton.Text = "フォルダ指定";
  144. this._specBookmarkFolderButton.Click += new System.EventHandler(this.OnSelectBookmarkFolder);
  145. //
  146. // _bookmarkFolderTextBox
  147. //
  148. this._bookmarkFolderTextBox.Location = new System.Drawing.Point(136, 64);
  149. this._bookmarkFolderTextBox.Name = "_bookmarkFolderTextBox";
  150. this._bookmarkFolderTextBox.ReadOnly = true;
  151. this._bookmarkFolderTextBox.Size = new System.Drawing.Size(224, 19);
  152. this._bookmarkFolderTextBox.TabIndex = 5;
  153. //
  154. // _filterBookmarkLabel
  155. //
  156. this._filterBookmarkLabel.Location = new System.Drawing.Point(24, 64);
  157. this._filterBookmarkLabel.Name = "_filterBookmarkLabel";
  158. this._filterBookmarkLabel.Size = new System.Drawing.Size(72, 16);
  159. this._filterBookmarkLabel.TabIndex = 4;
  160. this._filterBookmarkLabel.Text = "お気に入り(&T)";
  161. this._filterBookmarkLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
  162. //
  163. // _filterBox
  164. //
  165. this._filterBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  166. this._filterBox.Location = new System.Drawing.Point(136, 40);
  167. this._filterBox.Name = "_filterBox";
  168. this._filterBox.Size = new System.Drawing.Size(224, 20);
  169. this._filterBox.TabIndex = 3;
  170. this._filterBox.SelectedIndexChanged += new System.EventHandler(this.OnFilterBoxChanged);
  171. //
  172. // _filterLabel
  173. //
  174. this._filterLabel.Location = new System.Drawing.Point(24, 40);
  175. this._filterLabel.Name = "_filterLabel";
  176. this._filterLabel.Size = new System.Drawing.Size(64, 16);
  177. this._filterLabel.TabIndex = 2;
  178. this._filterLabel.Text = "フィルタ(&F)";
  179. this._filterLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
  180. //
  181. // _messageLabel
  182. //
  183. this._messageLabel.Location = new System.Drawing.Point(16, 16);
  184. this._messageLabel.Name = "_messageLabel";
  185. this._messageLabel.Size = new System.Drawing.Size(432, 16);
  186. this._messageLabel.TabIndex = 1;
  187. this._messageLabel.Text = "まず検索対象を決めます。ここでの対象銘柄数が少ないほど高速に結果が得られます。";
  188. //
  189. // _favoriteBox
  190. //
  191. this._favoriteBox.Location = new System.Drawing.Point(0, 0);
  192. this._favoriteBox.Name = "_favoriteBox";
  193. this._favoriteBox.Size = new System.Drawing.Size(121, 20);
  194. this._favoriteBox.TabIndex = 0;
  195. //
  196. // _primaryIndicatorGroup
  197. //
  198. this._primaryIndicatorGroup.Controls.Add(this._lCondition);
  199. this._primaryIndicatorGroup.Controls.Add(this._numberBox);
  200. this._primaryIndicatorGroup.Controls.Add(this._countLabel);
  201. this._primaryIndicatorGroup.Controls.Add(this._primaryIndicatorBox);
  202. this._primaryIndicatorGroup.Controls.Add(this._primaryIndicatorLabel);
  203. this._primaryIndicatorGroup.FlatStyle = System.Windows.Forms.FlatStyle.System;
  204. this._primaryIndicatorGroup.Location = new System.Drawing.Point(8, 112);
  205. this._primaryIndicatorGroup.Name = "_primaryIndicatorGroup";
  206. this._primaryIndicatorGroup.Size = new System.Drawing.Size(464, 96);
  207. this._primaryIndicatorGroup.TabIndex = 4;
  208. this._primaryIndicatorGroup.TabStop = false;
  209. this._primaryIndicatorGroup.Text = "2 ソート条件と件数の設定";
  210. //
  211. // _lCondition
  212. //
  213. this._lCondition.Location = new System.Drawing.Point(16, 16);
  214. this._lCondition.Name = "_lCondition";
  215. this._lCondition.Size = new System.Drawing.Size(432, 23);
  216. this._lCondition.TabIndex = 5;
  217. this._lCondition.Text = "ソート条件は拡張キットによって追加することができます。";
  218. this._lCondition.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
  219. //
  220. // _numberBox
  221. //
  222. this._numberBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  223. this._numberBox.Location = new System.Drawing.Point(136, 64);
  224. this._numberBox.Name = "_numberBox";
  225. this._numberBox.Size = new System.Drawing.Size(224, 20);
  226. this._numberBox.TabIndex = 8;
  227. //
  228. // _countLabel
  229. //
  230. this._countLabel.Location = new System.Drawing.Point(24, 64);
  231. this._countLabel.Name = "_countLabel";
  232. this._countLabel.Size = new System.Drawing.Size(100, 23);
  233. this._countLabel.TabIndex = 9;
  234. this._countLabel.Text = "表示件数(&N)";
  235. this._countLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
  236. //
  237. // _primaryIndicatorBox
  238. //
  239. this._primaryIndicatorBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  240. this._primaryIndicatorBox.Location = new System.Drawing.Point(136, 40);
  241. this._primaryIndicatorBox.Name = "_primaryIndicatorBox";
  242. this._primaryIndicatorBox.Size = new System.Drawing.Size(224, 20);
  243. this._primaryIndicatorBox.TabIndex = 7;
  244. //
  245. // _primaryIndicatorLabel
  246. //
  247. this._primaryIndicatorLabel.Location = new System.Drawing.Point(24, 40);
  248. this._primaryIndicatorLabel.Name = "_primaryIndicatorLabel";
  249. this._primaryIndicatorLabel.Size = new System.Drawing.Size(100, 23);
  250. this._primaryIndicatorLabel.TabIndex = 6;
  251. this._primaryIndicatorLabel.Text = "ソート条件(&S)";
  252. this._primaryIndicatorLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
  253. //
  254. // _dateGroup
  255. //
  256. this._dateGroup.Controls.Add(this._datePicker);
  257. this._dateGroup.FlatStyle = System.Windows.Forms.FlatStyle.System;
  258. this._dateGroup.Location = new System.Drawing.Point(8, 216);
  259. this._dateGroup.Name = "_dateGroup";
  260. this._dateGroup.Size = new System.Drawing.Size(464, 48);
  261. this._dateGroup.TabIndex = 10;
  262. this._dateGroup.TabStop = false;
  263. this._dateGroup.Text = "3 スクリーニングの基準日";
  264. //
  265. // _datePicker
  266. //
  267. this._datePicker.Checked = false;
  268. this._datePicker.Location = new System.Drawing.Point(16, 16);
  269. this._datePicker.Name = "_datePicker";
  270. this._datePicker.Size = new System.Drawing.Size(200, 19);
  271. this._datePicker.TabIndex = 12;
  272. this._datePicker.ValueChanged += new System.EventHandler(this.OnDateChanged);
  273. //
  274. // _progressBar
  275. //
  276. this._progressBar.Location = new System.Drawing.Point(8, 272);
  277. this._progressBar.Name = "_progressBar";
  278. this._progressBar.Size = new System.Drawing.Size(464, 23);
  279. this._progressBar.TabIndex = 14;
  280. //
  281. // _okButton
  282. //
  283. this._okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
  284. this._okButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
  285. this._okButton.Location = new System.Drawing.Point(312, 304);
  286. this._okButton.Name = "_okButton";
  287. this._okButton.Size = new System.Drawing.Size(75, 23);
  288. this._okButton.TabIndex = 15;
  289. this._okButton.Text = "OK";
  290. this._okButton.Click += new System.EventHandler(this.OnOK);
  291. //
  292. // _cancelButton
  293. //
  294. this._cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
  295. this._cancelButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
  296. this._cancelButton.Location = new System.Drawing.Point(400, 304);
  297. this._cancelButton.Name = "_cancelButton";
  298. this._cancelButton.Size = new System.Drawing.Size(75, 23);
  299. this._cancelButton.TabIndex = 16;
  300. this._cancelButton.Text = "キャンセル";
  301. this._cancelButton.Click += new System.EventHandler(this.OnCancel);
  302. //
  303. // ScreeningDialog
  304. //
  305. this.AcceptButton = this._okButton;
  306. this.AutoScaleBaseSize = new System.Drawing.Size(5, 12);
  307. this.CancelButton = this._cancelButton;
  308. this.ClientSize = new System.Drawing.Size(482, 336);
  309. this.Controls.Add(this._dateGroup);
  310. this.Controls.Add(this._primaryIndicatorGroup);
  311. this.Controls.Add(this._progressBar);
  312. this.Controls.Add(this._filterGroup);
  313. this.Controls.Add(this._cancelButton);
  314. this.Controls.Add(this._okButton);
  315. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
  316. this.MaximizeBox = false;
  317. this.MinimizeBox = false;
  318. this.Name = "ScreeningDialog";
  319. this.ShowInTaskbar = false;
  320. this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
  321. this.Text = "スクリーニング条件設定";
  322. this._filterGroup.ResumeLayout(false);
  323. this._filterGroup.PerformLayout();
  324. this._primaryIndicatorGroup.ResumeLayout(false);
  325. this._dateGroup.ResumeLayout(false);
  326. this.ResumeLayout(false);
  327. }
  328. #endregion
  329. /*
  330. private void InitIndicatorAppearance() {
  331. ScreeningItem[] target = Env.CurrentIndicators.GetScreeningItems();
  332. _secondaryIndicatorBoxes = new CheckBox[target.Length];
  333. for(int i=0; i<target.Length; i++) {
  334. ScreeningItem item = target[i];
  335. _primaryIndicatorBox.Items.Add(item.Header);
  336. CheckBox ch = new CheckBox();
  337. ch.FlatStyle = FlatStyle.System;
  338. ch.Text = item.Header;
  339. ch.Left = 8 + 150 * (i % 3);
  340. ch.Width = 150;
  341. ch.Top = 12 + 24 * (i / 3);
  342. _secondaryIndicatorGroup.Controls.Add(ch);
  343. _secondaryIndicatorBoxes[i] = ch;
  344. }
  345. _primaryIndicatorBox.SelectedIndex = 0;
  346. }
  347. */
  348. private void InitUI() {
  349. ScreeningOrder o = Env.Options.PrevScreeningOrder;
  350. if(o!=null) {
  351. FilteredBrandEnumerator fbe = o.BrandEnumerator as FilteredBrandEnumerator;
  352. FilterType filter = fbe==null? FilterType.Favorite : fbe.FilterType;
  353. _filterBox.SelectedIndex = (int)filter;
  354. _numberBox.SelectedIndex = (int)o.PreferredResultCountType;
  355. _datePicker.Value = Util.IntToDate(o.OriginDate);
  356. }
  357. else {
  358. DateTime ld = Util.GuessLatestTradeDate();
  359. if(ld==DateTime.Today && DateTime.Now.Hour<17) {
  360. ld = ld.AddDays(-1);
  361. while(!Util.IsMarketOpenDate(ld)) ld = ld.AddDays(-1); //市場が開いている日の17時以前はデータ取れない
  362. }
  363. _datePicker.Value = ld;
  364. }
  365. int si = 0;
  366. ScreeningItem[] target = Env.CurrentIndicators.GetScreeningItems();
  367. for(int i=0; i<target.Length; i++) {
  368. ScreeningItem item = target[i];
  369. _primaryIndicatorBox.Items.Add(item.Header);
  370. if(o!=null && o.PrimaryItem==target[i])
  371. si = i;
  372. }
  373. _primaryIndicatorBox.SelectedIndex = si;
  374. }
  375. private void OnOK(object sender, EventArgs args) {
  376. this.DialogResult = DialogResult.None;
  377. _order = CreateScreeningOrder();
  378. if(_order==null) return;
  379. _okButton.Enabled = false;
  380. _filterBox.Enabled = false;
  381. _numberBox.Enabled = false;
  382. _primaryIndicatorBox.Enabled = false;
  383. _datePicker.Enabled = false;
  384. /*
  385. foreach(CheckBox ch in _secondaryIndicatorBoxes)
  386. ch.Enabled = false;
  387. */
  388. _progressBar.Maximum = _order.BrandEnumerator.Count;
  389. _progressBar.Value = 0;
  390. _progressBar.Enabled = true;
  391. Env.Options.PrevScreeningOrder = _order;
  392. this.Cursor = Cursors.AppStarting;
  393. _order.AsyncExecute(this.Handle);
  394. }
  395. private void OnCancel(object sender, EventArgs args) {
  396. if(_order!=null) {
  397. _order.Abort();
  398. }
  399. }
  400. private void OnDateChanged(object sender, EventArgs args) {
  401. DateTime dt = _datePicker.Value;
  402. }
  403. private ScreeningOrder CreateScreeningOrder() {
  404. if(_datePicker.Value.CompareTo(DateTime.Today)>0) {
  405. Util.Warning(this, "基準日が未来です。");
  406. return null;
  407. }
  408. ScreeningItem[] items = Env.CurrentIndicators.GetScreeningItems();
  409. int pr = _primaryIndicatorBox.SelectedIndex;
  410. ScreeningOrder so = new ScreeningOrder(items[pr].Header, items[pr]);
  411. FilterType filter = (FilterType)_filterBox.SelectedIndex;
  412. so.OriginDate = Util.DateToInt(_datePicker.Value);
  413. if(filter == FilterType.Favorite){
  414. if(_bookmarkFolder==null){
  415. Util.Warning(this, "お気に入りのフォルダを指定してください。");
  416. return null;
  417. }
  418. so.BrandEnumerator = new BookmarkedBrandEnumerator(_bookmarkFolder);
  419. }
  420. //yu
  421. else if (filter == FilterType.LastResult)
  422. {
  423. SystemTradingResult tr = Env.LastScreeningResult;
  424. if (tr == null) return null;
  425. so.BrandEnumerator = new BookmarkedBrandEnumerator2();
  426. }
  427. else
  428. {
  429. so.BrandEnumerator = new FilteredBrandEnumerator(filter);
  430. }
  431. return so;
  432. }
  433. private void ExitSuccessFully() {
  434. this.DialogResult = DialogResult.OK;
  435. this.Cursor = Cursors.Default;
  436. ScreeningResult r = _order.Result as ScreeningResult;
  437. StringBuilder msg = new StringBuilder();
  438. if(r.DataErrorBrands.Count==0) {
  439. msg.AppendFormat("スクリーニングが完了しました。\n対象銘柄数は {0} でした。\n", r.CheckedBrandCount);
  440. if(_order.PrimaryItem.Filter!=null)
  441. msg.AppendFormat("ただしフィルタで除外された {0} 銘柄は除外されました。", r.FilteredCount);
  442. }
  443. else {
  444. msg.AppendFormat("スクリーニングが完了しました。\n対象銘柄数 {0} のうち、\n対象日付のデータがなかった {1} 銘柄", r.CheckedBrandCount, r.DataErrorBrands.Count);
  445. if(r.DataErrorBrands.Count <= 10) {
  446. for(int i=0; i<r.DataErrorBrands.Count; i++) {
  447. if(i > 0) msg.Append(", ");
  448. msg.Append((r.DataErrorBrands[i] as BasicBrand).Code.ToString());
  449. }
  450. }
  451. for(int i=0; i<r.DataErrorBrands.Count; i++) {
  452. Debug.WriteLine("DataError "+(r.DataErrorBrands[i] as BasicBrand).Code);
  453. }
  454. if(_order.PrimaryItem.Filter!=null)
  455. msg.AppendFormat("、\nフィルタで除外された {0} 銘柄", r.FilteredCount);
  456. msg.Append("は除外されました。");
  457. }
  458. Util.Information(this, msg.ToString());
  459. _order.PreferredResultCountType = (ResultCountType)_numberBox.SelectedIndex;
  460. Close();
  461. }
  462. protected override void WndProc(ref Message m) {
  463. base.WndProc (ref m);
  464. if(m.Msg==AsyncConst.WM_ASYNCPROCESS) {
  465. if(m.LParam.ToInt32()==AsyncConst.LPARAM_PROGRESS_SUCCESSFUL || m.LParam.ToInt32()==AsyncConst.LPARAM_PROGRESS_FAILURE) {
  466. if(_progressBar.Value<_progressBar.Maximum) _progressBar.Value++;
  467. }
  468. else if(m.LParam.ToInt32()==AsyncConst.LPARAM_FINISHED)
  469. ExitSuccessFully();
  470. else if(m.LParam.ToInt32()==AsyncConst.LPARAM_ERROR) {
  471. this.Cursor = Cursors.Default;
  472. _order.Abort();
  473. Util.Warning(this, _order.ErrorMessage);
  474. this.DialogResult = DialogResult.Abort;
  475. Close();
  476. }
  477. }
  478. }
  479. private void OnSelectBookmarkFolder(object sender, System.EventArgs e){
  480. SelectBookmarkFolder dlg = new SelectBookmarkFolder();
  481. if(dlg.ShowDialog(Env.Frame)==DialogResult.OK){
  482. _bookmarkFolder = dlg.ResultFolder;
  483. _bookmarkFolderTextBox.Text = _bookmarkFolder.Name;
  484. }
  485. }
  486. private void OnFilterBoxChanged(object sender, System.EventArgs e){
  487. bool en = ((FilterType)_filterBox.SelectedIndex == FilterType.Favorite);
  488. _bookmarkFolderTextBox.Enabled = en;
  489. _specBookmarkFolderButton.Enabled = en;
  490. }
  491. }
  492. }
Télécharger Printable view

URL of this paste

Embed with JavaScript

Embed with iframe

Raw text