///////////////////////////////////////////////////////////////////////////// public NmpEvaluator( INmpHost host ) : base(host) { // // saves the threads current NMP instance (might be null) and then // sets the NNP instance wrapped by NmpBaseEvaluator as the threads // current NMP instance // makeCurrent = new NMP.NmpMakeCurrent( GetNmpAsObject() as NMP ); }
///////////////////////////////////////////////////////////////////////////// public InputTest( INmpHost host, CmdLineParams cmds ) { // ****** TestMethod testMethod = FileRead; // ****** for( int iCmd = 0; iCmd < cmds.Count; iCmd++ ) { string cmd; string value; // ****** if( cmds.GetCommand(iCmd, out cmd, out value) ) { string key = string.Empty; // ****** if( null == value ) { value = string.Empty; } // ****** //WriteLine( "command {0}, value {1}", cmd, value ); // ****** switch( cmd ) { case "--????--": break; default: host.Die( "unknown command line switch \"{0}\"", cmd ); break; } } else { // // file to run test against // string fileName = value.ToLower().Trim(); fileName = Path.GetFullPath( fileName ); // ****** if( ! File.Exists(fileName) ) { host.Die( "InputTest: unable to locate file \"{0}\"", fileName ); } // ****** testMethod( fileName ); return; } } }
///////////////////////////////////////////////////////////////////////////// public NmpBaseEvaluator( INmpHost host ) { Initialize( null == host ? new DefaultNmpHost() : host ); }
///////////////////////////////////////////////////////////////////////////// public bool Initialize( INmpHost host ) { // // if null == host then create a reporting host // nmp = new NMP( host ); return null != nmp; }
///////////////////////////////////////////////////////////////////////////// public Notifications( INmpHost host, InvocationStack stack ) { // ****** nmpInstance = ++_nmpInstance; //idNmpInstance = string.Format( "[{0}] ", nmpInstance ); idNmpInstance = string.Format( "[Nmp instance:{0}] ", nmpInstance ); // ****** this.host = host; this.invocationStack = stack; }
///////////////////////////////////////////////////////////////////////////// public NMP( INmpHost host ) { // ****** if( null == host ) { throw new ArgumentNullException( "host" ); } // ****** AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler( ResolveEventHandler ); // ****** // // need to make current BEFORE INotification has been created; need to // set it up so we can use INotification at this point - maybe new it and // set bind it later, or - do we need to bind it ?? // threadContext = ThreadContext.CreateThreadStorage(); // // make sure we're the current context // using( new NmpMakeCurrent(this) ) { gc = new GrandCentral( this, host ); SetDefaults(); NmpScannerInitialize( gc.Get<IMacroProcessorBase>(), null ); } // ****** // // see ThreadContext.CreateThreadStorage() above // ThreadContext.Notifications = Get<INotifications>(); }