Exemple #1
0
        }        // Constructor()

        //---------------------------------------------------------------------
        // Event: HexFileParse
        //---------------------------------------------------------------------
        protected internal void OnHexFileParse(clsHexFileParseEventArgs e)
        {
            // Event will be null if no client has hooked up a delegate to the event
            if (HexFileParse != null)
            {
                HexFileParse(this, e);
            }
        }        //Event: HexFileParse
        void objHex_HexFileParse(object sender, clsHexFileParseEventArgs e)
        {
            clsHex objHex = (clsHex)sender;

            switch (e.eventType)
            {

                case clsHexFileParseEventArgs.EventType.started:
                    txtInfo.Text += "Parsing hex-file..." + Environment.NewLine;
                    break;

                case clsHexFileParseEventArgs.EventType.warning:
                    txtInfo.Text += e.message + Environment.NewLine;
                    break;

                case clsHexFileParseEventArgs.EventType.info:
                    txtInfo.Text += e.message + Environment.NewLine;
                    break;

                case clsHexFileParseEventArgs.EventType.failed:
                    txtInfo.Text += "Parsing of hex-file failed" + Environment.NewLine;
                    break;

                case clsHexFileParseEventArgs.EventType.success:
                    txtInfo.Text += "Hex-file successfully parsed" + Environment.NewLine;
                    txtInfo.Text += Environment.NewLine;
                    txtInfo.Text += objHex.progWordsUsed.ToString() + " program words found in " + objHex.progRowsUsed.ToString() + " rows " + Environment.NewLine;
                    txtInfo.Text += objHex.eeWordsUsed.ToString() + " Eeprom words found " + Environment.NewLine;
                    txtInfo.Text += objHex.configWordsUsed.ToString() + " config words found " + Environment.NewLine;
                    break;

                default:
                    txtInfo.Text += "Unknown hex parse event" + Environment.NewLine;
                    break;
            }
        }
 //---------------------------------------------------------------------
 // Event: HexFileParse
 //---------------------------------------------------------------------
 protected internal void OnHexFileParse( clsHexFileParseEventArgs e )
 {
     // Event will be null if no client has hooked up a delegate to the event
     if ( HexFileParse != null ) {
         HexFileParse( this, e );
     }
 }
		}//DoParse();


		//---------------------------------------------------------------------
		// Hex_Parse()
		//---------------------------------------------------------------------
		private void Hex_Parse( object obj, clsHexFileParseEventArgs e ) 
        { 
            clsHex objHex = (clsHex)obj;

			if ( e.eventType == clsHexFileParseEventArgs.EventType.started ) {
                clsDebugTextbox.OutputInfo( "Parsing hex-file...", e.tabLevel );

            } else if ( e.eventType == clsHexFileParseEventArgs.EventType.warning ) {
                clsDebugTextbox.OutputWarning( e.message, e.tabLevel );
            
            } else if ( e.eventType == clsHexFileParseEventArgs.EventType.info ) {
                clsDebugTextbox.OutputInfo( e.message, e.tabLevel );
            
            } else if ( e.eventType == clsHexFileParseEventArgs.EventType.failed ) {
                clsDebugTextbox.OutputError( "Parsing of hex-file failed", e.tabLevel );                

            } else if ( e.eventType == clsHexFileParseEventArgs.EventType.success ) {
                clsDebugTextbox.OutputSuccess( "Hex-file successfully parsed", e.tabLevel );
                clsDebugTextbox.OutputInfo( "", 0 );
                clsDebugTextbox.OutputInfo( objHex.progWordsUsed.ToString() + " program words found in " + objHex.progRowsUsed.ToString() + " rows " /*+ (objHex.progWordsUsed * 3 ).ToString() + " bytes)"*/, e.tabLevel );
                clsDebugTextbox.OutputInfo( objHex.eeWordsUsed.ToString() + " eeprom words found " /*+ (objHex.eeWordsUsed * 2).ToString() + " bytes)"*/, e.tabLevel);
                clsDebugTextbox.OutputInfo( objHex.configWordsUsed.ToString() + " config words found " /*+ (objHex.configWordsUsed*2).ToString() + " bytes)"*/, e.tabLevel );			
                
            }            
		}//Hex_Parse()