public object VisitGlobalStyle(XshtdGlobalStyles globStyles, XshtdGlobalStyle style)
            {
                if (style.TypeName == null)
                {
                    throw Error(style, "Name must not be null");
                }

                if (style.TypeName.Length == 0)
                {
                    throw Error(style, "Name must not be the empty string");
                }

                if (globStyles == null)
                {
                    throw Error(globStyles, "GlobalStyles parameter must not be null");
                }

                if (def.globalStyles.TryGetValue(style.TypeName, out var globDef) == false)
                {
                    throw Error(style, "Style definition '" + style.TypeName + "' does not exist in collection of GlobalStyles.");
                }

                globDef.backgroundcolor = style.background;
                globDef.foregroundcolor = style.foreground;
                globDef.bordercolor     = style.bordercolor;
                globDef.Freeze();

                return(globDef);
            }
            public object VisitGlobalStyle(XshtdGlobalStyles globStyles, XshtdGlobalStyle style)
            {
                if (style.TypeName != null)
                {
                    if (style.TypeName.Length == 0)
                    {
                        throw Error(style, "Name must not be the empty string");
                    }

                    if (globStyles == null)
                    {
                        throw Error(globStyles, "GlobalStyles parameter must not be null");
                    }

                    GlobalStyle globDef;
                    if (def.globalStyles.TryGetValue(style.TypeName, out globDef) == true)
                    {
                        throw Error(style, "GlobalStyle definition '" + style.TypeName + "' has duplicates.");
                    }

                    globDef = new GlobalStyle(style.TypeName);
                    globDef.backgroundcolor = style.background;
                    globDef.foregroundcolor = style.foreground;
                    globDef.bordercolor     = style.bordercolor;

                    globDef.Freeze();

                    def.globalStyles.Add(style.TypeName, new GlobalStyle(style.TypeName));
                }

                return(null);
            }