Beispiel #1
0
        public void ResolveAll()
        {
            // Resolve until we reach a 'steady state' (no more references added)
            Errors.Clear();
            int resolvedCount = InlinedSchemas.Keys.Count;

            while (resolvedCount != References.Count)
            {
                resolvedCount = References.Count;
                DiscoveryReference[] refs = new DiscoveryReference[References.Count];
                References.Values.CopyTo(refs, 0);
                for (int i = 0; i < refs.Length; i++)
                {
                    DiscoveryReference discoRef = refs[i];
                    if (discoRef is DiscoveryDocumentReference)
                    {
                        try {
                            // Resolve discovery document references deeply
                            ((DiscoveryDocumentReference)discoRef).ResolveAll(true);
                        }
                        catch (Exception e) {
                            if (e is ThreadAbortException || e is StackOverflowException || e is OutOfMemoryException)
                            {
                                throw;
                            }
                            // don't let the exception out - keep going. Just add it to the list of errors.
                            Errors[discoRef.Url] = e;
                            if (Tracing.On)
                            {
                                Tracing.ExceptionCatch(TraceEventType.Warning, this, "ResolveAll", e);
                            }
                        }
                    }
                    else
                    {
                        try {
                            discoRef.Resolve();
                        }
                        catch (Exception e) {
                            if (e is ThreadAbortException || e is StackOverflowException || e is OutOfMemoryException)
                            {
                                throw;
                            }
                            // don't let the exception out - keep going. Just add it to the list of errors.
                            Errors[discoRef.Url] = e;
                            if (Tracing.On)
                            {
                                Tracing.ExceptionCatch(TraceEventType.Warning, this, "ResolveAll", e);
                            }
                        }
                    }
                }
            }
            FixupReferences();
        }
        public void ResolveAll()
        {
            this.Errors.Clear();
            int count = this.InlinedSchemas.Keys.Count;

            while (count != this.References.Count)
            {
                count = this.References.Count;
                DiscoveryReference[] array = new DiscoveryReference[this.References.Count];
                this.References.Values.CopyTo(array, 0);
                for (int i = 0; i < array.Length; i++)
                {
                    DiscoveryReference reference = array[i];
                    if (reference is DiscoveryDocumentReference)
                    {
                        try
                        {
                            ((DiscoveryDocumentReference)reference).ResolveAll(true);
                        }
                        catch (Exception exception)
                        {
                            if (((exception is ThreadAbortException) || (exception is StackOverflowException)) || (exception is OutOfMemoryException))
                            {
                                throw;
                            }
                            this.Errors[reference.Url] = exception;
                            if (Tracing.On)
                            {
                                Tracing.ExceptionCatch(TraceEventType.Warning, this, "ResolveAll", exception);
                            }
                        }
                    }
                    else
                    {
                        try
                        {
                            reference.Resolve();
                        }
                        catch (Exception exception2)
                        {
                            if (((exception2 is ThreadAbortException) || (exception2 is StackOverflowException)) || (exception2 is OutOfMemoryException))
                            {
                                throw;
                            }
                            this.Errors[reference.Url] = exception2;
                            if (Tracing.On)
                            {
                                Tracing.ExceptionCatch(TraceEventType.Warning, this, "ResolveAll", exception2);
                            }
                        }
                    }
                }
            }
            this.FixupReferences();
        }
        public void ResolveAll()
        {
            // Resolve until we reach a 'steady state' (no more references added)
            Errors.Clear();
            int resolvedCount = 0;

            while (resolvedCount != References.Count)
            {
                resolvedCount = References.Count;
                DiscoveryReference[] refs = new DiscoveryReference[References.Count];
                References.Values.CopyTo(refs, 0);
                for (int i = 0; i < refs.Length; i++)
                {
                    DiscoveryReference discoRef = refs[i];
                    if (discoRef is DiscoveryDocumentReference)
                    {
                        try {
                            // Resolve discovery document references deeply
                            ((DiscoveryDocumentReference)discoRef).ResolveAll(true);
                        }
                        catch (Exception e) {
                            // don't let the exception out - keep going. Just add it to the list of errors.
                            Errors[discoRef.Url] = e;
                        }
                    }
                    else
                    {
                        try {
                            discoRef.Resolve();
                        }
                        catch (Exception e) {
                            // don't let the exception out - keep going. Just add it to the list of errors.
                            Errors[discoRef.Url] = e;
                        }
                    }
                }
            }
        }