示例#1
0
        internal void LoadParserMethods(Assembly asm)
        {
            IEnumerable <MethodInfo> methods = Parser.GetExtensionMethods(asm, this.GetType());

            _tempParserExtensionGates = LoadExtMethods(methods);
            if (_parserExtensionGates == null)
            {
                IEnumerable <MethodInfo> methods1 =
                    Parser.GetExtensionMethods(Assembly.GetAssembly(this.GetType()), this.GetType());
                _parserExtensionGates = LoadExtMethods(methods1);
            }
            _allParserExtensionGates = MergeLeft <string, List <MethodInfo> >(_parserExtensionGates, _tempParserExtensionGates);
        }
示例#2
0
        internal void LoadLibMethods(Assembly asm)
        {
            IEnumerable <MethodInfo> methods = Parser.GetExtensionMethods(asm, typeof(Quantum.QuantumComputer));

            _tempLibExtensionGates = LoadExtMethods(methods);
            if (_libExtensionGates == null)
            {
                IEnumerable <MethodInfo> methods1 = Parser.GetExtensionMethods(
                    Assembly.GetAssembly(typeof(Quantum.QuantumComputer)),
                    typeof(Quantum.QuantumComputer));
                _libExtensionGates = LoadExtMethods(methods1);
            }
            _allLibExtensionGates = MergeLeft <string, List <MethodInfo> >(_libExtensionGates, _tempLibExtensionGates);
        }