/// <summary>
        /// Applies the global variables.
        /// </summary>
        /// <param name="visualStudioService">The visual studio service.</param>
        /// <param name="codeSnippet">The code snippet.</param>
        public void ApplyGlobals(
            IVisualStudioService visualStudioService,
            CodeSnippet codeSnippet)
        {
            TraceService.WriteLine("SnippetService::ApplyGlobals");

            bool hasGlobals = visualStudioService.DTEService.SolutionService.HasGlobals;

            if (hasGlobals)
            {
                Dictionary<string, string> dictionary = visualStudioService.DTEService.SolutionService.GetGlobalVariables();

                if (dictionary != null)
                {
                    foreach (KeyValuePair<string, string> keyValuePair in dictionary
                        .Where(keyValuePair => keyValuePair.Value != null))
                    {
                        codeSnippet.AddReplacementVariable(keyValuePair.Key, keyValuePair.Value);
                    }
                }
            }
        }
        /// <summary>
        /// Applies the global variables.
        /// </summary>
        /// <param name="visualStudioService">The visual studio service.</param>
        /// <param name="codeSnippet">The code snippet.</param>
        protected void ApplyGlobals(
            IVisualStudioService visualStudioService,
            CodeSnippet codeSnippet)
        {
            TraceService.WriteLine("BaseCodeService::ApplyGlobals");

            Globals globals = visualStudioService.DTE2.Solution.Globals;

            foreach (string variable in (Array)globals.VariableNames)
            {
                string value = globals[variable];

                TraceService.WriteLine("BaseCodeService::ApplyGlobals variable=" + variable + " value=" + value);

                if (value != null)
                {
                    codeSnippet.AddReplacementVariable(variable, value);
                }
            }
        }