예제 #1
0
        /// <summary>
        /// Set token to layer from associated server
        /// </summary>
        public void UpdateTokenIfNeeded()
        {
            Debug.Assert(ArcGISLayer != null);

            bool needToUpdateToken = false;

            try
            {
                needToUpdateToken = Server.RequiresTokens;
            }
            catch (InvalidOperationException)
            {
                // Eat exception in case of unavailable server
            }

            // set last server token to layer
            if (needToUpdateToken)
            {
                // If token updater didnt exist - create it.
                if (_tokenUpdater == null)
                {
                    _tokenUpdater = new TokenUpdater(Server, ArcGISLayer, LayerType);
                }
                // Otherwise - use token updater to update token.
                else
                {
                    _tokenUpdater.SetNewToken();
                }
            }
        }
예제 #2
0
        /// <summary>
        /// Set token to layer from associated server
        /// </summary>
        public void UpdateTokenIfNeeded()
        {
            Debug.Assert(ArcGISLayer != null);

            bool needToUpdateToken = false;

            try
            {
                needToUpdateToken = Server.RequiresTokens;
            }
            catch (InvalidOperationException)
            {
                // Eat exception in case of unavailable server
            }

            // set last server token to layer
            if (needToUpdateToken)
            {
                // If token updater didnt exist - create it.
                if (_tokenUpdater == null)
                    _tokenUpdater = new TokenUpdater(Server, ArcGISLayer, LayerType);
                // Otherwise - use token updater to update token.
                else
                    _tokenUpdater.SetNewToken();
            }
        }