Ejemplo n.º 1
0
 /// <summary>
 /// Initialises a new ASM squencer with specified settings and handlers.
 /// </summary>
 /// <param name="aSettings">The settings to use.</param>
 /// <param name="anOutputError">The reference to the method to call to output an error message.</param>
 /// <param name="anOutputMessage">The reference to the method to call to output a standard message.</param>
 /// <param name="anOutputWarning">The reference to the method to call to output a warning message.</param>
 public ASMSequencer(Settings aSettings,
                     OutputErrorDelegate anOutputError,
                     OutputMessageDelegate anOutputMessage,
                     OutputWarningDelegate anOutputWarning)
 {
     TheSettings = aSettings;
     OutputError = anOutputError;
     OutputMessage = anOutputMessage;
     OutputWarning = anOutputWarning;
 }
Ejemplo n.º 2
0
 private void OutputMessage(string msg)
 {
     if (this.InvokeRequired)
     {
         // if operating on a thread, invoke a delegate
         // on the UI thread.
         OutputMessageDelegate omd =
             new OutputMessageDelegate(OutputMessage);
         IAsyncResult arx = this.BeginInvoke(
             omd, new object[] { msg });
         this.EndInvoke(arx);
         return;
     }
     txtNote.AppendText(msg + "\r\n");
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Initialises a new ILCompiler instance with the specified settings and output handlers.
        /// </summary>
        /// <param name="aSettings">The settings to use for the ILCompiler.</param>
        /// <param name="anOutputError">The reference to the method to call to output an error message.</param>
        /// <param name="anOutputMessage">The reference to the method to call to output a standard message.</param>
        /// <param name="anOutputWarning">The reference to the method to call to output a warning message.</param>
        public ILCompiler(Settings aSettings, 
                          OutputErrorDelegate anOutputError, 
                          OutputMessageDelegate anOutputMessage,
                          OutputWarningDelegate anOutputWarning)
        {
            TheSettings = aSettings;
            OutputError = anOutputError;
            OutputMessage = anOutputMessage;
            OutputWarning = anOutputWarning;

            if (OutputError == null)
            {
                //Prevents null reference exceptions
                OutputError = (Exception ex) =>
                {
                    //Empty placeholder function
                };
            }
            if (OutputMessage == null)
            {
                //Prevents null reference exceptions
                OutputMessage = (string message) =>
                {
                    //Empty placeholder function
                };
            }
            if (OutputWarning == null)
            {
                //Prevents null reference exceptions
                OutputWarning = (Exception ex) =>
                {
                    //Empty placeholder function
                };
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Initialises a new ILReader with the specified assembly manager and output handlers.
        /// </summary>
        /// <param name="aSettings">The settings to use.</param>
        /// <param name="anAssemblyManager">The assembly manager to use.</param>
        /// <param name="anOutputError">The reference to the method to call to output an error message.</param>
        /// <param name="anOutputMessage">The reference to the method to call to output a standard message.</param>
        /// <param name="anOutputWarning">The reference to the method to call to output a warning message.</param>
        /// <exception cref="System.Exception">
        /// Thrown if the IL op types fail to load.
        /// </exception>
        public ILReader(Settings aSettings,
                        AssemblyManager anAssemblyManager,
                        OutputErrorDelegate anOutputError,
                        OutputMessageDelegate anOutputMessage,
                        OutputWarningDelegate anOutputWarning)
        {
            TheSettings = aSettings;
            TheAssemblyManager = anAssemblyManager;
            OutputError = anOutputError;
            OutputMessage = anOutputMessage;
            OutputWarning = anOutputWarning;

            if (!LoadILOpTypes())
            {
                throw new Exception("Failed to load IL op types!");
            }
        }