SuperMap.Web.Mapping.TiledCachedIServerLayer.Initialize C# (CSharp) Method

Initialize() public method

${mapping_Layer_method_initialize_D}
public Initialize ( ) : void
return void
        public override void Initialize()
        {
            if (!this.isInitializing && !base.IsInitialized)
            {
                #region 必设参数判断
                if (string.IsNullOrEmpty(this.Url))
                {
                    base.Error = new ArgumentNullException(ExceptionStrings.InvalidUrl);
                    base.Initialize();
                    return;
                }
                if (string.IsNullOrEmpty(this.MapName))
                {
                    base.Error = new ArgumentNullException(ExceptionStrings.MapNameIsNull);
                    base.Initialize();
                    return;
                }
                if (string.IsNullOrEmpty(this.MapServiceAddress))
                {
                    base.Error = new ArgumentNullException(ExceptionStrings.ServiceAddressError);
                    base.Initialize();
                    return;
                }
                if (MapServicePort == int.MaxValue)
                {
                    base.Error = new ArgumentNullException(ExceptionStrings.ServicePortIsNull);
                    base.Initialize();
                    return;
                }
                if (this.Scales == null)
                {
                    base.Error = new ArgumentNullException(ExceptionStrings.ScalesIsNull);
                    base.Initialize();
                    return;
                }//如果是缓存必需设置Scales
                if (string.IsNullOrEmpty(CachedUrl))
                {
                    base.Error = new ArgumentNullException(ExceptionStrings.CachedUrlIsNull);
                    base.Initialize();
                    return;
                }
                #endregion

                if (!Url.Contains("http://"))  //相对地址
                {
                    var pageUrl = System.Windows.Browser.HtmlPage.Document.DocumentUri;
                    var localUrl = pageUrl.AbsoluteUri.Substring(0, pageUrl.AbsoluteUri.IndexOf(pageUrl.AbsolutePath));
                    Url = localUrl + Url;
                }

                if (IsSkipGetSMMapServiceInfo)
                {
                    if (Bounds.IsEmpty)
                    {
                        Error = new ArgumentNullException("Bounds");
                    }
                    Dpi = ScaleHelper.GetSmDpi(ReferViewBounds, ReferViewer, ReferScale);
                    Dpi *= AdjustFactor;
                    double[] resolutions = new double[Scales.Length];
                    for (int i = 0; i < Scales.Length; i++)
                    {
                        resolutions[i] = ScaleHelper.ScaleConversion(Scales[i], this.Dpi);
                    }
                    this.Resolutions = resolutions;

                    this.isInitializing = true;

                    base.Initialize();
                    CreateUrl();
                    return;
                }

                this.isInitializing = true;
                this.mapService = new SmMapService(this.Url.Trim(), this.MapName, this.MapServiceAddress, this.MapServicePort);
                this.mapService.Initialized += new EventHandler<SmMapService.MapServiceInitalizeArgs>(mapService_Initialized);
                this.mapService.Failed += new SmMapService.MapServiceFaultEventHandler(mapService_Fault);
                this.mapService.Initialize();

                CreateUrl();
            }
        }