📄 reference.cs
字号:
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50601.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
// This source code was auto-generated by Microsoft.VSDesigner, Version 2.0.50601.0.
//
#pragma warning disable 1591
namespace Microsoft.Samples.Windows.Forms.EventBasedAsync.SimpleWebServices {
using System.Diagnostics;
using System.Web.Services;
using System.ComponentModel;
using System.Web.Services.Protocols;
using System;
using System.Xml.Serialization;
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("", "")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="SimpleWebServiceSoap", Namespace="http://localhost/samplewebservices/")]
public partial class SimpleWebService : System.Web.Services.Protocols.SoapHttpClientProtocol {
private System.Threading.SendOrPostCallback GetAnswerOperationCompleted;
private bool useDefaultCredentialsSetExplicitly;
/// <remarks/>
public SimpleWebService() {
this.Url = global::Microsoft.Samples.Windows.Forms.EventBasedAsync.Settings1.Default.EventBasedAsyncSampleCS_SimpleWebServices_SimpleWebService;
if ((this.IsLocalFileSystemWebService(this.Url) == true)) {
this.UseDefaultCredentials = true;
this.useDefaultCredentialsSetExplicitly = false;
}
else {
this.useDefaultCredentialsSetExplicitly = true;
}
}
public new string Url {
get {
return base.Url;
}
set {
if ((((this.IsLocalFileSystemWebService(base.Url) == true)
&& (this.useDefaultCredentialsSetExplicitly == false))
&& (this.IsLocalFileSystemWebService(value) == false))) {
base.UseDefaultCredentials = false;
}
base.Url = value;
}
}
public new bool UseDefaultCredentials {
get {
return base.UseDefaultCredentials;
}
set {
base.UseDefaultCredentials = value;
this.useDefaultCredentialsSetExplicitly = true;
}
}
/// <remarks/>
public event GetAnswerCompletedEventHandler GetAnswerCompleted;
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost/samplewebservices/GetAnswer", RequestNamespace="http://localhost/samplewebservices/", ResponseNamespace="http://localhost/samplewebservices/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public string GetAnswer(string question) {
object[] results = this.Invoke("GetAnswer", new object[] {
question});
return ((string)(results[0]));
}
/// <remarks/>
public void GetAnswerAsync(string question) {
this.GetAnswerAsync(question, null);
}
/// <remarks/>
public void GetAnswerAsync(string question, object userState) {
if ((this.GetAnswerOperationCompleted == null)) {
this.GetAnswerOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetAnswerOperationCompleted);
}
this.InvokeAsync("GetAnswer", new object[] {
question}, this.GetAnswerOperationCompleted, userState);
}
private void OnGetAnswerOperationCompleted(object arg) {
if ((this.GetAnswerCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.GetAnswerCompleted(this, new GetAnswerCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
public new void CancelAsync(object userState) {
base.CancelAsync(userState);
}
private bool IsLocalFileSystemWebService(string url) {
if (((url == null)
|| (url == string.Empty))) {
return false;
}
System.Uri wsUri = new System.Uri(url);
if ((((wsUri.Port >= 1024)
&& (wsUri.Port <= 5000))
&& (string.Compare(wsUri.Host, "localHost", true) == 0))) {
return true;
}
return false;
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("", "")]
public delegate void GetAnswerCompletedEventHandler(object sender, GetAnswerCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("", "")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class GetAnswerCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal GetAnswerCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public string Result {
get {
this.RaiseExceptionIfNecessary();
return ((string)(this.results[0]));
}
}
}
}
#pragma warning restore 1591
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -