Beispiel #1
0
        public override void Respond(IHttpContext context)
        {
            if (notifiedAboutSilverlightBeingRequested == false)
            {
                lock (this)
                {
                    if (notifiedAboutSilverlightBeingRequested == false &&
                        SilverlightRequestedAware != null)
                    {
                        SilverlightRequestedAware.SilverlightWasRequested(ResourceStore);
                    }

                    notifiedAboutSilverlightBeingRequested = true;
                }
            }
            var match        = urlMatcher.Match(context.GetRequestUrl());
            var fileName     = match.Groups[1].Value;
            var paths        = GetPaths(fileName);
            var matchingPath = paths.FirstOrDefault(File.Exists);

            if (matchingPath != null)
            {
                context.WriteFile(matchingPath);
                return;
            }
            context.SetStatusToNotFound();
        }
Beispiel #2
0
        public override void Respond(IHttpContext context)
        {
            ResourceStore.ExternalState.GetOrAdd("SilverlightUI.NotifiedAboutSilverlightBeingRequested", s =>
            {
                if (SilverlightRequestedAware != null)
                {
                    SilverlightRequestedAware.SilverlightWasRequested(ResourceStore);
                }
                return(true);
            });

            var match        = urlMatcher.Match(context.GetRequestUrl());
            var fileName     = match.Groups[1].Value;
            var paths        = GetPaths(fileName);
            var matchingPath = paths.FirstOrDefault(File.Exists);

            if (matchingPath != null)
            {
                context.WriteFile(matchingPath);
                return;
            }
            context.SetStatusToNotFound();
        }