本文整理汇总了C#中MainForm.buttonInvoke_Click方法的典型用法代码示例。如果您正苦于以下问题:C# MainForm.buttonInvoke_Click方法的具体用法?C# MainForm.buttonInvoke_Click怎么用?C# MainForm.buttonInvoke_Click使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MainForm
的用法示例。
在下文中一共展示了MainForm.buttonInvoke_Click方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InvokeMethod
/// <summary>
///
/// </summary>
/// <param name="method"></param>
/// <param name="xmlDocument"></param>
/// <param name="mainForm"></param>
/// <returns></returns>
public static XmlDocument InvokeMethod(string method, XmlDocument xmlDocument, MainForm mainForm)
{
#region Check Input
if (method == null || method==String.Empty)
{
throw new Exception("Method not allow empty!");
}
if (xmlDocument==null)
{
throw new Exception("Config File not allow empty!");
}
if(mainForm==null)
{
throw new Exception("MainForm not allow null!");
}
#endregion
#region write log
Console.WriteLine(String.Format("WSDL EndPoint:{0}", mainForm.wsdl.Paths[0]));
Console.WriteLine(String.Format("Method: {0} ", method ));
Console.WriteLine(String.Format("ConfigFile: \r\n {0}", XmlCongifManager.FormatXmlDocumentToString(xmlDocument)));
#endregion
if (mainForm.treeMethods.Nodes.Count == 0)
{
throw new Exception("Can not get method tree ,please check asm path.");
}
lock (locker)
{
ClickNode(mainForm.treeMethods, mainForm.treeMethods.Nodes[0], method, mainForm);
if(mainForm.treeInput.Nodes.Count==0)
{
throw new Exception(String.Format("Not exist method named {0} in endpoint {1}", method, mainForm.textEndPointUri.Text));
}
XmlCongifManager.ApplyConfig(mainForm.treeInput.Nodes[0], String.Empty, xmlDocument,
mainForm.wsdl.ProxyAssembly);
mainForm.buttonInvoke_Click(null, null);
XmlDocument xmlDocument1 = new XmlDocument();
if (mainForm.treeOutput.Nodes[0].Nodes[1].Nodes.Count > 0)
{
TreeNode outPutNode = mainForm.treeOutput.Nodes[0].Nodes[1].Nodes[0];
XmlCongifManager.ReadOutput(outPutNode, null, ref xmlDocument1);
}
return xmlDocument1;
}
}