本文整理汇总了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();
}
示例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();
}
}
示例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();
}
}