GenFu.Web.Models.SourceCode.CleanSource C# (CSharp) Method

CleanSource() private method

private CleanSource ( string source ) : string
source string
return string
        private string CleanSource(string source)
        {
            var newSource = new StringBuilder();

            // add some useful usings
            var usings = new List<string>
            {
                // for now, just the one?
                "using System;"
            };
            foreach (var useingthing in usings)
            {
                if ((CultureInfo.CurrentCulture.CompareInfo.IndexOf(source, useingthing, CompareOptions.IgnoreCase) < 0))
                    newSource.AppendLine(useingthing);
            }

            // add original source
            newSource.Append(source);

            return newSource.ToString();
        }