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


C# IParser.Reset方法代码示例

本文整理汇总了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;
		}
开发者ID:CSRedRat,项目名称:pascalabcnet,代码行数:61,代码来源:ParsersController.cs


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