コード例 #1
0
        private void Parse(XPathNavigator classCacheElement)
        {
            if (classCacheElement.MoveToFirstAttribute())
            {
                do
                {
                    switch (classCacheElement.Name)
                    {
                    case "class":
                        if (classCacheElement.Value.Trim().Length == 0)
                        {
                            throw new HibernateConfigException("Invalid class-cache element; the attribute <class> must be assigned with no empty value");
                        }
                        clazz = classCacheElement.Value;
                        break;

                    case "usage":
                        usage = CfgXmlHelper.ClassCacheUsageConvertFrom(classCacheElement.Value);
                        break;

                    case "region":
                        region = classCacheElement.Value;
                        break;

                    case "include":
                        include = CfgXmlHelper.ClassCacheIncludeConvertFrom(classCacheElement.Value);
                        break;
                    }
                }while (classCacheElement.MoveToNextAttribute());
            }
        }
コード例 #2
0
        private void Parse(XPathNavigator eventElement)
        {
            XPathNavigator eventClone = eventElement.Clone();

            eventElement.MoveToFirstAttribute();
            type = CfgXmlHelper.ListenerTypeConvertFrom(eventElement.Value);
            XPathNodeIterator listenersI = eventClone.SelectDescendants(XPathNodeType.Element, false);

            while (listenersI.MoveNext())
            {
                listeners.Add(new ListenerConfiguration(listenersI.Current, type));
            }
        }
コード例 #3
0
        private void ParseByteCodeProvider(XPathNavigator navigator, bool fromAppConfig)
        {
            XPathNavigator xpn = navigator.SelectSingleNode(CfgXmlHelper.ByteCodeProviderExpression);

            if (xpn != null)
            {
                if (fromAppConfig)
                {
                    xpn.MoveToFirstAttribute();
                    byteCodeProviderType = CfgXmlHelper.ByteCodeProviderConvertFrom(xpn.Value);
                }
                else
                {
                    LogWarnIgnoredProperty("bytecode-provider");
                }
            }
        }
コード例 #4
0
        private void Parse(XPathNavigator listenerElement)
        {
            if (listenerElement.MoveToFirstAttribute())
            {
                do
                {
                    switch (listenerElement.Name)
                    {
                    case "class":
                        if (string.IsNullOrWhiteSpace(listenerElement.Value))
                        {
                            throw new HibernateConfigException("Invalid listener element; the attribute <class> must be assigned with no empty value");
                        }
                        clazz = listenerElement.Value;
                        break;

                    case "type":
                        type = CfgXmlHelper.ListenerTypeConvertFrom(listenerElement.Value);
                        break;
                    }
                }while (listenerElement.MoveToNextAttribute());
            }
        }