示例#1
0
 public NewMainForm()
 {
     InitializeComponent();
     Text = string.Format("{0} version {1}", AboutBox.AssemblyTitle, AboutBox.AssemblyVersion);
     wsdl = new Wsdl();
     Control.CheckForIllegalCrossThreadCalls = false;
     richWsdl.Font = Configuration.MasterConfig.UiSettings.WsdlFont;
     comboEndPointUri.Items.AddRange(Configuration.MasterConfig.InvokeSettings.RecentlyUsedUris);
     if (comboEndPointUri.Items.Count > 0)
     {
         comboEndPointUri.SelectedIndex = 0;
     }
     richMessage.Font  = Configuration.MasterConfig.UiSettings.MessageFont;
     richRequest.Font  = Configuration.MasterConfig.UiSettings.ReqRespFont;
     richResponse.Font = Configuration.MasterConfig.UiSettings.ReqRespFont;
 }
示例#2
0
 private static XmlElement AddChilds(Wsdl wsdl, SchemaElement e, XmlElement soapParameter, XmlDocument soapRequest, Message messageData)
 {
     e.SchemaElements.ForEach(ee =>
     {
         var soapParameterChild = soapRequest.CreateElement(ee.Name, ee.Namespace == string.Empty ? wsdl.Definitions.Attributes.First(a => a.Name == messageData.Parameter.Split(':')[0]).Value : ee.Namespace);
         soapParameterChild     = AddChilds(wsdl, ee, soapParameterChild, soapRequest, messageData);
         if (ee.SchemaElements.Count == 0)
         {
             soapParameterChild.InnerText = "?";
         }
         soapParameter.AppendChild(soapParameterChild);
     });
     if (e.SchemaElements.Count == 0)
     {
         soapParameter.InnerText = "?";
     }
     return(soapParameter);
 }
