src/sys/dotnet/fanx/emit/Emitter.cs
/// <summary>
/// Commit the current definition to the PE file.
/// </summary>
Commit the current definition to the PE file.
Commit the current definition to the PE file .
public byte[] commit()
    {
      if (stub)
      {
        peFile.WritePEFile(false);
        return null;
      }
      else if (debug)
      {
        if (!File.Exists(fileName))
        {
          peFile.MakeDebuggable(true, true);
          peFile.WritePEFile(true);
        }
        return null;
      }
      else if (cache)
      {
        if (!File.Exists(fileName)) peFile.WritePEFile(false);
        return null;
      }
      else
      {
        peFile.WritePEFile(false);
        return (buf as MemoryStream).ToArray();
      }
    }
public byte [ ] commit ( ) { if ( stub ) { peFile . WritePEFile ( false ) ; return null ; } else if ( debug ) { if ( ! File . Exists ( fileName ) ) { peFile . MakeDebuggable ( true , true ) ; peFile . WritePEFile ( true ) ; } return null ; } else if ( cache ) { if ( ! File . Exists ( fileName ) ) peFile . WritePEFile ( false ) ; return null ; } else { peFile . WritePEFile ( false ) ; return ( buf as MemoryStream ) . ToArray ( ) ; } }
Commit the current definition to the PE file.
Commit the current definition to the PE file .
// if the file already exists, we'll just assume that // file is valid, and reuse it - this can occur when // multiple processes are running fan // if the file already exists, we'll just assume that // file is valid, and reuse it - this can occur when // multiple processes are running fan