Exemplo n.º 1
0
        Reply Index(Request request)
        {
            List <string> regionStrings = new List <string>();

            foreach (var profile in StatisticsService.GetActiveProfiles())
            {
                //Avoid race conditions since the profile is modified by other threads
                lock (profile)
                    regionStrings.Add(string.Format("[{0}, {1}, {2}]", GetJavaScriptString(profile.Abbreviation), GetJavaScriptString(profile.Description), profile.Identifier));
            }
            string regions = string.Format("[{0}]", string.Join(", ", regionStrings));
            string content = IndexContents;

            content = content.Replace("$REGIONS", regions);
            content = content.Replace("$PRIVILEGES", GetPrivilegeString(request));
            content = content.Replace("$REVISION", Assembly.GetEntryAssembly().GetName().Version.Revision.ToString());
            return(new Reply(content));
        }