Init() public method

Initialize, but do not bind.
public Init ( string name, string namespaceUri, int numArgs, Type objectType, BindingFlags flags ) : void
name string
namespaceUri string
numArgs int
objectType System.Type
flags BindingFlags
return void
Ejemplo n.º 1
0
        public XmlExtensionFunction Bind(
            string name,
            string namespaceUri,
            int numArgs,
            [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] Type objectType,
            BindingFlags flags)
        {
            XmlExtensionFunction func;

            _funcCached ??= new XmlExtensionFunction();

            // If the extension function already exists in the table, then binding has already been performed
            _funcCached.Init(name, namespaceUri, numArgs, objectType, flags);
            if (!_table.TryGetValue(_funcCached, out func))
            {
                // Function doesn't exist, so bind it and enter it into the table
                func        = _funcCached;
                _funcCached = null;

                func.Bind();
                _table.Add(func, func);
            }

            return(func);
        }
Ejemplo n.º 2
0
        public XmlExtensionFunction Bind(string name, string namespaceUri, int numArgs, Type objectType, BindingFlags flags)
        {
            XmlExtensionFunction func;

            if (_funcCached == null)
            {
                _funcCached = new XmlExtensionFunction();
            }

            // If the extension function already exists in the table, then binding has already been performed
            _funcCached.Init(name, namespaceUri, numArgs, objectType, flags);
            if (!_table.TryGetValue(_funcCached, out func))
            {
                // Function doesn't exist, so bind it and enter it into the table
                func        = _funcCached;
                _funcCached = null;

                func.Bind();
                _table.Add(func, func);
            }

            return(func);
        }