RegexEditorDialog.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. //
  2. // Permission is hereby granted, free of charge, to any person obtaining
  3. // a copy of this software and associated documentation files (the
  4. // "Software"), to deal in the Software without restriction, including
  5. // without limitation the rights to use, copy, modify, merge, publish,
  6. // distribute, sublicense, and/or sell copies of the Software, and to
  7. // permit persons to whom the Software is furnished to do so, subject to
  8. // the following conditions:
  9. //
  10. // The above copyright notice and this permission notice shall be
  11. // included in all copies or substantial portions of the Software.
  12. //
  13. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  14. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  15. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  16. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  17. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  18. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  19. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  20. //
  21. /**
  22. * Namespace: System.Web.UI.Design.WebControls
  23. * Class: RegexEditorDialog
  24. *
  25. * Author: Gaurav Vaish
  26. * Maintainer: mastergaurav AT users DOT sf DOT net
  27. *
  28. * (C) Gaurav Vaish (2002)
  29. */
  30. using System;
  31. using System.Drawing;
  32. using System.ComponentModel;
  33. using System.Windows.Forms;
  34. using System.Windows.Forms.Design;
  35. namespace System.Web.UI.Design.WebControls
  36. {
  37. public class RegexEditorDialog : Form
  38. {
  39. private ISite site;
  40. private Container components;
  41. private bool isActivated;
  42. private bool sVal;
  43. private string regularExpression = String.Empty;
  44. private Button helpBtn;
  45. private Button testValBtn;
  46. private Button okBtn;
  47. private Button cancelBtn;
  48. private Label inputLabel;
  49. private Label testResultsLabel;
  50. private Label stdExprLabel;
  51. private Label exprLabel;
  52. private ListBox stdExprsList;
  53. private TextBox exprText;
  54. private TextBox sampleText;
  55. private GroupBox exprGrp;
  56. public RegexEditorDialog(ISite site) : base()
  57. {
  58. this.site = site;
  59. this.isActivated = false;
  60. this.sVal = false;
  61. InitializeComponents();
  62. }
  63. [MonoTODO]
  64. private void InitializeComponents()
  65. {
  66. components = new Container();
  67. helpBtn = new Button();
  68. testValBtn = new Button();
  69. okBtn = new Button();
  70. cancelBtn = new Button();
  71. inputLabel = new Label();
  72. testResultsLabel = new Label();
  73. stdExprLabel = new Label();
  74. exprLabel = new Label();
  75. stdExprsList = new ListBox();
  76. exprText = new TextBox();
  77. sampleText = new TextBox();
  78. exprGrp = new GroupBox();
  79. System.Drawing.Font cFont = System.Windows.Forms.Control.DefaultFont;
  80. IUIService service = (IUIService)site.GetService(typeof(IUIService));
  81. if(service != null)
  82. {
  83. cFont = (Font)(service.Styles["DialogFont"]);
  84. }
  85. throw new NotImplementedException();
  86. }
  87. public string RegularExpression
  88. {
  89. get
  90. {
  91. return regularExpression;
  92. }
  93. set
  94. {
  95. regularExpression = value;
  96. }
  97. }
  98. protected override void Dispose(bool disposing)
  99. {
  100. if(disposing)
  101. {
  102. components.Dispose();
  103. }
  104. base.Dispose(disposing);
  105. }
  106. [MonoTODO]
  107. private object[] CannedExpressions
  108. {
  109. get
  110. {
  111. throw new NotImplementedException();
  112. }
  113. }
  114. private class CannedExpression
  115. {
  116. public string Description;
  117. public string Expression;
  118. public CannedExpression(string description, string expression)
  119. {
  120. Description = description;
  121. Expression = expression;
  122. }
  123. public override string ToString()
  124. {
  125. return Description;
  126. }
  127. }
  128. }
  129. }