JsonFx.UI.Jbst.JbstWriter.GetGlobals C# (CSharp) Method

GetGlobals() private method

Generates a globals list from import directives
private GetGlobals ( ) : string
return string
        private string GetGlobals()
        {
            StringBuilder globals = new StringBuilder();

            this.Imports.Insert(0, "JsonML.BST");

            foreach (string import in this.Imports)
            {
                string ident = EcmaScriptIdentifier.EnsureValidIdentifier(import, true);

                if (String.IsNullOrEmpty(ident))
                {
                    continue;
                }

                if (globals.Length > 0)
                {
                    globals.Append(", ");
                }

                int dot = ident.IndexOf('.');
                globals.Append((dot < 0) ? ident : ident.Substring(0, dot));
            }

            return globals.ToString();
        }