public void Close()
        {
            MonoSymbolWriter writer = new MonoSymbolWriter(moduleBuilder.FullyQualifiedName);

            foreach (Method method in methods.Values)
            {
                if (method.document != null)
                {
                    if (method.document.source == null)
                    {
                        method.document.source = new SourceFileEntry(writer.SymbolFile, method.document.url);
                    }
                    ICompileUnit        file = new CompileUnitEntry(writer.SymbolFile, method.document.source);
                    SourceMethodBuilder smb  = writer.OpenMethod(file, 0, method);
                    for (int i = 0; i < method.offsets.Length; i++)
                    {
                        smb.MarkSequencePoint(method.offsets[i], method.document.source, method.lines[i], method.columns[i], false);
                    }
                    for (int i = 0; i < method.variables.Count; i++)
                    {
                        writer.DefineLocalVariable(i, method.variables[i]);
                    }
                    writer.CloseMethod();
                }
            }

            writer.WriteSymbolFile(moduleBuilder.ModuleVersionId);
        }
 public static void CloseMethod()
 {
     if (symwriter != null)
     {
         symwriter.CloseMethod();
     }
 }