コード例 #1
0
        /// <summary>
        /// Loads the specified assembly.
        /// </summary>
        /// <param name="AssemblyPath">The assembly path.</param>
        public void Load(string AssemblyPath)
        {
            target = AppDomain.CurrentDomain.CreateInstanceFromAndUnwrap(AssemblyPath, "UserCode.UserCode");
            if (macromanager.MacrosAreRunning)
                macromanager.StopCode();

            macromanager.ClearMacros();

            foreach (MethodInfo info in target.GetType().GetMethods())
            {
                GeneralTrigger trigger = GetTrigger(info);

                if (trigger != null)
                {
                    MacroCode macro = new MacroCode(trigger, info, target);
                    macromanager.AddMacro(macro);
                }
            }
        }
コード例 #2
0
 /// <summary>
 /// Adds the macro.
 /// </summary>
 /// <param name="macro">The macro.</param>
 internal void AddMacro(MacroCode macro)
 {
     macro.ErrorOccured += new MacroErrorEventHandler(OnErrorOccured);
     macrolist.Add(macro);
 }