public void Handle(PaneVisibilityChangedEvent args)
        {
            if (args.IsVisible == false)
            {
                return;
            }

            switch (args.Pane)
            {
            case Pane.Navigation:
                NavigationPane.Show();
                break;

            case Pane.Filter:
                FilterPane.Show();
                break;

            case Pane.Layout:
                LayoutPane.Show();
                break;

            case Pane.Legend:
                LegendPane.Show();
                break;

            case Pane.Property:
                PropertyPane.Show();
                break;
            }
        }
			/// <summary>
			/// Initializes a new instance of MessageNameTextBoxController class with the specified values.
			/// </summary>
			/// <param name="messageNameTextBox">Reference to the text box which contains the message name.</param>
			/// <param name="messageNameCheckBox">Reference to the check box which indicates whether the customized message name is used or not.</param>
			/// <param name="message">Reference to the current <see cref="Message"/>.</param>
			/// <param name="messageLabel">Reference to the tree view node which displays the message name.</param>
			public MessageNameTextBoxController(TextBox messageNameTextBox, 
				CheckBox messageNameCheckBox, Message message, 
				PropertyPane messageLabel)
			{
				currentTextBox = messageNameTextBox;
				currentCheckBox = messageNameCheckBox;
				currentMessageLabel = messageLabel;
				initialName = currentTextBox.Text;
				this.message = message;

				// Attach the event handlers for the controls.
				currentCheckBox.CheckedChanged += new EventHandler(CheckBox_CheckedChanged);
				currentTextBox.TextChanged += new EventHandler(TextBox_TextChanged);
			}
			/// <summary>
			/// Initializes a new instance of the MessagePaneLabelController with the specified values.
			/// </summary>
			/// <param name="messageTextBox">Reference to the Textbox to control.</param>
			/// <param name="messageLabel">Reference to the PropertyPane to control.</param>
			public MessagePaneLabelController(TextBox messageTextBox,
				PropertyPane messageLabel)
			{
				currentTextBox = messageTextBox;
				currentLabel = messageLabel;

				// Attach the event handler for the current text box's lost focus event.
				currentTextBox.LostFocus += new EventHandler(TextBox_FocusOver);
			}
        /// <summary>
        /// Imports the message parameters for a specified operation from an existing WSDL. 
        /// </summary>
        /// <param name="operations">Collection of operations to import the message parameters from.</param>
        /// <param name="op">The <see cref="Operation"/> to import the message parameters in to.</param>
        /// <param name="output">Indicates whether the current message is input or output.</param>
        /// <param name="parametersCombo">Reference to the combo box which contains the message parameters.</param>
        /// <param name="chkName">Reference to the check box, which indicates whether the customized message name is selected or not.</param>
        /// <param name="tbName">Reference to the text box which contains the customized message name. </param>
        /// <param name="messageLabel">Reference to the Property Pane which contains the message name.</param>
        /// <param name="opDocumentation">Reference to the text box which contains the <see cref="Operation"/>'s documentation.</param>
        /// <param name="msgDocumentation">Reference to the text box which contains the <see cref="Message"/>'s documentation.</param>
        /// <returns>A boolean indicating whether any message parameter is imported or not.</returns>
        /// <param name="originalOperationName">String which contains the original name of the operation. User can always change the operation name after infering operations or while round-tripping. This parameter contains the name of the operation before any of those alternations.</param>		
        private bool ImportMessageParameter(IEnumerable<Operation> operations, Operation op, bool output,
            ComboBox parametersCombo, CheckBox chkName, TextBox tbName, PropertyPane messageLabel,
            TextBox opDocumentation, TextBox msgDocumentation, string originalOperationName)
        {
            foreach (Operation importedOp in operations)
            {
                if (importedOp.Name == op.Name || (originalOperationName != "" && importedOp.Name == originalOperationName))
                {
                    // Identify the message from the message collection.
                    Message importedMsg = null;
                    Message msg = null;
                    if (!output)
                    {
                        importedMsg = importedOp.Input;
                        msg = op.Input;
                    }
                    else
                    {
                        importedMsg = importedOp.Output;
                        msg = op.Output;
                    }

                    if (importedMsg != null)
                    {
                        // Set the new message parameters.
                        int index = 0;
                        foreach (SchemaElement element in serviceInterfaceContract.MessageSchemas)
                        {
                            if (importedMsg.Element == element)
                            {
                                msg.Element = element;
                                parametersCombo.SelectedIndex = index;
                                break;
                            }
                            index++;
                        }

                        // Enable the custom name text box and put the custom message name in.

                        if (importedOp.Name == op.Name && msg.Name != importedMsg.Name)
                        {
                            tbName.Enabled = true;
                            tbName.Text = importedMsg.Name;
                            msg.Name = importedMsg.Name;
                            messageLabel.Text = importedMsg.Name;
                            chkName.Checked = true;
                        }

                        // Set the Message documentation.
                        msg.Documentation = importedMsg.Documentation;
                        msgDocumentation.Text = importedMsg.Documentation;
                    }

                    // Set the operation documentation.
                    op.Documentation = importedOp.Documentation;
                    opDocumentation.Text = importedOp.Documentation;

                    return true;
                }
            }

            return false;
        }
        // used to load the operation panes

        /// <summary>
        /// Imports the message parameters for a specified operation from an existing WSDL. 
        /// <see cref="InterfaceContract"/>. 
        /// </summary>
        /// <param name="op">The <see cref="Operation"/> to import the message parameters in to.</param>
        /// <param name="output">Indicates whether the current message is input or output.</param>
        /// <param name="parametersCombo">Reference to the combo box which contains the message parameters.</param>
        /// <param name="chkName">Reference to the check box, which indicates whether the customized message name is selected or not.</param>
        /// <param name="tbName">Reference to the text box which contains the customized message name. </param>
        /// <param name="messageLabel">Reference to the Property Pane which contains the message name.</param>
        /// <param name="opDocumentation">Reference to the text box which contains the <see cref="Operation"/>'s documentation.</param>
        /// <param name="msgDocumentation">Reference to the text box which contains the <see cref="Message"/>'s documentation.</param>
        /// <param name="originalOperationName">String which contains the original name of the operation. User can always change the operation name after infering operations or while round-tripping. This parameter contains the name of the operation before any of those alternations.</param>
        private void ImportMessageParameter(Operation op, bool output, ComboBox parametersCombo,
            CheckBox chkName, TextBox tbName, PropertyPane messageLabel, TextBox opDocumentation,
            TextBox msgDocumentation, string originalOperationName)
        {
            if (oldOperations.Count > 0)
            {
                if (ImportMessageParameter(oldOperations, op, output,
                    parametersCombo, chkName, tbName, messageLabel,
                    opDocumentation, msgDocumentation, originalOperationName))
                {
                    return;
                }
            }

            if (importedContract != null)
            {
                if (ImportMessageParameter(importedContract.Operations, op, output,
                    parametersCombo, chkName, tbName, messageLabel, opDocumentation, msgDocumentation,
                    originalOperationName))
                {
                    return;
                }
            }

            if (serviceInterfaceContract.Operations.Count > 0)
            {
                if (ImportMessageParameter(serviceInterfaceContract.Operations, op, output,
                    parametersCombo, chkName, tbName, messageLabel,
                    opDocumentation, msgDocumentation, originalOperationName))
                {
                    return;
                }
            }

        }
        private void CreateOutputPane(Operation operation, int opIndex, TextBox opDocTextBox, Message outMessage, PropertyPane propPaneOutMsg, string originalOperationName, MessageHeader outHeader)
        {
            Label outMessageParameterLabel;
            CheckBox outMessageNameCheckBox;
            TextBox outMessageNameTextBox;
            ComboBox outMessageParamsCombo;
            TextBox outDocTextBox = SetupOutputMessageDynamicControls(opIndex, outMessage, out outMessageParameterLabel, out outMessageNameCheckBox, out outMessageNameTextBox, out outMessageParamsCombo);
            operation.Output = outMessage;

            // Import the parameters from an existing WSDL file for round tripping.
            ImportMessageParameter(operation, true, outMessageParamsCombo, outMessageNameCheckBox,
                                   outMessageNameTextBox, propPaneOutMsg, opDocTextBox, outDocTextBox, originalOperationName);

            // Attach the dynamic combo box event handler.
            outMessageParamsCombo.SelectedIndexChanged +=
                new EventHandler(DynamicComboBox_SelectedIndexChanged);

            CheckBox outMessageHeaderCheckBox = CreateOutMessageHeaderCheckBox(opIndex);

            ComboBox outMessageHeaderCombo = CreateOutMessageHeaderCombo(opIndex);

            // Import headers from an existing WSDL file for round tripping.
            List<Message> addedOutHeaderMsgs = ImportMessageHeaders(operation, outMessage,
                                                                         outMessageHeaderCombo, outMessageHeaderCheckBox, true);

            // Attach the dynamic combo box event handler.
            outMessageHeaderCombo.SelectedIndexChanged +=
                new EventHandler(DynamicComboBox_SelectedIndexChanged);

            LinkLabel outRemoveHeaderLink = CreateOutRemoveHeaderLink(addedOutHeaderMsgs);
            // outRemoveHeaderLink.Anchor = AnchorStyles.Right;

            // Initialize the dynamic control controllers.
            MessagePaneLabelController mplcOut =
                new MessagePaneLabelController(outMessageNameTextBox, propPaneOutMsg);
            MessageNameTextBoxController mntbcOut =
                new MessageNameTextBoxController(outMessageNameTextBox, outMessageNameCheckBox,
                                                 outMessage, propPaneOutMsg);
            OutHeaderComboBoxController hcbcOut =
                new OutHeaderComboBoxController(outMessageHeaderCombo, outMessageHeaderCheckBox,
                                                outMessageNameTextBox, operation, outMessage, outHeader, serviceInterfaceContract.HeaderSchemas,
                                                outRemoveHeaderLink, addedOutHeaderMsgs);
            MessageDocumentationTextBoxController outdtbc =
                new MessageDocumentationTextBoxController(outDocTextBox, outMessage);


            Label outDocLabel = CreateOutDocLabel(opIndex);

            // Finally add the generated controls to the container.
            propPaneOutMsg.Controls.Add(outDocTextBox);
            propPaneOutMsg.Controls.Add(outDocLabel);
            propPaneOutMsg.Controls.Add(outMessageParameterLabel);
            propPaneOutMsg.Controls.Add(outMessageNameTextBox);
            propPaneOutMsg.Controls.Add(outMessageParameterLabel);
            propPaneOutMsg.Controls.Add(outMessageParamsCombo);
            propPaneOutMsg.Controls.Add(outMessageNameCheckBox);
            propPaneOutMsg.Controls.Add(outMessageHeaderCombo);
            propPaneOutMsg.Controls.Add(outMessageHeaderCheckBox);
            propPaneOutMsg.Controls.Add(outRemoveHeaderLink);
        }
 private PropertyPane AttachOperationOutputPane(int opIndex, PropertyPane propPaneOp, string outputMessageName)
 {
     PropertyPane propPaneOutMsg = new PropertyPane();
     propPaneOutMsg.Name = "propPaneOutMsg" + opIndex;
     propPaneOutMsg.Text = "Message " + outputMessageName;
     propPaneOp.PaneNodes.Add(propPaneOutMsg);
     propPaneOp.PaneNode.Expanded = true;
     return propPaneOutMsg;
 }
        private string CreateInputPane(string opName, Operation operation, string inputMessageName, Message inMessage, int opIndex, TextBox opDocTextBox, PropertyPane propPaneInMsg, MessageHeader inHeader)
        {
            Label inMessageParameterLabel;
            CheckBox inMessageNameCheckBox;
            TextBox inMessageNameTextBox;
            ComboBox inMessageParamsCombo;

            TextBox inDocTextBox = SetupInputMessageDynamicControls(inputMessageName, opIndex, out inMessageParameterLabel, out inMessageNameCheckBox, out inMessageNameTextBox, out inMessageParamsCombo);


            // Import the parameters from WSDL file for round tripping.
            string originalOperationName = "";
            if (opName != null)
            {
                originalOperationName = opName;
            }

            ImportMessageParameter(operation, false, inMessageParamsCombo,
                                   inMessageNameCheckBox, inMessageNameTextBox, propPaneInMsg,
                                   opDocTextBox, inDocTextBox, originalOperationName);

            // Attach the dynamic combo box event handler.
            inMessageParamsCombo.SelectedIndexChanged +=
                new EventHandler(DynamicComboBox_SelectedIndexChanged);

            CheckBox inMessageHeaderCheckBox = CreateInMessageHeaderCheckBox(opIndex);
            ComboBox inMessageHeaderCombo = CreateInMessageHeaderCombo(opIndex);

            // Import headers from WSDL file for round tripping.
            List<Message> addedInHeaderMsgs = ImportMessageHeaders(operation, inMessage,inMessageHeaderCombo, inMessageHeaderCheckBox, false);

            // Attach the dynamic combo box event handler.
            inMessageHeaderCombo.SelectedIndexChanged +=
                new EventHandler(DynamicComboBox_SelectedIndexChanged);

            LinkLabel inRemoveHeaderLink = CreateInRemoveHeaderLink(addedInHeaderMsgs);
            // inRemoveHeaderLink.Anchor = AnchorStyles.Right;

            // Initialize the dynamic control controllers.
            MessagePaneLabelController mplcIn =
                new MessagePaneLabelController(inMessageNameTextBox, propPaneInMsg);
            MessageNameTextBoxController mntbcIn =
                new MessageNameTextBoxController(inMessageNameTextBox, inMessageNameCheckBox, inMessage, propPaneInMsg);
            InHeaderComboBoxController hcbcIn =
                new InHeaderComboBoxController(inMessageHeaderCombo, inMessageHeaderCheckBox,
                                               inMessageNameTextBox, operation, inMessage, inHeader, serviceInterfaceContract.HeaderSchemas,
                                               inRemoveHeaderLink, addedInHeaderMsgs);
            OperationDocumentationTextBoxController odtbc =
                new OperationDocumentationTextBoxController(opDocTextBox, operation);
            MessageDocumentationTextBoxController mdtbc =
                new MessageDocumentationTextBoxController(inDocTextBox, inMessage);


            Label inDocLabel = CreateInDocLabel(opIndex);

            // Finally add the controls to the container.
            propPaneInMsg.Controls.Add(inDocTextBox);
            propPaneInMsg.Controls.Add(inDocLabel);
            propPaneInMsg.Controls.Add(inMessageParameterLabel);
            propPaneInMsg.Controls.Add(inMessageNameTextBox);
            propPaneInMsg.Controls.Add(inMessageParameterLabel);
            propPaneInMsg.Controls.Add(inMessageParamsCombo);
            propPaneInMsg.Controls.Add(inMessageNameCheckBox);
            propPaneInMsg.Controls.Add(inMessageHeaderCombo);
            propPaneInMsg.Controls.Add(inMessageHeaderCheckBox);
            propPaneInMsg.Controls.Add(inRemoveHeaderLink);
            return originalOperationName;
        }
	    private PropertyPane AttachOperationInputPane(string inputMessageName, int i, PropertyPane propPaneOp)
        {
            PropertyPane propPaneInMsg = new PropertyPane();
            propPaneInMsg.Name = "propPaneInMsg" + i;
            propPaneInMsg.Text = "Message " + inputMessageName;
            PaneNode operationPaneNode = propPaneOp.PaneNodes.Add(propPaneInMsg);
            propPaneOp.PaneNode.Expanded = true;
            return propPaneInMsg;
        }
 private PropertyPane CreateOperationPropertyPane(Operation operation, int i)
 {
     PropertyPane propPaneOp = new PropertyPane();
     propPaneOp.Name = "propPaneOp" + i;
     propPaneOp.Text = "Operation " + operation.Name;
     propPaneOp.Tag = operation.Name;
     return propPaneOp;
 }
