150 lines
6.0 KiB
C#
150 lines
6.0 KiB
C#
//------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// 這段程式碼是由工具產生的。
|
|
// 執行階段版本:4.0.30319.42000
|
|
//
|
|
// 對這個檔案所做的變更可能會造成錯誤的行為,而且如果重新產生程式碼,
|
|
// 變更將會遺失。
|
|
// </auto-generated>
|
|
//------------------------------------------------------------------------------
|
|
|
|
//
|
|
// 原始程式碼已由 Microsoft.VSDesigner 自動產生,版本 4.0.30319.42000。
|
|
//
|
|
#pragma warning disable 1591
|
|
|
|
namespace BackupClient.BackupService {
|
|
using System;
|
|
using System.Web.Services;
|
|
using System.Diagnostics;
|
|
using System.Web.Services.Protocols;
|
|
using System.Xml.Serialization;
|
|
using System.ComponentModel;
|
|
|
|
|
|
/// <remarks/>
|
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.7.3062.0")]
|
|
[System.Diagnostics.DebuggerStepThroughAttribute()]
|
|
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
|
[System.Web.Services.WebServiceBindingAttribute(Name="BackupServiceSoap", Namespace="http://thinkyustaff.com/")]
|
|
public partial class BackupService : System.Web.Services.Protocols.SoapHttpClientProtocol {
|
|
|
|
private System.Threading.SendOrPostCallback GetFilesOperationCompleted;
|
|
|
|
private bool useDefaultCredentialsSetExplicitly;
|
|
|
|
/// <remarks/>
|
|
public BackupService() {
|
|
this.Url = global::BackupClient.Properties.Settings.Default.BackupClient_BackupService_BackupService;
|
|
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 GetFilesCompletedEventHandler GetFilesCompleted;
|
|
|
|
/// <remarks/>
|
|
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://thinkyustaff.com/GetFiles", RequestNamespace="http://thinkyustaff.com/", ResponseNamespace="http://thinkyustaff.com/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
|
public string[] GetFiles(string path) {
|
|
object[] results = this.Invoke("GetFiles", new object[] {
|
|
path});
|
|
return ((string[])(results[0]));
|
|
}
|
|
|
|
/// <remarks/>
|
|
public void GetFilesAsync(string path) {
|
|
this.GetFilesAsync(path, null);
|
|
}
|
|
|
|
/// <remarks/>
|
|
public void GetFilesAsync(string path, object userState) {
|
|
if ((this.GetFilesOperationCompleted == null)) {
|
|
this.GetFilesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetFilesOperationCompleted);
|
|
}
|
|
this.InvokeAsync("GetFiles", new object[] {
|
|
path}, this.GetFilesOperationCompleted, userState);
|
|
}
|
|
|
|
private void OnGetFilesOperationCompleted(object arg) {
|
|
if ((this.GetFilesCompleted != null)) {
|
|
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
|
|
this.GetFilesCompleted(this, new GetFilesCompletedEventArgs(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)
|
|
&& (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
|
|
/// <remarks/>
|
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.7.3062.0")]
|
|
public delegate void GetFilesCompletedEventHandler(object sender, GetFilesCompletedEventArgs e);
|
|
|
|
/// <remarks/>
|
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.7.3062.0")]
|
|
[System.Diagnostics.DebuggerStepThroughAttribute()]
|
|
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
|
public partial class GetFilesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
|
|
|
|
private object[] results;
|
|
|
|
internal GetFilesCompletedEventArgs(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 |