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


C# ExpressionVisitor.GetOverloadScopes方法代码示例

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


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

示例1: GetNameOfMethod

 /// <summary>
 /// Получить подсказку параметров метода
 /// </summary>
 public string[] GetNameOfMethod(expression expr, string str, int line, int col, int num_param,ref int defIndex, int choose_param_num, out int param_count)
 {
 	param_count = 0;
 	if (stv.cur_scope == null) return null;
 	if (col +1 > str.Length)
 		col -= str.Length;
 	SymScope si = stv.FindScopeByLocation(line+1,col+1);//stv.cur_scope;
 	if (si == null) 
 	{
 		si = stv.FindScopeByLocation(line,col+1);
 		if (si == null)
 		return null;
 	}
     SetCurrentUsedAssemblies();
 	ExpressionVisitor ev = new ExpressionVisitor(expr, si, stv);
 	List<ProcScope> scopes = ev.GetOverloadScopes();
 	bool was_empty_params = false;
     if (scopes.Count == 0)
     {
         RestoreCurrentUsedAssemblies();
         return null;
     }
 	si = scopes[0];
 	//if (si is ElementScope && (si as ElementScope).sc is ProcScope) si = (si as ElementScope).sc as ProcScope;
 	//if (si is ElementScope && (si as ElementScope).sc is ProcType) si = ((si as ElementScope).sc as ProcType).target;
 	if (si != null && si is ProcScope)
 	{
 		List<string> procs = new List<string>();
 		List<ProcScope> proc_defs = new List<ProcScope>();
 		ProcScope ps = si as ProcScope;
 		int i = 0; bool stop = false;
 		ProcScope tmp = ps;
 		while (i < scopes.Count)
 		{
 			if (i == defIndex) 
 			{
 				if (tmp.GetParametersCount() != 0)
 				{
 					choose_param_num = tmp.GetParametersCount();
 					param_count = choose_param_num;
 				}
 				break;
 			}
 			i++;
 			tmp = scopes[i];
 		}
 		i = 0;
 		while (ps != null)
 		{
 			//if (!ps.si.name.StartsWith("$"))
 			//if (!stop && ((ps.GetParametersCount() >= num_param) || ps.GetParametersCount() == 0 && num_param == 1 && choose_param_num==1))
 			//if (i == defIndex) param_count = ps.GetParametersCount();
 			if (!stop && num_param > choose_param_num && ps.GetParametersCount() >= num_param && ps.GetParametersCount() > choose_param_num)
 			{
 				//if (ps.GetParametersCount() >= choose_param_num && choose_param_num == 1 || choose_param_num > 1 && ps.GetParametersCount() > choose_param_num)
 				{
 					defIndex = i;
 					stop = true;
 					param_count = ps.GetParametersCount();
 				}
 				//System.Diagnostics.Debug.WriteLine(defIndex);
 			}
 			if (ps is CompiledMethodScope)
 				ps.AddDocumentation(AssemblyDocCache.GetDocumentation((ps as CompiledMethodScope).mi));
 			else if (ps is CompiledConstructorScope)
 				ps.AddDocumentation(AssemblyDocCache.GetDocumentation((ps as CompiledConstructorScope).mi));
 			else if (ps is ProcScope)
 			{
 				if (!ps.si.has_doc)
 				{
 					ps.AddDocumentation(UnitDocCache.GetDocumentation(ps as ProcScope));
 				}
 			}
 			if (ps.acc_mod == access_modifer.protected_modifer || ps.acc_mod == access_modifer.private_modifer)
 			{
 				if (ps.acc_mod == access_modifer.private_modifer)
 				{
 					if (ev.IsInOneModule(ev.entry_scope,ps.topScope))
 						if (!ps.si.not_include && !equal_params(ps,proc_defs))
 						{
 							procs.Add(ps.si.description);
 							proc_defs.Add(ps);
 						}
 				}
 				else
 				if (ev.CheckForBaseAccess(ev.entry_scope,ps.topScope))
 					if (!ps.si.not_include && !equal_params(ps,proc_defs))
 					{
 						procs.Add(ps.si.description);
 						proc_defs.Add(ps);
 					}
 			}
 			else 
 			if (!ps.si.not_include)
 			/*if (ps.GetParametersCount() == 0)
 			{
 				if (!was_empty_params)
//.........这里部分代码省略.........
开发者ID:PascalABC-CompilerLaboratory,项目名称:pascalabcnet,代码行数:101,代码来源:DomConverter.cs


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