Exemple #11
0
        private PaneNode AddFaultPropertyPane(PaneNode operationNode, Operation selectedOperation, Message faultMessage)
        {
            selectedOperation.Faults.Add(faultMessage);

            string guid = Guid.NewGuid().ToString();

            PropertyPane propPaneFaultMessage = new PropertyPane();
            propPaneFaultMessage.Name = "propPaneFault" + guid;
            propPaneFaultMessage.Text = "Fault " + faultMessage.Name;
            propPaneFaultMessage.Tag = selectedOperation.Name + "Fault";

            // Setup dynamic GUI controls for the pane - FaultMessage
            Label faultMessageParameterLabel = new Label();
            faultMessageParameterLabel.Location = new Point(6, 5);
            faultMessageParameterLabel.Name = "faultMessageParameterLabel" + guid;
            faultMessageParameterLabel.Size = new Size(55, 33);
            faultMessageParameterLabel.Text = "Message body:";
            faultMessageParameterLabel.TabIndex = 0;

            ComboBox faultMessageParamsCombo = new ComboBox();
            faultMessageParamsCombo.DropDownStyle = ComboBoxStyle.DropDownList;
            faultMessageParamsCombo.Location = new Point(65, 5);
            faultMessageParamsCombo.Name = "faultMessageParamsCombo" + guid;
            faultMessageParamsCombo.Size = new Size(80, 21);
            faultMessageParamsCombo.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;
            faultMessageParamsCombo.Tag = selectedOperation;
            faultMessageParamsCombo.TabIndex = 1;

            Label faultMessageNameLabel = new Label();
            faultMessageNameLabel.Location = new Point(6, 48);
            faultMessageNameLabel.Name = "faultMessageNameLabel" + guid;
            faultMessageNameLabel.Text = "Message name:";
            faultMessageNameLabel.AutoSize = true;

            TextBox faultMessageNameTextBox = new TextBox();
            faultMessageNameTextBox.Location = new Point(8, 69);
            faultMessageNameTextBox.Name = "faultMessageNameTextBox" + guid;
            faultMessageNameTextBox.Size = new Size(142, 20);
            faultMessageNameTextBox.Text = faultMessage.Name;
            faultMessageNameTextBox.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;
            faultMessageNameTextBox.DataBindings.Add("Text", faultMessage, "Name");
            faultMessageNameTextBox.TextChanged += (o, s) => propPaneFaultMessage.Text = "Fault " + faultMessageNameTextBox.Text;
            faultMessageNameTextBox.TabIndex = 2;

            foreach (SchemaElement schemaElement in faultSchemas)
            {
                faultMessageParamsCombo.Items.Add(schemaElement);
            }

            if (faultMessageParamsCombo.Items.Count > 0)
            {
                faultMessageParamsCombo.SelectedIndex = 0;
            }

            faultMessageParamsCombo.DisplayMember = "ElementName";
            if (!string.IsNullOrEmpty(faultMessage.Element.ElementName))
            {
                faultMessageParamsCombo.SelectedItem = faultMessage.Element;
            }

            faultMessageParamsCombo.SelectedIndexChanged += (o, s) =>
            {
                faultMessage.Element = (SchemaElement)faultMessageParamsCombo.SelectedItem;
            };

            LinkLabel faultRemoveLink = new LinkLabel();
            faultRemoveLink.Location = new Point(6, 100);
            faultRemoveLink.Text = "Remove Fault Message";
            faultRemoveLink.AutoSize = true;
            faultRemoveLink.TabIndex = 3;

            Label faultDocLabel = new Label();
            faultDocLabel.Location = new Point(6, 125);
            faultDocLabel.Name = "faultDocLabel" + guid;
            faultDocLabel.Size = new Size(88, 23);
            faultDocLabel.Text = "Documentation:";
            faultDocLabel.TabIndex = 4;

            TextBox faultDocTextBox = new TextBox();
            faultDocTextBox.Location = new Point(8, 144);
            faultDocTextBox.Text = faultMessage.Documentation;
            faultDocTextBox.Multiline = true;
            faultDocTextBox.Name = "faultDocTextBox" + guid;
            faultDocTextBox.Size = new Size(142, 0);
            faultDocTextBox.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom;
            faultDocTextBox.DataBindings.Add("Text", faultMessage, "Documentation");
            faultDocTextBox.TabIndex = 5;

            propPaneFaultMessage.Controls.Add(faultMessageParameterLabel);
            propPaneFaultMessage.Controls.Add(faultMessageParamsCombo);
            propPaneFaultMessage.Controls.Add(faultMessageNameLabel);
            propPaneFaultMessage.Controls.Add(faultMessageNameTextBox);
            propPaneFaultMessage.Controls.Add(faultRemoveLink);
            propPaneFaultMessage.Controls.Add(faultDocTextBox);
            propPaneFaultMessage.Controls.Add(faultDocLabel);

            operationNode.Expanded = true;
            PaneNode faultPaneNode = operationNode.PropertyPane.PaneNodes.Add(propPaneFaultMessage);

            faultRemoveLink.Click += (o, s) =>
            {
                selectedOperation.Faults.Remove(faultMessage);
                operationNode.PaneNodes.Remove(faultPaneNode);
            };

            return faultPaneNode;
        }
