当前位置: 首页>>代码示例>>C#>>正文


C# IPluginVisitor.EnterPlugin方法代码示例

本文整理汇总了C#中IPluginVisitor.EnterPlugin方法的典型用法代码示例。如果您正苦于以下问题:C# IPluginVisitor.EnterPlugin方法的具体用法?C# IPluginVisitor.EnterPlugin怎么用?C# IPluginVisitor.EnterPlugin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IPluginVisitor的用法示例。


在下文中一共展示了IPluginVisitor.EnterPlugin方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoadPlugin

        /// <summary>
        /// Parses an XML plugin, calling the corresponding method in
        /// IPluginVisitor for each XML tag it encounters.
        /// </summary>
        /// <param name="reader">The XmlReader to read the plugin XML from.</param>
        /// <param name="visitor">The IPluginVisitor to call for each XML tag.</param>
        public static void LoadPlugin(XmlReader reader, IPluginVisitor visitor)
        {
            if (!reader.ReadToNextSibling("plugin"))
                throw new ArgumentException("The XML file is missing a <plugin> tag.");

            var baseSize = 0;
            if (reader.MoveToAttribute("baseSize"))
                baseSize = ParseInt(reader.Value);

            if (!visitor.EnterPlugin(baseSize)) return;
            ReadElements(reader, true, visitor);
            visitor.LeavePlugin();
        }
开发者ID:iBotPeaches,项目名称:Assembly,代码行数:19,代码来源:AssemblyPluginLoader.cs

示例2: LoadPlugin

        /// <summary>
        /// Parses an XML plugin, calling the corresponding method in
        /// IPluginVisitor for each XML tag it encounters.
        /// </summary>
        /// <param name="reader">The XmlReader to read the plugin XML from.</param>
        /// <param name="visitor">The IPluginVisitor to call for each XML tag.</param>
        public static void LoadPlugin(XmlReader reader, IPluginVisitor visitor)
        {
            if (!reader.ReadToNextSibling("plugin"))
                throw new ArgumentException("The XML file is missing a <plugin> tag.");

            if (!reader.MoveToAttribute("baseSize"))
                throw new ArgumentException("The <plugin> tag is missing the baseSize attribute." + PositionInfo(reader));

            int baseSize = ParseInt(reader.Value);
            if (visitor.EnterPlugin(baseSize))
            {
                ReadElements(reader, true, visitor);
                visitor.LeavePlugin();
            }
        }
开发者ID:YxCREATURExY,项目名称:Assembly,代码行数:21,代码来源:AssemblyPluginLoader.cs

示例3: LoadPlugin

        /// <summary>
        /// Parses an XML plugin, calling the corresponding method in
        /// IPluginVisitor for each XML tag it encounters.
        /// </summary>
        /// <param name="reader">The XmlReader to read the plugin XML from.</param>
        /// <param name="visitor">The IPluginVisitor to call for each XML tag.</param>
        public static void LoadPlugin(XmlReader reader, IPluginVisitor visitor)
        {
            if (!reader.ReadToNextSibling("plugin"))
                throw new ArgumentException("The XML file is missing a <plugin> tag.");

            if (!reader.MoveToAttribute("headersize") && !reader.MoveToAttribute("baseSize"))
                throw new ArgumentException("The plugin is missing tag size information.");
            int baseSize = ParseInt(reader.Value);

            if (visitor.EnterPlugin(baseSize))
            {
                UniversalPluginLoader loader = new UniversalPluginLoader();
                loader.ReadElements(reader, true, visitor);
                visitor.LeavePlugin();
            }
        }
开发者ID:YxCREATURExY,项目名称:Assembly,代码行数:22,代码来源:UniversalPluginLoader.cs


注:本文中的IPluginVisitor.EnterPlugin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。