示例#3
0
 private void buttonGet_Click(object sender, EventArgs e)
 {
     if (this.buttonGet.Text == "Get")
     {
         string text = this.comboEndPointUri.Text;
         if (!string.IsNullOrEmpty(text))
         {
             ClearAllTabs();
             TabPage selectedTab = this.tabMain.SelectedTab;
             tabMain.SelectedTab = this.tabPageMessage;
             wsdl.Reset();
             wsdl.Paths.Add(text);
             new Thread(new ThreadStart(this.wsdl.Generate)).Start();
             buttonGet.Text = "Cancel";
         }
     }
     else
     {
         buttonGet.Text = "Get";
         ShowMessageInternal(this, MessageType.Failure, "Cancelled");
         wsdl.Reset();
         wsdl = new Wsdl();
     }
 }
        private void btnBatchUpdateLocalAssembly_Click(object sender, EventArgs e)
        {
            tabMain.SelectedTab = tabPageMessage;

            if (Configuration.MasterConfig.BatchUpdateAssemblySettings.AutoUpdate)
            {
                AsyncMethodCaller caller = new AsyncMethodCaller(InitializeDropdowns);
                IAsyncResult result = caller.BeginInvoke(
                    null,
                    caller);

                caller.EndInvoke(result);

                for (int i = 0; i < cmbVersion.Items.Count; i++)
                {
                    cmbVersion.SelectedIndex = i;
                    for (int j = 1; j < cmbModule.Items.Count; j++)
                    {
                        cmbModule.SelectedIndex = j;

                        foreach (String uri in Configuration.MasterConfig.BatchUpdateAssemblySettings.UpdateModuleNames)
                        {
                            if (uri.ToLower() == cmbModule.Text.ToLower())
                            {
                                string updateUrl = textEndPointUri.Text.ToLower();
                                if (!updateUrls.Contains(updateUrl))
                                {
                                    updateUrls.Add(updateUrl);
                                }
                            }
                        }
                    }
                }
            }

            string[] updateVersions = Configuration.MasterConfig.BatchUpdateAssemblySettings.UpdateVersions;
            string[] updateModuleNames = Configuration.MasterConfig.BatchUpdateAssemblySettings.UpdateModuleNames;

            if (updateVersions != null && updateModuleNames != null)
            {
                for (int i = 0; i < updateVersions.Length; i++)
                {
                    for (int j = 0; j < updateModuleNames.Length; j++)
                    {
                        string updateUrl = updateVersions[i] + updateModuleNames[j];
                        if (!updateUrls.Contains(updateUrl))
                        {
                            updateUrls.Add(updateUrl);
                        }
                    }
                }
            }

            beginUpdateLocalAssembly = 0;
            finishedUpdateLocalAssembly = 0;
            btnBatchUpdateLocalAssembly.Enabled = false;

            foreach (string updateUrl in updateUrls)
            {
                beginUpdateLocalAssembly++;
                Wsdl wsdl1 = new Wsdl();
                wsdl1.Paths.Add(updateUrl);

                AsyncMethodCaller caller1 = new AsyncMethodCaller(wsdl1.GenerateAndUpdateAssembly);
                caller1.BeginInvoke(
                    new AsyncCallback(BatchUpdateLocalAssemblyCallBack),
                    caller1);
                ShowMessage(this, MessageType.Begin,
                            "Begin Create Local Assembly Use EndPointUri: " + updateUrl);
            }
        }
        public MainForm()
        {
            components = null;
            wsdl = null;
            findOption = RichTextBoxFinds.None;
            searchStr = "";
            InitializeComponent();

            chkLocalAssembly.Checked = Configuration.MasterConfig.OtherSettings.DefaultUseLocalAssembly;
            AutoGetChk.Checked = Configuration.MasterConfig.OtherSettings.DefaultAutoGet;
            AutoPopulateChk.Checked = Configuration.MasterConfig.OtherSettings.DefaultAutoPopulate;

            ServerCBox.Items.AddRange(Configuration.MasterConfig.ServerHistory.CalledServer);

            //ServerCBox.Items.Insert(0, "");

            //    this.ServerCBox.SelectedIndex = 0;

            textEndPointUri.Items.AddRange(Configuration.MasterConfig.InvokeSettings.RecentlyUsedUris);
            if (textEndPointUri.Items.Count > 0)
            {
                textEndPointUri.SelectedIndex = 0;
            }
            else
            {
                textEndPointUri.Text = "";
            }

            try
            {
                openWsdlDialog.DefaultExt = "wsdl";
                openWsdlDialog.Multiselect = true;
                openWsdlDialog.Title = "Open WSDL";
                openWsdlDialog.CheckFileExists = false;
                openWsdlDialog.CheckPathExists = false;
                saveAllDialog.FileName = "doc1";
            }
            catch (Exception exception1)
            {
                Console.WriteLine(exception1.ToString());
            }

            richWsdl.Font = Configuration.MasterConfig.UiSettings.WsdlFont;
            richMessage.Font = Configuration.MasterConfig.UiSettings.MessageFont;
            richRequest.Font = Configuration.MasterConfig.UiSettings.ReqRespFont;
            richResponse.Font = Configuration.MasterConfig.UiSettings.ReqRespFont;

            wsdl = new Wsdl();

            //this.treeOutput.BeforeExpand += new TreeViewCancelEventHandler(treeOutput_BeforeExpand);
            //this.treeOutput.AfterExpand += new TreeViewEventHandler(treeOutput_AfterExpand);
            this.treeInput.ImageList = this.imgList;
            this.treeOutput.ImageList = this.imgList;
            this.treeMethods.ImageList = this.imgList;

            chkAutoSetSpecified.Checked = Configuration.MasterConfig.OtherSettings.AutoSetSpecified;

            if (Configuration.MasterConfig.OtherSettings.SimplifiedView)
                simplifiedToolStripMenuItem.PerformClick();
            else
                advancedToolStripMenuItem.PerformClick();

            hideSpecifiedFieldForOutputToolStripMenuItem.Checked = Configuration.MasterConfig.OtherSettings.HideSpecifiedFieldForOutput;

            this.msMain.Renderer = new RadioCheckRenderer();    //To show Radio button when menu item is checked
        }