Exemple #12
0
        /// <summary>
        /// Prepares the dynamic controls for the operations-message parameters mapping UI.
        /// </summary>
        private void SetupOperationsMessagesPanes()
        {
            int i = 0;
            ((ISupportInitialize)ptvServiceOperations).BeginInit();
            ptvServiceOperations.SuspendLayout();

            // Clear the existing items.
            serviceInterfaceContract.OperationsCollection.Clear();
            ptvServiceOperations.PaneNodes.Clear();

            foreach (ListViewItem lvi in operationsListView.Items)
            {
                bool found = false;
                // Check whether the operation already has a property pane or not.
                foreach (PaneNode proPane in ptvServiceOperations.PaneNodes)
                {
                    if (lvi.Text == (string)proPane.PropertyPane.Tag)
                    {
                        found = true;
                        break;
                    }
                }

                if (found)
                {
                    continue;
                }

                Operation operation = new Operation();
                operation.Name = lvi.Text;
                string mepValue = lvi.SubItems[1].Text;
                if (mepValue == "One-Way")
                    operation.Mep = Mep.OneWay;
                else
                    operation.Mep = Mep.RequestResponse;
                operation.Documentation = "";

                string opName = operation.Name;
                string opNamePrefix = opName.Substring(0, 1);
                opNamePrefix = opNamePrefix.ToLower(CultureInfo.CurrentCulture);
                opName = opName.Substring(1, opName.Length - 1);
                opName = opNamePrefix + opName;

                Message inMessage = new Message();
                inMessage.Name = opName + "In";
                inMessage.Documentation = "";
                inMessage.Element = messageSchemas[0];
                operation.MessagesCollection.Add(inMessage);

                MessageHeader inHeader = new MessageHeader();
                inHeader.Name = inMessage.Name + "Header";
                inHeader.Message = inMessage.Name + "Header";

                serviceInterfaceContract.OperationsCollection.Add(operation);

                PropertyPane propPaneOp = new PropertyPane();
                propPaneOp.Name = "propPaneOp" + i;
                propPaneOp.Text = "Operation " + operation.Name;
                propPaneOp.Tag = operation.Name;

                // Setup dynamic GUI controls for the pane - Operation
                LinkLabel addFaultMessage = new LinkLabel();
                addFaultMessage.Text = "Add Fault Message";
                addFaultMessage.Location = new Point(6, 5);
                addFaultMessage.Click += addFaultMessage_Clicked;
                propPaneOp.Controls.Add(addFaultMessage);

                ptvServiceOperations.PaneNodes.Add(propPaneOp);

                PropertyPane propPaneInMsg = new PropertyPane();
                propPaneInMsg.Name = "propPaneInMsg" + i;
                propPaneInMsg.Text = "Message " + inMessage.Name;
                propPaneOp.PaneNodes.Add(propPaneInMsg);
                propPaneOp.PaneNode.Expanded = true;

                PropertyPane propPaneOutMsg = null;
                Message outMessage = null;
                MessageHeader outHeader = null;

                if (operation.Mep == Mep.RequestResponse)
                {
                    outMessage = new Message();
                    outMessage.Name = opName + "Out";
                    outMessage.Documentation = "";
                    outMessage.Element = messageSchemas[0];
                    operation.MessagesCollection.Add(outMessage);

                    outHeader = new MessageHeader();
                    outHeader.Name = outMessage.Name + "Header";
                    outHeader.Message = outMessage.Name + "Header";

                    propPaneOutMsg = new PropertyPane();
                    propPaneOutMsg.Name = "propPaneOutMsg" + i;
                    propPaneOutMsg.Text = "Message " + outMessage.Name;
                    propPaneOp.PaneNodes.Add(propPaneOutMsg);
                    propPaneOp.PaneNode.Expanded = true;
                }

                // Setup dynamic GUI controls for the pane - Operation
                TextBox opDocTextBox = new TextBox();
                opDocTextBox.Location = new Point(8, 148);
                opDocTextBox.Multiline = true;
                opDocTextBox.Name = "outDocTextBox" + i;
                opDocTextBox.Size = new Size(135, 0);
                opDocTextBox.DataBindings.Add("Text", operation, "Documentation");

                opDocTextBox.Anchor = AnchorStyles.Left | AnchorStyles.Top |
                    AnchorStyles.Right | AnchorStyles.Bottom;

                Label opDocLabel = new Label();
                opDocLabel.Location = new Point(8, 128);
                opDocLabel.Name = "outDocLabel" + i;
                opDocLabel.Size = new Size(88, 23);
                opDocLabel.Text = "Documentation:";

                propPaneOp.Controls.Add(opDocTextBox);
                propPaneOp.Controls.Add(opDocLabel);

                // Setup dynamic GUI controls for the pane - InMessage
                TextBox inDocTextBox = new TextBox();
                inDocTextBox.Location = new Point(8, 168);
                inDocTextBox.Multiline = true;
                inDocTextBox.Name = "inDocTextBox" + i;
                inDocTextBox.Size = new Size(135, 0);
                inDocTextBox.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom;

                Label inMessageParameterLabel = new Label();
                inMessageParameterLabel.Location = new Point(6, 5);
                inMessageParameterLabel.Name = "inMessageParameterLabel" + i;
                inMessageParameterLabel.Size = new Size(55, 33);
                inMessageParameterLabel.Text = "Message body:";

                CheckBox inMessageNameCheckBox = new CheckBox();
                inMessageNameCheckBox.Location = new Point(9, 44);
                inMessageNameCheckBox.Name = "inMessageNameCheckBox" + i;
                inMessageNameCheckBox.Text = "Message name (optional)";
                inMessageNameCheckBox.Size = new Size(220, 25);

                TextBox inMessageNameTextBox = new TextBox();
                inMessageNameTextBox.Location = new Point(8, 69);
                inMessageNameTextBox.Name = "inMessageNameTextBox" + i;
                inMessageNameTextBox.Size = new Size(142, 20);
                inMessageNameTextBox.Enabled = false;
                inMessageNameTextBox.Text = inMessage.Name;
                inMessageNameTextBox.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;

                ComboBox inMessageParamsCombo = new ComboBox();
                inMessageParamsCombo.DropDownStyle = ComboBoxStyle.DropDownList;
                inMessageParamsCombo.Location = new Point(65, 5);
                inMessageParamsCombo.Name = "inMessageParamsCombo" + i;
                inMessageParamsCombo.Size = new Size(80, 21);
                inMessageParamsCombo.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;

                // Fill the combo box with the Message values.
                foreach (SchemaElement element in this.messageSchemas)
                {
                    inMessageParamsCombo.Items.Add(element.ElementName);
                }
                inMessageParamsCombo.SelectedIndex = 0;

                operation.Input = inMessage;

                // Import the parameters from WSDL file for round tripping.
                string originalOperationName = "";
                if (lvi.Tag != null)
                {
                    originalOperationName = lvi.Tag.ToString();
                }

                ImportMessageParameter(operation, false, inMessageParamsCombo,
                    inMessageNameCheckBox, inMessageNameTextBox, propPaneInMsg,
                    opDocTextBox, inDocTextBox, originalOperationName);

                // Attach the dynamic combo box event handler.
                inMessageParamsCombo.SelectedIndexChanged +=
                    new EventHandler(DynamicComboBox_SelectedIndexChanged);

                CheckBox inMessageHeaderCheckBox = new CheckBox();
                inMessageHeaderCheckBox.Location = new Point(9, 95);
                inMessageHeaderCheckBox.Name = "inMessageHeaderCheckBox" + i;
                inMessageHeaderCheckBox.Text = "Message headers (optional)";
                inMessageHeaderCheckBox.Size = new Size(181, 25);

                ComboBox inMessageHeaderCombo = new ComboBox();
                inMessageHeaderCombo.DropDownStyle = ComboBoxStyle.DropDownList;
                inMessageHeaderCombo.Location = new Point(8, 120);
                inMessageHeaderCombo.Enabled = false;
                inMessageHeaderCombo.Name = "inMessageHeaderCombo" + i;
                inMessageHeaderCombo.Size = new Size(100, 21);
                inMessageHeaderCombo.Items.Add("<New...>");
                inMessageHeaderCombo.SelectedIndex = 0;
                inMessageHeaderCombo.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;

                // Import headers from WSDL file for round tripping.
                MessagesCollection addedInHeaderMsgs = ImportMessageHeaders(operation, inMessage,
                    inMessageHeaderCombo, inMessageHeaderCheckBox, false);

                // Attach the dynamic combo box event handler.
                inMessageHeaderCombo.SelectedIndexChanged +=
                    new EventHandler(DynamicComboBox_SelectedIndexChanged);

                LinkLabel inRemoveHeaderLink = new LinkLabel();
                inRemoveHeaderLink.Text = "Remove";
                inRemoveHeaderLink.Location = new Point(193, 95);
                inRemoveHeaderLink.Size = new Size(64, 25);
                inRemoveHeaderLink.TextAlign = ContentAlignment.MiddleRight;
                inRemoveHeaderLink.Visible = (addedInHeaderMsgs != null);
                // inRemoveHeaderLink.Anchor = AnchorStyles.Right;

                // Initialize the dynamic control controllers.
                MessagePaneLabelController mplcIn =
                    new MessagePaneLabelController(inMessageNameTextBox, propPaneInMsg);
                MessageNameTextBoxController mntbcIn =
                    new MessageNameTextBoxController(inMessageNameTextBox, inMessageNameCheckBox,
                        inMessage, propPaneInMsg);
                InHeaderComboBoxController hcbcIn =
                    new InHeaderComboBoxController(inMessageHeaderCombo, inMessageHeaderCheckBox,
                        inMessageNameTextBox, operation, inMessage, inHeader, this.headerSchemas,
                        inRemoveHeaderLink, addedInHeaderMsgs);
                OperationDocumentationTextBoxController odtbc =
                    new OperationDocumentationTextBoxController(opDocTextBox, operation);
                MessageDocumentationTextBoxController mdtbc =
                    new MessageDocumentationTextBoxController(inDocTextBox, inMessage);

                Label inDocLabel = new Label();
                inDocLabel.Location = new Point(8, 149);
                inDocLabel.Name = "inDocLabel" + i;
                inDocLabel.Size = new Size(88, 23);
                inDocLabel.Text = "Documentation:";

                // Finally add the controls to the container.
                propPaneInMsg.Controls.Add(inDocTextBox);
                propPaneInMsg.Controls.Add(inDocLabel);
                propPaneInMsg.Controls.Add(inMessageParameterLabel);
                propPaneInMsg.Controls.Add(inMessageNameTextBox);
                propPaneInMsg.Controls.Add(inMessageParameterLabel);
                propPaneInMsg.Controls.Add(inMessageParamsCombo);
                propPaneInMsg.Controls.Add(inMessageNameCheckBox);
                propPaneInMsg.Controls.Add(inMessageHeaderCombo);
                propPaneInMsg.Controls.Add(inMessageHeaderCheckBox);
                propPaneInMsg.Controls.Add(inRemoveHeaderLink);

                // Setup dynamic GUI controls for the pane - OutMessage
                if (operation.Mep == Mep.RequestResponse)
                {
                    TextBox outDocTextBox = new TextBox();
                    outDocTextBox.Location = new Point(8, 165);
                    outDocTextBox.Multiline = true;
                    outDocTextBox.Name = "outDocTextBox" + i;
                    outDocTextBox.Size = new Size(135, 0);
                    outDocTextBox.DataBindings.Add("Text", outMessage, "Documentation");
                    outDocTextBox.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right |
                        AnchorStyles.Bottom;

                    Label outMessageParameterLabel = new Label();
                    outMessageParameterLabel.Location = new Point(6, 5);
                    outMessageParameterLabel.Name = "outMessageParameterLabel" + i;
                    outMessageParameterLabel.Size = new Size(55, 33);
                    outMessageParameterLabel.Text = "Message body:";

                    CheckBox outMessageNameCheckBox = new CheckBox();
                    outMessageNameCheckBox.Location = new Point(9, 44);
                    outMessageNameCheckBox.Name = "outMessageNameCheckBox" + i;
                    outMessageNameCheckBox.Text = "Message name (optional)";
                    outMessageNameCheckBox.Size = new Size(220, 25);

                    TextBox outMessageNameTextBox = new TextBox();
                    outMessageNameTextBox.Location = new Point(8, 69);
                    outMessageNameTextBox.Name = "outMessageNameTextBox" + i;
                    outMessageNameTextBox.Size = new Size(142, 20);
                    outMessageNameTextBox.Enabled = false;
                    outMessageNameTextBox.Text = outMessage.Name;
                    outMessageNameTextBox.Anchor = AnchorStyles.Left | AnchorStyles.Top |
                        AnchorStyles.Right;

                    ComboBox outMessageParamsCombo = new ComboBox();
                    outMessageParamsCombo.DropDownStyle = ComboBoxStyle.DropDownList;
                    outMessageParamsCombo.Location = new Point(65, 5);
                    outMessageParamsCombo.Name = "outMessageParamsCombo" + i;
                    outMessageParamsCombo.Size = new Size(80, 21);
                    outMessageParamsCombo.Anchor = AnchorStyles.Left | AnchorStyles.Top |
                        AnchorStyles.Right;

                    // Fill the combo box with the Message values.
                    foreach (SchemaElement element in this.messageSchemas)
                    {
                        outMessageParamsCombo.Items.Add(element.ElementName);
                    }
                    outMessageParamsCombo.SelectedIndex = 0;
                    operation.Output = outMessage;

                    // Import the parameters from an existing WSDL file for round tripping.
                    ImportMessageParameter(operation, true, outMessageParamsCombo, outMessageNameCheckBox,
                        outMessageNameTextBox, propPaneOutMsg, opDocTextBox, outDocTextBox, originalOperationName);

                    // Attach the dynamic combo box event handler.
                    outMessageParamsCombo.SelectedIndexChanged +=
                        new EventHandler(DynamicComboBox_SelectedIndexChanged);

                    CheckBox outMessageHeaderCheckBox = new CheckBox();
                    outMessageHeaderCheckBox.Location = new Point(9, 95);
                    outMessageHeaderCheckBox.Name = "outMessageHeaderCheckBox" + i;
                    outMessageHeaderCheckBox.Text = "Message headers (optional)";
                    outMessageHeaderCheckBox.Size = new Size(181, 25);

                    ComboBox outMessageHeaderCombo = new ComboBox();
                    outMessageHeaderCombo.DropDownStyle = ComboBoxStyle.DropDownList;
                    outMessageHeaderCombo.Location = new Point(8, 120);
                    outMessageHeaderCombo.Enabled = false;
                    outMessageHeaderCombo.Name = "outMessageHeaderCombo" + i;
                    outMessageHeaderCombo.Size = new Size(100, 21);
                    outMessageHeaderCombo.Items.Add("<New...>");
                    outMessageHeaderCombo.SelectedIndex = 0;
                    outMessageHeaderCombo.Anchor = AnchorStyles.Left | AnchorStyles.Top |
                        AnchorStyles.Right;

                    // Import headers from an existing WSDL file for round tripping.
                    MessagesCollection addedOutHeaderMsgs = ImportMessageHeaders(operation, outMessage,
                        outMessageHeaderCombo, outMessageHeaderCheckBox, true);

                    // Attach the dynamic combo box event handler.
                    outMessageHeaderCombo.SelectedIndexChanged +=
                        new EventHandler(DynamicComboBox_SelectedIndexChanged);

                    LinkLabel outRemoveHeaderLink = new LinkLabel();
                    outRemoveHeaderLink.Text = "Remove";
                    outRemoveHeaderLink.Location = new Point(193, 95);
                    outRemoveHeaderLink.Size = new Size(64, 25);
                    outRemoveHeaderLink.TextAlign = ContentAlignment.MiddleRight;
                    outRemoveHeaderLink.Visible = (addedOutHeaderMsgs != null);
                    // outRemoveHeaderLink.Anchor = AnchorStyles.Right;

                    // Initialize the dynamic control controllers.
                    MessagePaneLabelController mplcOut =
                        new MessagePaneLabelController(outMessageNameTextBox, propPaneOutMsg);
                    MessageNameTextBoxController mntbcOut =
                        new MessageNameTextBoxController(outMessageNameTextBox, outMessageNameCheckBox,
                            outMessage, propPaneOutMsg);
                    OutHeaderComboBoxController hcbcOut =
                        new OutHeaderComboBoxController(outMessageHeaderCombo, outMessageHeaderCheckBox,
                            outMessageNameTextBox, operation, outMessage, outHeader, headerSchemas,
                            outRemoveHeaderLink, addedOutHeaderMsgs);
                    MessageDocumentationTextBoxController outdtbc =
                        new MessageDocumentationTextBoxController(outDocTextBox, outMessage);

                    Label outDocLabel = new Label();
                    outDocLabel.Location = new Point(8, 149);
                    outDocLabel.Name = "outDocLabel" + i;
                    outDocLabel.Size = new Size(88, 23);
                    outDocLabel.Text = "Documentation:";

                    // Finally add the generated controls to the container.
                    propPaneOutMsg.Controls.Add(outDocTextBox);
                    propPaneOutMsg.Controls.Add(outDocLabel);
                    propPaneOutMsg.Controls.Add(outMessageParameterLabel);
                    propPaneOutMsg.Controls.Add(outMessageNameTextBox);
                    propPaneOutMsg.Controls.Add(outMessageParameterLabel);
                    propPaneOutMsg.Controls.Add(outMessageParamsCombo);
                    propPaneOutMsg.Controls.Add(outMessageNameCheckBox);
                    propPaneOutMsg.Controls.Add(outMessageHeaderCombo);
                    propPaneOutMsg.Controls.Add(outMessageHeaderCheckBox);
                    propPaneOutMsg.Controls.Add(outRemoveHeaderLink);

                }

                ImportFaultMessages(propPaneOp.PaneNode, operation, originalOperationName);

                i++;
            }

            oldOperations = (OperationsCollection)serviceInterfaceContract.OperationsCollection.Clone();

            ((ISupportInitialize)ptvServiceOperations).EndInit();
            ptvServiceOperations.ResumeLayout(false);
        }