//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.1433
//
//     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.50727.1433.
// 
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Threading;
using System.Web.Services;
using System.Web.Services.Description;
using System.Web.Services.Protocols;
using ZANZI.Properties;

#pragma warning disable 1591

namespace ZANZI.localhost
{
    /// <remarks/>
    [GeneratedCode("System.Web.Services", "2.0.50727.1433")]
    [DebuggerStepThrough]
    [DesignerCategory("code")]
    [WebServiceBinding(Name = "ZANZIBugTrackerSoap", Namespace = "http://tempuri.org/")]
    public class ZANZIBugTracker : SoapHttpClientProtocol
    {
        private SendOrPostCallback BugEntryOperationCompleted;

        private bool useDefaultCredentialsSetExplicitly;

        /// <remarks/>
        public ZANZIBugTracker()
        {
            Url = Settings.Default.ZANZI_localhost_ZANZIBugTracker;
            if (IsLocalFileSystemWebService(Url))
            {
                UseDefaultCredentials = true;
                useDefaultCredentialsSetExplicitly = false;
            }
            else
            {
                useDefaultCredentialsSetExplicitly = true;
            }
        }

        public new string Url
        {
            get { return base.Url; }
            set
            {
                if (((IsLocalFileSystemWebService(base.Url)
                      && (useDefaultCredentialsSetExplicitly == false))
                     && (IsLocalFileSystemWebService(value) == false)))
                {
                    base.UseDefaultCredentials = false;
                }
                base.Url = value;
            }
        }

        public new bool UseDefaultCredentials
        {
            get { return base.UseDefaultCredentials; }
            set
            {
                base.UseDefaultCredentials = value;
                useDefaultCredentialsSetExplicitly = true;
            }
        }

        /// <remarks/>
        public event BugEntryCompletedEventHandler BugEntryCompleted;

        /// <remarks/>
        [SoapDocumentMethod("http://tempuri.org/BugEntry", RequestNamespace = "http://tempuri.org/",
            ResponseNamespace = "http://tempuri.org/", Use = SoapBindingUse.Literal,
            ParameterStyle = SoapParameterStyle.Wrapped)]
        public void BugEntry(string Message, string Source, string StackTrace, string TargetSite)
        {
            Invoke("BugEntry", new object[]
                                   {
                                       Message,
                                       Source,
                                       StackTrace,
                                       TargetSite
                                   });
        }

        /// <remarks/>
        public IAsyncResult BeginBugEntry(string Message, string Source, string StackTrace, string TargetSite,
                                          AsyncCallback callback, object asyncState)
        {
            return BeginInvoke("BugEntry", new object[]
                                               {
                                                   Message,
                                                   Source,
                                                   StackTrace,
                                                   TargetSite
                                               }, callback, asyncState);
        }

        /// <remarks/>
        public void EndBugEntry(IAsyncResult asyncResult)
        {
            EndInvoke(asyncResult);
        }

        /// <remarks/>
        public void BugEntryAsync(string Message, string Source, string StackTrace, string TargetSite)
        {
            BugEntryAsync(Message, Source, StackTrace, TargetSite, null);
        }

        /// <remarks/>
        public void BugEntryAsync(string Message, string Source, string StackTrace, string TargetSite, object userState)
        {
            if ((BugEntryOperationCompleted == null))
            {
                BugEntryOperationCompleted = OnBugEntryOperationCompleted;
            }
            InvokeAsync("BugEntry", new object[]
                                        {
                                            Message,
                                            Source,
                                            StackTrace,
                                            TargetSite
                                        }, BugEntryOperationCompleted, userState);
        }

        private void OnBugEntryOperationCompleted(object arg)
        {
            if ((BugEntryCompleted != null))
            {
                InvokeCompletedEventArgs invokeArgs = ((InvokeCompletedEventArgs) (arg));
                BugEntryCompleted(this,
                                  new AsyncCompletedEventArgs(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;
            }
            Uri wsUri = new Uri(url);
            if (((wsUri.Port >= 1024)
                 && (string.Compare(wsUri.Host, "localHost", StringComparison.OrdinalIgnoreCase) == 0)))
            {
                return true;
            }
            return false;
        }
    }

    /// <remarks/>
    [GeneratedCode("System.Web.Services", "2.0.50727.1433")]
    public delegate void BugEntryCompletedEventHandler(object sender, AsyncCompletedEventArgs e);
}

#pragma warning restore 1591