SamplesPath.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /**
  2. Licensed Materials - Property of IBM
  3. IBM Cognos Products: DOCS
  4. (C) Copyright IBM Corp. 2005, 2008
  5. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with
  6. IBM Corp.
  7. */
  8. // Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  9. // Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
  10. using System;
  11. using System.Drawing;
  12. using System.Collections;
  13. using System.ComponentModel;
  14. using System.Windows.Forms;
  15. namespace SamplesCommon
  16. {
  17. /// <summary>
  18. /// Simple dialog box for collecting a searchPath.
  19. /// </summary>
  20. public class SamplesPath : System.Windows.Forms.Form
  21. {
  22. private System.Windows.Forms.Label label1;
  23. private System.Windows.Forms.TextBox searchPathText;
  24. /// <summary>
  25. /// Required designer variable.
  26. /// </summary>
  27. private System.ComponentModel.Container components = null;
  28. public SamplesPath()
  29. {
  30. //
  31. // Required for Windows Form Designer support
  32. //
  33. InitializeComponent();
  34. this.Closed += new EventHandler(SamplesPath_Closed);
  35. }
  36. /// <summary>
  37. /// Clean up any resources being used.
  38. /// </summary>
  39. protected override void Dispose( bool disposing )
  40. {
  41. if( disposing )
  42. {
  43. if(components != null)
  44. {
  45. components.Dispose();
  46. }
  47. }
  48. base.Dispose( disposing );
  49. }
  50. #region Windows Form Designer generated code
  51. /// <summary>
  52. /// Required method for Designer support - do not modify
  53. /// the contents of this method with the code editor.
  54. /// </summary>
  55. private void InitializeComponent()
  56. {
  57. System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(SamplesPath));
  58. this.label1 = new System.Windows.Forms.Label();
  59. this.searchPathText = new System.Windows.Forms.TextBox();
  60. this.SuspendLayout();
  61. //
  62. // label1
  63. //
  64. this.label1.Location = new System.Drawing.Point(16, 16);
  65. this.label1.Name = "label1";
  66. this.label1.Size = new System.Drawing.Size(112, 23);
  67. this.label1.TabIndex = 0;
  68. this.label1.Text = "Enter a Search Path:";
  69. this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
  70. //
  71. // searchPathText
  72. //
  73. this.searchPathText.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  74. | System.Windows.Forms.AnchorStyles.Left)
  75. | System.Windows.Forms.AnchorStyles.Right)));
  76. this.searchPathText.Location = new System.Drawing.Point(128, 16);
  77. this.searchPathText.Name = "searchPathText";
  78. this.searchPathText.Size = new System.Drawing.Size(232, 20);
  79. this.searchPathText.TabIndex = 1;
  80. this.searchPathText.Text = "";
  81. //
  82. // SamplesPath
  83. //
  84. this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
  85. this.ClientSize = new System.Drawing.Size(376, 54);
  86. this.Controls.Add(this.searchPathText);
  87. this.Controls.Add(this.label1);
  88. this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
  89. this.MaximizeBox = false;
  90. this.MinimizeBox = false;
  91. this.Name = "SamplesPath";
  92. this.Text = "Search Path";
  93. this.ResumeLayout(false);
  94. }
  95. #endregion
  96. /// <summary>
  97. /// Get or set the search path text in the dialog box.
  98. /// </summary>
  99. public string searchPath {
  100. get {
  101. return this.searchPathText.Text;
  102. }
  103. set {
  104. this.searchPathText.Text = value;
  105. }
  106. }
  107. /// <summary>
  108. /// This window has been closed; we need to close the owner, too.
  109. /// </summary>
  110. /// <param name="sender">Who sent this event? (not used)</param>
  111. /// <param name="e">Extra event arguments (not used)</param>
  112. private void SamplesPath_Closed(object sender, EventArgs e) {
  113. // If I've been closed, my owner should close, too.
  114. this.Owner.Close();
  115. }
  116. }
  117. }