Ejemplo n.º 1
0
		public CheckItem(Rule.KeepAliveCallback callback)
		{
			m_callback = callback;
			m_dispatcher = new RuleDispatcher(this);
		}
Ejemplo n.º 2
0
        private void DoRunTest(Rule rule, List<TypeDefinition> types, AssemblyCache cache)
        {
            RuleDispatcher dispatcher = new RuleDispatcher();
            rule.Register(dispatcher);
            m_failed = false;

            dispatcher.Dispatch(new BeginTesting());
            dispatcher.Dispatch(Assembly);

            dispatcher.Dispatch(new BeginTypes());
            foreach (TypeDefinition t in types)
                dispatcher.Dispatch(t);
            dispatcher.Dispatch(new EndTypes());

            foreach (MethodInfo info in cache.Methods)
            {
                dispatcher.Dispatch(info);
            }

            dispatcher.DispatchCallGraph();
            dispatcher.Dispatch(new EndTesting());
        }
Ejemplo n.º 3
0
		/// <remarks>Callback will be called periodically as types and methods are checked. Smokey
		/// uses this with a watchdog class to ensure no rule falls into an infinite loop.</remarks>
		public AnalyzeAssembly(Rule.KeepAliveCallback callback)
		{
			m_callback = callback;
			m_checker = new CheckItem(callback);
		}