本文整理汇总了C#中IParser.Reset方法的典型用法代码示例。如果您正苦于以下问题:C# IParser.Reset方法的具体用法?C# IParser.Reset怎么用?C# IParser.Reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IParser
的用法示例。
在下文中一共展示了IParser.Reset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Reload
public void Reload()
{
Parsers.Clear();
LastParser = null;
string dir = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName);
DirectoryInfo di = new DirectoryInfo(dir);
FileInfo[] dllfiles = di.GetFiles("*Parser.dll");
System.Reflection.Assembly asssembly = null;
Type constr = null;
IParser pc = null;
foreach (FileInfo fi in dllfiles)
{
/*if (Path.GetFileName(fi.FullName)=="PascalABCParser.dll" &&
string.Compare(Path.GetFileName(System.Reflection.Assembly.GetEntryAssembly().ManifestModule.FullyQualifiedName),"PascalABCNET.exe",true)==0)
continue;
else
if (Path.GetFileName(fi.FullName)=="PascalABCPartParser.dll" &&
string.Compare(Path.GetFileName(System.Reflection.Assembly.GetEntryAssembly().ManifestModule.FullyQualifiedName),"pabcnetc.exe",true)==0)
continue;*/
//if (Path.GetFileName(fi.FullName) != "PascalABCParser.dll" && Path.GetFileName(fi.FullName) != "VBNETParser.dll")
// continue;
//if (Path.GetFileName(fi.FullName) == "VBNETParser.dll" || Path.GetFileName(fi.FullName) == "PascalABCPartParser.dll")
//if (Path.GetFileName(fi.FullName) != "PascalABCParser.dll" && Path.GetFileName(fi.FullName) != "VBNETParser.dll")
// continue;
//if (Path.GetFileName(fi.FullName) == "PascalABCPartParser.dll")
// continue;
//if (Path.GetFileName(fi.FullName) != "PascalABCParser.dll" /*&& Path.GetFileName(fi.FullName) != "VBNETParser.dll"*/)
// continue;
if (Path.GetFileName(fi.FullName) == "VBNETParser.dll" || Path.GetFileName(fi.FullName) == "PascalABCPartParser.dll")
continue;
asssembly = System.Reflection.Assembly.LoadFile(fi.FullName);
try
{
Type[] types = asssembly.GetTypes();
if (asssembly != null)
{
foreach (Type type in types)
{
if (type.Name.IndexOf("LanguageParser") >= 0)
{
Object obj = Activator.CreateInstance(type);
if (obj is IParser)
{
LastParser = (IParser)obj;
Parsers.Add(LastParser);
LastParser.Reset();//«десь поисходит инициализаци¤ парсеров
LastParser.SourceFilesProvider = sourceFilesProvider;
if (ParserConnected != null)
ParserConnected(LastParser);
}
}
}
}
}
catch (Exception e)
{
Console.Error.WriteLine("Parser {0} loading error {1}", Path.GetFileName(fi.FullName),e);
}
}
LastParser = null;
}