private bool CheckForFault(DownloadStringCompletedEventArgs e, out Exception ex)
{
if (e.Cancelled)
{
if (this.Failed != null)
{
this.Failed(this, new MapServiceFaultEventArgs { Cancelled = true });
}
ex = null;
return true;
}
if (e.Error != null)
{
Exception inner = e.Error;
if (this.Failed != null)
{
if (inner is SecurityException)
{
inner = new SecurityException(SuperMap.Web.Resources.ExceptionStrings.PolicyFileAvailable, inner);
}
this.Failed(this, new MapServiceFaultEventArgs { Error = inner });
}
ex = inner;
return true;
}
if (e.Result == "null" || String.IsNullOrEmpty(e.Result))
{
Exception inner = null;
if (this.Failed != null)
{
inner = new Exception(ExceptionStrings.ServiceStarted);
this.Failed(this, new MapServiceFaultEventArgs { Error = inner });
}
ex = inner;
return true;
}
ex = null;
return false;
}