private static void LoadSnippetElement(SnippetElement element, Snippet snippet)
        {
            if (element.Code != null)
                LoadCodeElement(element.Code, snippet);

            if (element.Declarations != null)
                LoadDeclarationsElement(element.Declarations, snippet);

            if (element.Imports != null)
                LoadImports(element.Imports, snippet);

            if (element.References != null)
                LoadReferences(element.References, snippet);
        }
        private static SnippetElement CreateSnippetElement(SerializationContext context)
        {
            var element = new SnippetElement();

            element.Code = CreateCodeElement(context);

            if (context.Snippet.Literals.Count > 0)
                element.Declarations = CreateDeclarationsElement(context);

            element.Imports = CreateImportsElements(context.Snippet.Namespaces);
            element.References = CreateReferenceElements(context.Snippet.AssemblyReferences);

            return element;
        }