PageRenderTime 62ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 1ms

/WSCF.Blue/source/UI/WsdlWizard/WsdlWizardForm.cs

#
C# | 3304 lines | 2352 code | 350 blank | 602 comment | 171 complexity | 0eced8fd8c69baa9b16743bf11f5b9b3 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1. using System;
  2. using System.Collections;
  3. using System.Collections.Specialized;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Drawing;
  7. using System.Globalization;
  8. using System.Linq;
  9. using System.Windows.Forms;
  10. using System.IO;
  11. using System.Text;
  12. using System.Reflection;
  13. using System.Net;
  14. using Thinktecture.Tools.Web.Services;
  15. using Thinktecture.Tools.Wscf.Services.ServiceDescription;
  16. using Thinktecture.Tools.Wscf.Services.ServiceDescription.Exceptions;
  17. using WizardControl;
  18. using WRM.Windows.Forms;
  19. using Message = Thinktecture.Tools.Wscf.Services.ServiceDescription.Message;
  20. using Thinktecture.Tools.Web.Services.Wscf.Environment;
  21. namespace Thinktecture.Tools.Wscf.UI.WsdlWizard
  22. {
  23. /// <summary>
  24. /// Represents the user interface handler for WsdlWizardForm.
  25. /// </summary>
  26. public class WsdlWizardForm : Form
  27. {
  28. #region Private fields
  29. #region "Primitives"
  30. private int operationCount;
  31. private string schemaLocation = "";
  32. private string wsdlLocation = "";
  33. private string schemaNamespace = "";
  34. private bool openCodeGenDialog;
  35. private bool alreadyCancelled = false;
  36. private bool roundtripMode = false;
  37. private string currentFolder;
  38. private string wsdlFile = string.Empty;
  39. private string defaultPathForImports = string.Empty;
  40. private string projectRootDirectory = string.Empty;
  41. #endregion
  42. #region "Objects"
  43. private ArrayList importedSchemaNamespaces = new ArrayList();
  44. private InterfaceContract serviceInterfaceContract;
  45. private InterfaceContract importedContract = null;
  46. //private SchemaElements messageSchemas = new SchemaElements();
  47. //private SchemaElements headerSchemas = new SchemaElements();
  48. //private OperationsCollection inferOperations = new OperationsCollection(10);
  49. private List<Operation> oldOperations =
  50. new List<Operation>(); // Holds a list of old operations configured by the user.
  51. #endregion
  52. #region "WizardPages and Items"
  53. private Wizard wsdlWizardCtrl;
  54. private WizardPage wizardPageBasicMetadata;
  55. private TextBox tbServiceName;
  56. private Label lblServiceName;
  57. private Label lblNamespace;
  58. private WizardPage wizardPageOperationsList;
  59. private GroupBox groupBox1;
  60. private TextBox tbEdit;
  61. private ComboBox cbMEPs;
  62. private Panel panel1;
  63. private ToolTip toolTip1;
  64. private IContainer components;
  65. private TextBox tbNamespace;
  66. private LinkLabel llAddOperation;
  67. private EditableListView operationsListView;
  68. private LinkLabel llRemoveOperation;
  69. private Label lblServiceDoc;
  70. private TextBox tbServiceDoc;
  71. private WizardPage wizardPageMessageMapping;
  72. private WizardControl.WizardPage wizardPageAdditionalOptions;
  73. private System.Windows.Forms.CheckBox cbNeedsServiceElement;
  74. private System.Windows.Forms.CheckBox cbCodeGenDialog;
  75. private WRM.Windows.Forms.PropertyTree ptvServiceOperations;
  76. private WizardControl.WizardPage wizardPageSchemaImports;
  77. private System.Windows.Forms.GroupBox groupBox2;
  78. private Thinktecture.Tools.Wscf.UI.WsdlWizard.EditableListView importsListView;
  79. private System.Windows.Forms.LinkLabel llAddImport;
  80. private System.Windows.Forms.LinkLabel llRemoveImport;
  81. private System.Windows.Forms.OpenFileDialog openFileDialog1;
  82. private WizardControl.WizardPage wizardPageAlternativeXSDPaths;
  83. private Thinktecture.Tools.Wscf.UI.WsdlWizard.EditableListView xsdpathsListView;
  84. private System.Windows.Forms.ToolTip toolTipPath;
  85. private System.Windows.Forms.CheckBox cbInfer;
  86. private CheckBox cbSoap12;
  87. private CheckBox cbSoap11;
  88. #endregion
  89. #endregion
  90. #region Public properties.
  91. /// <summary>
  92. /// Gets a value indicating whether the code generation dialog should be opened or not.
  93. /// </summary>
  94. public bool OpenCodeGenDialog
  95. {
  96. get { return openCodeGenDialog; }
  97. }
  98. /// <summary>
  99. /// Gets or sets the location to create the WSDL file.
  100. /// </summary>
  101. public string WsdlLocation
  102. {
  103. get { return wsdlLocation; }
  104. set { wsdlLocation = value; }
  105. }
  106. /// <summary>
  107. /// Gets or sets the schema namespace.
  108. /// </summary>
  109. public string SchemaNamespace
  110. {
  111. get { return schemaNamespace; }
  112. set { schemaNamespace = value; }
  113. }
  114. /// <summary>
  115. /// Gets or sets the schema location.
  116. /// </summary>
  117. public string SchemaLocation
  118. {
  119. get { return schemaLocation; }
  120. set
  121. {
  122. schemaLocation = value;
  123. this.UpdateCurrentFolder(schemaLocation);
  124. }
  125. }
  126. /// <summary>
  127. /// Gets or sets a value indicating whether the round tripping mode is on or off.
  128. /// </summary>
  129. public bool RoundtripMode
  130. {
  131. get { return roundtripMode; }
  132. set { roundtripMode = value; }
  133. }
  134. /// <summary>
  135. /// Gets or sets the default path for the imported XSD files.
  136. /// </summary>
  137. public string DefaultPathForImports
  138. {
  139. get { return defaultPathForImports; }
  140. set { defaultPathForImports = value; }
  141. }
  142. /// <summary>
  143. /// Gets or sets the root directory for the project.
  144. /// </summary>
  145. public string ProjectRootDirectory
  146. {
  147. get { return projectRootDirectory; }
  148. set { projectRootDirectory = value; }
  149. }
  150. #endregion
  151. #region Constructors
  152. /// <summary>
  153. /// Initializes a new instance of WsdlWizardForm class with the specified values.
  154. /// </summary>
  155. /// <param name="xsdLocation">
  156. /// Location of the XSD file containing the message contract definitions for the WSDL.
  157. /// </param>
  158. public WsdlWizardForm(string xsdLocation)
  159. {
  160. //
  161. // Required for Windows Form Designer support.
  162. //
  163. InitializeComponent();
  164. schemaLocation = xsdLocation;
  165. this.UpdateCurrentFolder(schemaLocation);
  166. serviceInterfaceContract = new InterfaceContract();
  167. serviceInterfaceContract.SchemaNamespace = schemaLocation;
  168. }
  169. /// <summary>
  170. /// Initializes a new instance of WsdlWizardForm class with the specified values.
  171. /// </summary>
  172. /// <param name="wsdlLocation">Location of the WSDL file to modify.</param>
  173. /// <param name="roundTripping">
  174. /// Value indicating that the round tripping is required.
  175. /// </param>
  176. /// <remarks>
  177. /// The roundTripping parameter must be set to true in order to use the round tripping feature.
  178. /// </remarks>
  179. public WsdlWizardForm(string wsdlLocation, bool roundTripping)
  180. {
  181. //
  182. // Required for Windows Form Designer support.
  183. //
  184. InitializeComponent();
  185. // Import the interface contract from the selected WSDL file.
  186. try
  187. {
  188. this.importedContract =
  189. ServiceDescriptionEngine.GetInterfaceContract(wsdlLocation);
  190. this.wsdlFile = wsdlLocation;
  191. }
  192. catch(WsdlModifiedException ex)
  193. {
  194. throw new WsdlFileLoadException(
  195. "Could not import the specified WSDL file for round-triping.\nThis file is not compatible for round-tripping.", ex);
  196. }
  197. catch(WsdlNotCompatibleForRoundTrippingException ex)
  198. {
  199. throw new WsdlFileLoadException(
  200. "Could not import the specified WSDL file for round-triping.\nThis file is not compatible for round-tripping.", ex);
  201. }
  202. catch
  203. {
  204. throw new WsdlFileLoadException(
  205. "System could not import the specified WSDL file for round triping.\nThis file is either modified or not a valid WSDL file created using WSCF.exe.");
  206. }
  207. this.UpdateCurrentFolder(wsdlLocation);
  208. serviceInterfaceContract = new InterfaceContract();
  209. serviceInterfaceContract.SchemaNamespace = schemaLocation;
  210. this.roundtripMode = roundTripping;
  211. }
  212. #endregion
  213. #region Dispose
  214. /// <summary>
  215. /// Clean up any resources being used.
  216. /// </summary>
  217. protected override void Dispose( bool disposing )
  218. {
  219. if( disposing )
  220. {
  221. if(components != null)
  222. {
  223. components.Dispose();
  224. }
  225. }
  226. base.Dispose( disposing );
  227. }
  228. #endregion
  229. #region Windows Form Designer generated code
  230. /// <summary>
  231. /// Required method for Designer support - do not modify
  232. /// the contents of this method with the code editor.
  233. /// </summary>
  234. private void InitializeComponent()
  235. {
  236. this.components = new System.ComponentModel.Container();
  237. System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WsdlWizardForm));
  238. this.wsdlWizardCtrl = new WizardControl.Wizard();
  239. this.wizardPageBasicMetadata = new WizardControl.WizardPage();
  240. this.tbServiceDoc = new System.Windows.Forms.TextBox();
  241. this.lblServiceDoc = new System.Windows.Forms.Label();
  242. this.lblNamespace = new System.Windows.Forms.Label();
  243. this.tbNamespace = new System.Windows.Forms.TextBox();
  244. this.lblServiceName = new System.Windows.Forms.Label();
  245. this.tbServiceName = new System.Windows.Forms.TextBox();
  246. this.wizardPageSchemaImports = new WizardControl.WizardPage();
  247. this.groupBox2 = new System.Windows.Forms.GroupBox();
  248. this.llRemoveImport = new System.Windows.Forms.LinkLabel();
  249. this.llAddImport = new System.Windows.Forms.LinkLabel();
  250. this.importsListView = new Thinktecture.Tools.Wscf.UI.WsdlWizard.EditableListView();
  251. this.wizardPageOperationsList = new WizardControl.WizardPage();
  252. this.groupBox1 = new System.Windows.Forms.GroupBox();
  253. this.operationsListView = new Thinktecture.Tools.Wscf.UI.WsdlWizard.EditableListView();
  254. this.llAddOperation = new System.Windows.Forms.LinkLabel();
  255. this.llRemoveOperation = new System.Windows.Forms.LinkLabel();
  256. this.cbInfer = new System.Windows.Forms.CheckBox();
  257. this.panel1 = new System.Windows.Forms.Panel();
  258. this.tbEdit = new System.Windows.Forms.TextBox();
  259. this.cbMEPs = new System.Windows.Forms.ComboBox();
  260. this.wizardPageMessageMapping = new WizardControl.WizardPage();
  261. this.ptvServiceOperations = new WRM.Windows.Forms.PropertyTree();
  262. this.wizardPageAdditionalOptions = new WizardControl.WizardPage();
  263. this.cbSoap12 = new System.Windows.Forms.CheckBox();
  264. this.cbSoap11 = new System.Windows.Forms.CheckBox();
  265. this.cbNeedsServiceElement = new System.Windows.Forms.CheckBox();
  266. this.cbCodeGenDialog = new System.Windows.Forms.CheckBox();
  267. this.wizardPageAlternativeXSDPaths = new WizardControl.WizardPage();
  268. this.xsdpathsListView = new Thinktecture.Tools.Wscf.UI.WsdlWizard.EditableListView();
  269. this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
  270. this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
  271. this.toolTipPath = new System.Windows.Forms.ToolTip(this.components);
  272. this.wsdlWizardCtrl.SuspendLayout();
  273. this.wizardPageBasicMetadata.SuspendLayout();
  274. this.wizardPageSchemaImports.SuspendLayout();
  275. this.groupBox2.SuspendLayout();
  276. this.wizardPageOperationsList.SuspendLayout();
  277. this.groupBox1.SuspendLayout();
  278. this.panel1.SuspendLayout();
  279. this.wizardPageMessageMapping.SuspendLayout();
  280. ((System.ComponentModel.ISupportInitialize)(this.ptvServiceOperations)).BeginInit();
  281. this.wizardPageAdditionalOptions.SuspendLayout();
  282. this.wizardPageAlternativeXSDPaths.SuspendLayout();
  283. this.SuspendLayout();
  284. //
  285. // wsdlWizardCtrl
  286. //
  287. this.wsdlWizardCtrl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  288. | System.Windows.Forms.AnchorStyles.Left)
  289. | System.Windows.Forms.AnchorStyles.Right)));
  290. this.wsdlWizardCtrl.BannerBitmap = ((System.Drawing.Image)(resources.GetObject("wsdlWizardCtrl.BannerBitmap")));
  291. this.wsdlWizardCtrl.CloseForm = false;
  292. this.wsdlWizardCtrl.Controls.Add(this.wizardPageBasicMetadata);
  293. this.wsdlWizardCtrl.Controls.Add(this.wizardPageSchemaImports);
  294. this.wsdlWizardCtrl.Controls.Add(this.wizardPageOperationsList);
  295. this.wsdlWizardCtrl.Controls.Add(this.wizardPageMessageMapping);
  296. this.wsdlWizardCtrl.Controls.Add(this.wizardPageAdditionalOptions);
  297. this.wsdlWizardCtrl.Controls.Add(this.wizardPageAlternativeXSDPaths);
  298. this.wsdlWizardCtrl.Location = new System.Drawing.Point(0, 0);
  299. this.wsdlWizardCtrl.Name = "wsdlWizardCtrl";
  300. this.wsdlWizardCtrl.Size = new System.Drawing.Size(497, 360);
  301. this.wsdlWizardCtrl.TabIndex = 0;
  302. this.wsdlWizardCtrl.Title = "Generate WSDL";
  303. this.wsdlWizardCtrl.WelcomeBitmap = ((System.Drawing.Image)(resources.GetObject("wsdlWizardCtrl.WelcomeBitmap")));
  304. this.wsdlWizardCtrl.WelcomeText = resources.GetString("wsdlWizardCtrl.WelcomeText");
  305. this.wsdlWizardCtrl.BeforeSummaryPageDisplayed += new WizardControl.Wizard.BeforeSummaryPageDisplayedEventHandler(this.wsdlWizardCtrl_BeforeSummaryPageDisplayed);
  306. this.wsdlWizardCtrl.Finished += new WizardControl.Wizard.FinishedEventHandler(this.wsdlWizardCtrl_Finished);
  307. this.wsdlWizardCtrl.Load += new System.EventHandler(this.wsdlWizardCtrl_Load);
  308. this.wsdlWizardCtrl.Cancelled += new WizardControl.Wizard.CancelledEventHandler(this.wsdlWizardCtrl_Cancelled);
  309. this.wsdlWizardCtrl.BeforePageDisplayed += new WizardControl.Wizard.BeforePageDisplayedEventHandler(this.wsdlWizardCtrl_BeforePageDisplayed);
  310. this.wsdlWizardCtrl.AfterPageDisplayed += new WizardControl.Wizard.AfterPageDisplayedEventHandler(this.wsdlWizardCtrl_AfterPageDisplayed);
  311. this.wsdlWizardCtrl.ValidatePage += new WizardControl.Wizard.ValidatePageEventHandler(this.wsdlWizardCtrl_ValidatePage);
  312. //
  313. // wizardPageBasicMetadata
  314. //
  315. this.wizardPageBasicMetadata.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  316. | System.Windows.Forms.AnchorStyles.Left)
  317. | System.Windows.Forms.AnchorStyles.Right)));
  318. this.wizardPageBasicMetadata.Controls.Add(this.tbServiceDoc);
  319. this.wizardPageBasicMetadata.Controls.Add(this.lblServiceDoc);
  320. this.wizardPageBasicMetadata.Controls.Add(this.lblNamespace);
  321. this.wizardPageBasicMetadata.Controls.Add(this.tbNamespace);
  322. this.wizardPageBasicMetadata.Controls.Add(this.lblServiceName);
  323. this.wizardPageBasicMetadata.Controls.Add(this.tbServiceName);
  324. this.wizardPageBasicMetadata.Description = "Please enter the name and the XML namespace of the Web Service.";
  325. this.wizardPageBasicMetadata.Heading = "Step 1: Specify your Web Service\'s basic settings";
  326. this.wizardPageBasicMetadata.Location = new System.Drawing.Point(21, 71);
  327. this.wizardPageBasicMetadata.Name = "wizardPageBasicMetadata";
  328. this.wizardPageBasicMetadata.Size = new System.Drawing.Size(456, 230);
  329. this.wizardPageBasicMetadata.TabIndex = 0;
  330. //
  331. // tbServiceDoc
  332. //
  333. this.tbServiceDoc.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  334. | System.Windows.Forms.AnchorStyles.Left)
  335. | System.Windows.Forms.AnchorStyles.Right)));
  336. this.tbServiceDoc.Location = new System.Drawing.Point(120, 72);
  337. this.tbServiceDoc.Multiline = true;
  338. this.tbServiceDoc.Name = "tbServiceDoc";
  339. this.tbServiceDoc.Size = new System.Drawing.Size(312, 88);
  340. this.tbServiceDoc.TabIndex = 5;
  341. //
  342. // lblServiceDoc
  343. //
  344. this.lblServiceDoc.Location = new System.Drawing.Point(24, 72);
  345. this.lblServiceDoc.Name = "lblServiceDoc";
  346. this.lblServiceDoc.Size = new System.Drawing.Size(100, 23);
  347. this.lblServiceDoc.TabIndex = 4;
  348. this.lblServiceDoc.Text = "Documentation:";
  349. //
  350. // lblNamespace
  351. //
  352. this.lblNamespace.Location = new System.Drawing.Point(24, 40);
  353. this.lblNamespace.Name = "lblNamespace";
  354. this.lblNamespace.Size = new System.Drawing.Size(96, 23);
  355. this.lblNamespace.TabIndex = 3;
  356. this.lblNamespace.Text = "XML namespace:";
  357. //
  358. // tbNamespace
  359. //
  360. this.tbNamespace.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  361. | System.Windows.Forms.AnchorStyles.Right)));
  362. this.tbNamespace.Location = new System.Drawing.Point(120, 40);
  363. this.tbNamespace.Name = "tbNamespace";
  364. this.tbNamespace.Size = new System.Drawing.Size(312, 20);
  365. this.tbNamespace.TabIndex = 2;
  366. //
  367. // lblServiceName
  368. //
  369. this.lblServiceName.Location = new System.Drawing.Point(24, 8);
  370. this.lblServiceName.Name = "lblServiceName";
  371. this.lblServiceName.Size = new System.Drawing.Size(88, 23);
  372. this.lblServiceName.TabIndex = 1;
  373. this.lblServiceName.Text = "Service name:";
  374. this.toolTip1.SetToolTip(this.lblServiceName, "\'Service name\' specifies the name of the Web Service binding to be generated. Thi" +
  375. "s will be the e.g. the class name for your Web Service proxy when generated from" +
  376. " the service description.");
  377. //
  378. // tbServiceName
  379. //
  380. this.tbServiceName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  381. | System.Windows.Forms.AnchorStyles.Right)));
  382. this.tbServiceName.Location = new System.Drawing.Point(120, 6);
  383. this.tbServiceName.Name = "tbServiceName";
  384. this.tbServiceName.Size = new System.Drawing.Size(312, 20);
  385. this.tbServiceName.TabIndex = 0;
  386. this.toolTip1.SetToolTip(this.tbServiceName, "\'Service name\' specifies the name of the Web Service binding to be generated. Thi" +
  387. "s will be the e.g. the class name for your Web Service proxy when generated from" +
  388. " the service description.");
  389. //
  390. // wizardPageSchemaImports
  391. //
  392. this.wizardPageSchemaImports.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  393. | System.Windows.Forms.AnchorStyles.Left)
  394. | System.Windows.Forms.AnchorStyles.Right)));
  395. this.wizardPageSchemaImports.Controls.Add(this.groupBox2);
  396. this.wizardPageSchemaImports.Cursor = System.Windows.Forms.Cursors.Default;
  397. this.wizardPageSchemaImports.Description = "Please add additional message schemas from XSD files as appropriate.";
  398. this.wizardPageSchemaImports.Heading = "Step 2: Specify additional message schemas";
  399. this.wizardPageSchemaImports.Location = new System.Drawing.Point(21, 71);
  400. this.wizardPageSchemaImports.Name = "wizardPageSchemaImports";
  401. this.wizardPageSchemaImports.Size = new System.Drawing.Size(456, 230);
  402. this.wizardPageSchemaImports.TabIndex = 2;
  403. //
  404. // groupBox2
  405. //
  406. this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  407. | System.Windows.Forms.AnchorStyles.Left)
  408. | System.Windows.Forms.AnchorStyles.Right)));
  409. this.groupBox2.Controls.Add(this.llRemoveImport);
  410. this.groupBox2.Controls.Add(this.llAddImport);
  411. this.groupBox2.Controls.Add(this.importsListView);
  412. this.groupBox2.Location = new System.Drawing.Point(8, 3);
  413. this.groupBox2.Name = "groupBox2";
  414. this.groupBox2.Size = new System.Drawing.Size(440, 224);
  415. this.groupBox2.TabIndex = 2;
  416. this.groupBox2.TabStop = false;
  417. this.groupBox2.Text = "XSD Imports:";
  418. //
  419. // llRemoveImport
  420. //
  421. this.llRemoveImport.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  422. this.llRemoveImport.Location = new System.Drawing.Point(95, 205);
  423. this.llRemoveImport.Name = "llRemoveImport";
  424. this.llRemoveImport.Size = new System.Drawing.Size(100, 16);
  425. this.llRemoveImport.TabIndex = 4;
  426. this.llRemoveImport.TabStop = true;
  427. this.llRemoveImport.Text = "Remove import";
  428. this.llRemoveImport.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.llRemoveImport_LinkClicked);
  429. //
  430. // llAddImport
  431. //
  432. this.llAddImport.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  433. this.llAddImport.Location = new System.Drawing.Point(8, 205);
  434. this.llAddImport.Name = "llAddImport";
  435. this.llAddImport.Size = new System.Drawing.Size(81, 15);
  436. this.llAddImport.TabIndex = 3;
  437. this.llAddImport.TabStop = true;
  438. this.llAddImport.Text = "Add import";
  439. this.llAddImport.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.llAddImport_LinkClicked);
  440. //
  441. // importsListView
  442. //
  443. this.importsListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  444. | System.Windows.Forms.AnchorStyles.Left)
  445. | System.Windows.Forms.AnchorStyles.Right)));
  446. this.importsListView.DisabledColumns = ((System.Collections.ArrayList)(resources.GetObject("importsListView.DisabledColumns")));
  447. this.importsListView.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
  448. this.importsListView.FullRowSelect = true;
  449. this.importsListView.GridLines = true;
  450. this.importsListView.Location = new System.Drawing.Point(8, 16);
  451. this.importsListView.Name = "importsListView";
  452. this.importsListView.Size = new System.Drawing.Size(424, 184);
  453. this.importsListView.TabIndex = 2;
  454. this.importsListView.UseCompatibleStateImageBehavior = false;
  455. this.importsListView.View = System.Windows.Forms.View.Details;
  456. this.importsListView.MouseMove += new System.Windows.Forms.MouseEventHandler(this.importsListView_MouseMove);
  457. //
  458. // wizardPageOperationsList
  459. //
  460. this.wizardPageOperationsList.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  461. | System.Windows.Forms.AnchorStyles.Left)
  462. | System.Windows.Forms.AnchorStyles.Right)));
  463. this.wizardPageOperationsList.Controls.Add(this.groupBox1);
  464. this.wizardPageOperationsList.Controls.Add(this.panel1);
  465. this.wizardPageOperationsList.Description = "Please add operations to the Web Service as needed.";
  466. this.wizardPageOperationsList.Heading = "Step 3: Specify settings for your Web Service\'s operations.";
  467. this.wizardPageOperationsList.Location = new System.Drawing.Point(21, 71);
  468. this.wizardPageOperationsList.Name = "wizardPageOperationsList";
  469. this.wizardPageOperationsList.Size = new System.Drawing.Size(456, 230);
  470. this.wizardPageOperationsList.TabIndex = 1;
  471. //
  472. // groupBox1
  473. //
  474. this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  475. | System.Windows.Forms.AnchorStyles.Left)
  476. | System.Windows.Forms.AnchorStyles.Right)));
  477. this.groupBox1.Controls.Add(this.operationsListView);
  478. this.groupBox1.Controls.Add(this.llAddOperation);
  479. this.groupBox1.Controls.Add(this.llRemoveOperation);
  480. this.groupBox1.Controls.Add(this.cbInfer);
  481. this.groupBox1.Location = new System.Drawing.Point(8, 3);
  482. this.groupBox1.Name = "groupBox1";
  483. this.groupBox1.Size = new System.Drawing.Size(440, 224);
  484. this.groupBox1.TabIndex = 4;
  485. this.groupBox1.TabStop = false;
  486. this.groupBox1.Text = "Operations:";
  487. //
  488. // operationsListView
  489. //
  490. this.operationsListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  491. | System.Windows.Forms.AnchorStyles.Left)
  492. | System.Windows.Forms.AnchorStyles.Right)));
  493. this.operationsListView.DisabledColumns = ((System.Collections.ArrayList)(resources.GetObject("operationsListView.DisabledColumns")));
  494. this.operationsListView.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
  495. this.operationsListView.FullRowSelect = true;
  496. this.operationsListView.GridLines = true;
  497. this.operationsListView.Location = new System.Drawing.Point(8, 16);
  498. this.operationsListView.Name = "operationsListView";
  499. this.operationsListView.Size = new System.Drawing.Size(424, 184);
  500. this.operationsListView.TabIndex = 0;
  501. this.operationsListView.UseCompatibleStateImageBehavior = false;
  502. this.operationsListView.View = System.Windows.Forms.View.Details;
  503. //
  504. // llAddOperation
  505. //
  506. this.llAddOperation.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  507. this.llAddOperation.Location = new System.Drawing.Point(7, 205);
  508. this.llAddOperation.Name = "llAddOperation";
  509. this.llAddOperation.Size = new System.Drawing.Size(81, 15);
  510. this.llAddOperation.TabIndex = 1;
  511. this.llAddOperation.TabStop = true;
  512. this.llAddOperation.Text = "Add operation";
  513. this.llAddOperation.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.llAddOperation_LinkClicked);
  514. //
  515. // llRemoveOperation
  516. //
  517. this.llRemoveOperation.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  518. this.llRemoveOperation.Location = new System.Drawing.Point(95, 205);
  519. this.llRemoveOperation.Name = "llRemoveOperation";
  520. this.llRemoveOperation.Size = new System.Drawing.Size(100, 16);
  521. this.llRemoveOperation.TabIndex = 2;
  522. this.llRemoveOperation.TabStop = true;
  523. this.llRemoveOperation.Text = "Remove operation";
  524. this.llRemoveOperation.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.llRemoveOperation_LinkClicked);
  525. //
  526. // cbInfer
  527. //
  528. this.cbInfer.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
  529. this.cbInfer.Location = new System.Drawing.Point(336, 204);
  530. this.cbInfer.Name = "cbInfer";
  531. this.cbInfer.Size = new System.Drawing.Size(104, 16);
  532. this.cbInfer.TabIndex = 4;
  533. this.cbInfer.Text = "Infer Operations";
  534. this.cbInfer.CheckedChanged += new System.EventHandler(this.cbInfer_CheckedChanged);
  535. //
  536. // panel1
  537. //
  538. this.panel1.Controls.Add(this.tbEdit);
  539. this.panel1.Controls.Add(this.cbMEPs);
  540. this.panel1.Location = new System.Drawing.Point(24, 32);
  541. this.panel1.Name = "panel1";
  542. this.panel1.Size = new System.Drawing.Size(408, 192);
  543. this.panel1.TabIndex = 2;
  544. //
  545. // tbEdit
  546. //
  547. this.tbEdit.Location = new System.Drawing.Point(16, 16);
  548. this.tbEdit.Name = "tbEdit";
  549. this.tbEdit.Size = new System.Drawing.Size(100, 20);
  550. this.tbEdit.TabIndex = 3;
  551. this.tbEdit.Text = "textBox2";
  552. this.tbEdit.Visible = false;
  553. //
  554. // cbMEPs
  555. //
  556. this.cbMEPs.ItemHeight = 13;
  557. this.cbMEPs.Items.AddRange(new object[] {
  558. "Request/Response",
  559. "One-Way"});
  560. this.cbMEPs.Location = new System.Drawing.Point(272, 16);
  561. this.cbMEPs.Name = "cbMEPs";
  562. this.cbMEPs.Size = new System.Drawing.Size(121, 21);
  563. this.cbMEPs.TabIndex = 2;
  564. this.cbMEPs.Text = "comboBox1";
  565. this.cbMEPs.Visible = false;
  566. //
  567. // wizardPageMessageMapping
  568. //
  569. this.wizardPageMessageMapping.Controls.Add(this.ptvServiceOperations);
  570. this.wizardPageMessageMapping.Description = "Please enter all details for the service\'s operations and messages.";
  571. this.wizardPageMessageMapping.Heading = "Step 4: Specify the operation\'s message parameters";
  572. this.wizardPageMessageMapping.Location = new System.Drawing.Point(21, 71);
  573. this.wizardPageMessageMapping.Name = "wizardPageMessageMapping";
  574. this.wizardPageMessageMapping.Size = new System.Drawing.Size(456, 230);
  575. this.wizardPageMessageMapping.TabIndex = 3;
  576. //
  577. // ptvServiceOperations
  578. //
  579. this.ptvServiceOperations.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  580. | System.Windows.Forms.AnchorStyles.Left)
  581. | System.Windows.Forms.AnchorStyles.Right)));
  582. this.ptvServiceOperations.ImageList = null;
  583. this.ptvServiceOperations.Indent = 19;
  584. this.ptvServiceOperations.Location = new System.Drawing.Point(0, -1);
  585. this.ptvServiceOperations.Name = "ptvServiceOperations";
  586. this.ptvServiceOperations.PaneHeaderVisible = false;
  587. this.ptvServiceOperations.SelectedImageIndex = -1;
  588. this.ptvServiceOperations.SelectedPaneNode = null;
  589. this.ptvServiceOperations.ShowLines = true;
  590. this.ptvServiceOperations.ShowPlusMinus = true;
  591. this.ptvServiceOperations.ShowRootLines = true;
  592. this.ptvServiceOperations.Size = new System.Drawing.Size(456, 232);
  593. this.ptvServiceOperations.SplitterColor = System.Drawing.SystemColors.AppWorkspace;
  594. this.ptvServiceOperations.SplitterLeft = 184;
  595. this.ptvServiceOperations.TabIndex = 1;
  596. //
  597. // wizardPageAdditionalOptions
  598. //
  599. this.wizardPageAdditionalOptions.Controls.Add(this.cbSoap12);
  600. this.wizardPageAdditionalOptions.Controls.Add(this.cbSoap11);
  601. this.wizardPageAdditionalOptions.Controls.Add(this.cbNeedsServiceElement);
  602. this.wizardPageAdditionalOptions.Controls.Add(this.cbCodeGenDialog);
  603. this.wizardPageAdditionalOptions.Description = "Please select any additional options to configure.";
  604. this.wizardPageAdditionalOptions.Heading = "Step 5: Additional options";
  605. this.wizardPageAdditionalOptions.Location = new System.Drawing.Point(21, 71);
  606. this.wizardPageAdditionalOptions.Name = "wizardPageAdditionalOptions";
  607. this.wizardPageAdditionalOptions.Size = new System.Drawing.Size(456, 230);
  608. this.wizardPageAdditionalOptions.TabIndex = 4;
  609. //
  610. // cbSoap12
  611. //
  612. this.cbSoap12.AutoSize = true;
  613. this.cbSoap12.Location = new System.Drawing.Point(24, 87);
  614. this.cbSoap12.Name = "cbSoap12";
  615. this.cbSoap12.Size = new System.Drawing.Size(144, 17);
  616. this.cbSoap12.TabIndex = 12;
  617. this.cbSoap12.Text = "Create SOAP 1.2 binding";
  618. this.cbSoap12.UseVisualStyleBackColor = true;
  619. //
  620. // cbSoap11
  621. //
  622. this.cbSoap11.AutoSize = true;
  623. this.cbSoap11.Checked = true;
  624. this.cbSoap11.CheckState = System.Windows.Forms.CheckState.Checked;
  625. this.cbSoap11.Enabled = false;
  626. this.cbSoap11.Location = new System.Drawing.Point(24, 51);
  627. this.cbSoap11.Name = "cbSoap11";
  628. this.cbSoap11.Size = new System.Drawing.Size(144, 17);
  629. this.cbSoap11.TabIndex = 11;
  630. this.cbSoap11.Text = "Create SOAP 1.1 binding";
  631. this.cbSoap11.UseVisualStyleBackColor = true;
  632. //
  633. // cbNeedsServiceElement
  634. //
  635. this.cbNeedsServiceElement.Location = new System.Drawing.Point(24, 8);
  636. this.cbNeedsServiceElement.Name = "cbNeedsServiceElement";
  637. this.cbNeedsServiceElement.Size = new System.Drawing.Size(192, 24);
  638. this.cbNeedsServiceElement.TabIndex = 10;
  639. this.cbNeedsServiceElement.Text = "Generate <service> element.";
  640. this.toolTip1.SetToolTip(this.cbNeedsServiceElement, "Enable this option if you want to have a <service> element generated for the WSDL" +
  641. " service description.");
  642. //
  643. // cbCodeGenDialog
  644. //
  645. this.cbCodeGenDialog.Location = new System.Drawing.Point(24, 169);
  646. this.cbCodeGenDialog.Name = "cbCodeGenDialog";
  647. this.cbCodeGenDialog.Size = new System.Drawing.Size(408, 24);
  648. this.cbCodeGenDialog.TabIndex = 6;
  649. this.cbCodeGenDialog.Text = "Open the code generation dialog after this wizard closes.";
  650. this.cbCodeGenDialog.CheckedChanged += new System.EventHandler(this.cbCodeGenDialog_CheckedChanged);
  651. //
  652. // wizardPageAlternativeXSDPaths
  653. //
  654. this.wizardPageAlternativeXSDPaths.Controls.Add(this.xsdpathsListView);
  655. this.wizardPageAlternativeXSDPaths.Description = "Please select the alternative XSD path for each XSD file imported.";
  656. this.wizardPageAlternativeXSDPaths.Heading = "Step 6: Alternative XSD Paths";
  657. this.wizardPageAlternativeXSDPaths.Location = new System.Drawing.Point(21, 71);
  658. this.wizardPageAlternativeXSDPaths.Name = "wizardPageAlternativeXSDPaths";
  659. this.wizardPageAlternativeXSDPaths.Size = new System.Drawing.Size(456, 230);
  660. this.wizardPageAlternativeXSDPaths.TabIndex = 5;
  661. //
  662. // xsdpathsListView
  663. //
  664. this.xsdpathsListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  665. | System.Windows.Forms.AnchorStyles.Left)
  666. | System.Windows.Forms.AnchorStyles.Right)));
  667. this.xsdpathsListView.DisabledColumns = ((System.Collections.ArrayList)(resources.GetObject("xsdpathsListView.DisabledColumns")));
  668. this.xsdpathsListView.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
  669. this.xsdpathsListView.FullRowSelect = true;
  670. this.xsdpathsListView.GridLines = true;
  671. this.xsdpathsListView.Location = new System.Drawing.Point(0, 0);
  672. this.xsdpathsListView.Name = "xsdpathsListView";
  673. this.xsdpathsListView.Size = new System.Drawing.Size(456, 224);
  674. this.xsdpathsListView.TabIndex = 3;
  675. this.xsdpathsListView.UseCompatibleStateImageBehavior = false;
  676. this.xsdpathsListView.View = System.Windows.Forms.View.Details;
  677. //
  678. // openFileDialog1
  679. //
  680. this.openFileDialog1.Filter = "XSD Files(*.xsd)|*.xsd";
  681. //
  682. // toolTipPath
  683. //
  684. this.toolTipPath.AutomaticDelay = 1000;
  685. //
  686. // WsdlWizardForm
  687. //
  688. this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
  689. this.ClientSize = new System.Drawing.Size(497, 360);
  690. this.Controls.Add(this.wsdlWizardCtrl);
  691. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
  692. this.HelpButton = true;
  693. this.Name = "WsdlWizardForm";
  694. this.ShowInTaskbar = false;
  695. this.Text = "Create a WSDL Interface Description";
  696. this.Closing += new System.ComponentModel.CancelEventHandler(this.WsdlWizardForm_Closing);
  697. this.Load += new System.EventHandler(this.WSDLWizard_Load);
  698. this.wsdlWizardCtrl.ResumeLayout(false);
  699. this.wizardPageBasicMetadata.ResumeLayout(false);
  700. this.wizardPageBasicMetadata.PerformLayout();
  701. this.wizardPageSchemaImports.ResumeLayout(false);
  702. this.groupBox2.ResumeLayout(false);
  703. this.wizardPageOperationsList.ResumeLayout(false);
  704. this.groupBox1.ResumeLayout(false);
  705. this.panel1.ResumeLayout(false);
  706. this.panel1.PerformLayout();
  707. this.wizardPageMessageMapping.ResumeLayout(false);
  708. ((System.ComponentModel.ISupportInitialize)(this.ptvServiceOperations)).EndInit();
  709. this.wizardPageAdditionalOptions.ResumeLayout(false);
  710. this.wizardPageAdditionalOptions.PerformLayout();
  711. this.wizardPageAlternativeXSDPaths.ResumeLayout(false);
  712. this.ResumeLayout(false);
  713. }
  714. #endregion
  715. #region Event handlers
  716. /// <summary>
  717. /// Performs the actions on loading the WSDL wizard.
  718. /// </summary>
  719. /// <param name="sender">Source of the event.</param>
  720. /// <param name="e">An instance of <see cref="EventArgs"/> class with the event data.</param>
  721. /// <remarks>If the round tripping mode is on, this method imports the data from the existing
  722. /// WSDL file to the UI.</remarks>
  723. private void WSDLWizard_Load(object sender, EventArgs e)
  724. {
  725. ptvServiceOperations.PaneHeaderVisible = true;
  726. // If the round tripping mode is on then import the data from the existing WSDL to the UI.
  727. if (this.roundtripMode)
  728. {
  729. if (importedContract.IsHttpBinding)
  730. {
  731. if (MessageBox.Show(this,
  732. "This WSDL contains an HTTP binding. It will be converted to a SOAP binding.\nAre you sure you want to perform this action?",
  733. "WSDL Wizard", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation) ==
  734. DialogResult.Cancel)
  735. {
  736. this.DialogResult = DialogResult.Cancel;
  737. this.Close();
  738. }
  739. }
  740. ImportBasicServiceMetaData();
  741. if (!ImportSchemaImports())
  742. {
  743. this.DialogResult = DialogResult.Retry;
  744. this.Close();
  745. return;
  746. }
  747. ImportOperations();
  748. ImportAdditionalOptions();
  749. ImportEmbeddedTypes();
  750. }
  751. }
  752. /// <summary>
  753. /// Performs the actions before the summery page is loaded.
  754. /// </summary>
  755. /// <param name="sender">Source of the event.</param>
  756. /// <param name="e">An instance of <see cref="WizardPageSummaryEventArgs"/> with event data.</param>
  757. private void wsdlWizardCtrl_BeforeSummaryPageDisplayed(object sender, WizardPageSummaryEventArgs e)
  758. {
  759. openCodeGenDialog = cbCodeGenDialog.Checked;
  760. // Assign the modified alternative Xsd paths.
  761. foreach (ListViewItem li in xsdpathsListView.Items)
  762. {
  763. serviceInterfaceContract.Imports[li.Index].AlternateLocation =
  764. li.SubItems[1].Text;
  765. }
  766. }
  767. /// <summary>
  768. /// Performs the actions prior to displaying each page on the wizard control.
  769. /// </summary>
  770. /// <param name="sender">The source of the event.</param>
  771. /// <param name="e">An instance of <see cref="WizardPageDisplayedEventArgs"/> class with event data.</param>
  772. private void wsdlWizardCtrl_BeforePageDisplayed(object sender, WizardPageDisplayedEventArgs e)
  773. {
  774. // Assign the basic meta data values to the instance of InterfaceContract class.
  775. if (e.Page == wizardPageSchemaImports)
  776. {
  777. bool isValid = InterfaceContract.ValidateUri(tbNamespace.Text);
  778. if (!isValid)
  779. {
  780. DisplayError("Invalid uri for the namespace. Enter a valid uri and try again.");
  781. e.Cancel = true;
  782. return;
  783. }
  784. serviceInterfaceContract.InitializeServiceInfo(tbServiceName.Text, tbNamespace.Text, schemaNamespace, tbServiceDoc.Text);
  785. return;
  786. }
  787. if (e.Page == wizardPageOperationsList)
  788. {
  789. try
  790. {
  791. //Load the dropdown for the operation types
  792. LoadOperationsListViewWithMEP();
  793. AddSchemasToContract();
  794. }
  795. catch (Exception ex)
  796. {
  797. DisplayError(ex.Message);
  798. e.Cancel = true;
  799. return;
  800. }
  801. }
  802. if (e.Page == wizardPageMessageMapping)
  803. {
  804. try
  805. {
  806. //Update the list of operations prior to setting up the panes
  807. UpdateOperations();
  808. // Setup the dynamic UI controls for the operation - message mapping UI.
  809. SetupOperationsMessagesPanes();
  810. if (ptvServiceOperations.PaneNodes.Count > 0)
  811. {
  812. ptvServiceOperations.SelectedPaneNode = ptvServiceOperations.PaneNodes[0];
  813. ptvServiceOperations.PaneNodes[0].Expanded = true;
  814. }
  815. }
  816. catch (Exception ex)
  817. {
  818. MessageBox.Show(ex.Message);
  819. }
  820. return;
  821. }
  822. if (e.Page == wizardPageAdditionalOptions)
  823. {
  824. cbCodeGenDialog.Checked = this.roundtripMode;
  825. return;
  826. }
  827. if (e.Page == wizardPageAlternativeXSDPaths)
  828. {
  829. xsdpathsListView.Items.Clear();
  830. if (serviceInterfaceContract.Imports.Count > 0)
  831. {
  832. foreach (SchemaImport import in serviceInterfaceContract.Imports)
  833. {
  834. ListViewItem li = new ListViewItem(import.SchemaName);
  835. li.SubItems.Add(import.AlternateLocation);
  836. xsdpathsListView.Items.Add(li);
  837. }
  838. }
  839. else
  840. {
  841. wsdlWizardCtrl.AdvancePage();
  842. }
  843. return;
  844. }
  845. }
  846. /// <summary>
  847. /// Performs the validation before navigating to another page on the wizard control.
  848. /// </summary>
  849. /// <param name="sender">Source of the event.</param>
  850. /// <param name="e">An instance of <see cref="WizardPageSummaryEventArgs"/> with event data.</param>
  851. private void wsdlWizardCtrl_ValidatePage(object sender, WizardPageValidateEventArgs e)
  852. {
  853. // Validate the basic metadata.
  854. if (e.Page == wizardPageBasicMetadata)
  855. {
  856. if (tbServiceName.Text.Length == 0 || tbNamespace.Text.Length == 0)
  857. {
  858. MessageBox.Show("Please enter valid values.", "WSDL Wizard", MessageBoxButtons.OK,
  859. MessageBoxIcon.Exclamation);
  860. e.NextPage = 1;
  861. }
  862. }
  863. // Validate the operations list.
  864. if (e.Page == wizardPageOperationsList)
  865. {
  866. if (operationsListView.Items.Count == 0)
  867. {
  868. MessageBox.Show("Please specify any operations.", "WSDL Wizard", MessageBoxButtons.OK,
  869. MessageBoxIcon.Exclamation);
  870. e.NextPage = 3;
  871. }
  872. }
  873. // Validate the imported schemas list.
  874. if (e.Page == wizardPageSchemaImports)
  875. {
  876. if (serviceInterfaceContract.MessageSchemas.Count == 0 && importsListView.Items.Count == 0)
  877. {
  878. MessageBox.Show("Please add at least one XSD file.", "WSDL Wizard", MessageBoxButtons.OK,
  879. MessageBoxIcon.Exclamation);
  880. e.NextPage = 2;
  881. }
  882. }
  883. }
  884. /// <summary>
  885. /// Performs the actions after displaying a wizard page.
  886. /// </summary>
  887. /// <param name="sender">The source of the event.</param>
  888. /// <param name="e">An instance of <see cref="WizardPageEventArgs"/> with event data.</param>
  889. private void wsdlWizardCtrl_AfterPageDisplayed(object sender, WizardPageEventArgs e)
  890. {
  891. if (e.Page == wizardPageBasicMetadata)
  892. {
  893. tbServiceName.Focus();
  894. return;
  895. }
  896. if (e.Page == wizardPageAdditionalOptions)
  897. {
  898. if (ptvServiceOperations.PaneNodes.Count > 0)
  899. ptvServiceOperations.SelectedPaneNode = ptvServiceOperations.PaneNodes[0];
  900. }
  901. }
  902. /// <summary>
  903. /// Performs the actions upon closing the main wizard form.
  904. /// </summary>
  905. /// <param name="sender">The source of the event.</param>
  906. /// <param name="e">An instance of <see cref="CancelEventArgs"/> with event data.</param>
  907. /// <remarks>This method shows the confirmation dialog box , if the form is closed using the "Close" button.</remarks>
  908. private void WsdlWizardForm_Closing(object sender, CancelEventArgs e)
  909. {
  910. if (!alreadyCancelled)
  911. {
  912. if (MessageBox.Show("Do you really want to quit?",
  913. "WSDL Wizard", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
  914. {
  915. e.Cancel = true;
  916. }
  917. }
  918. }
  919. /// <summary>
  920. /// Performs the necessary initialization when the wizard control loads.
  921. /// </summary>
  922. /// <param name="sender">The source of the event.</param>
  923. /// <param name="e">An instance of <see cref="EventArgs"/> class with event data.</param>
  924. private void wsdlWizardCtrl_Load(object sender, EventArgs e)
  925. {
  926. // Add the columns to the operationsListView.
  927. operationsListView.Columns.Add("Operation Name", 210, HorizontalAlignment.Left);
  928. operationsListView.Columns.Add("Message Exchange Pattern", -2, HorizontalAlignment.Left);
  929. // Add the columns to the importsListView.
  930. importsListView.Columns.Add("File Name", 210, HorizontalAlignment.Left);
  931. importsListView.Columns.Add("Location", -1, HorizontalAlignment.Left);
  932. // Set the non editable columns.
  933. importsListView.DisabledColumns.Add("File Name");
  934. importsListView.DisabledColumns.Add("Location");
  935. // Add the columns to the xsdpathsListView.
  936. xsdpathsListView.Columns.Add("File Name", 210, HorizontalAlignment.Left);
  937. xsdpathsListView.Columns.Add("Alternative Path", -2, HorizontalAlignment.Left);
  938. // Set the non editable columns.
  939. xsdpathsListView.DisabledColumns.Add("File Name");
  940. // Load the default XSD to the schema imports list.
  941. string fname = schemaLocatio

Large files files are truncated, but you can click here to view the full file