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


C# NRefactoryResolver类代码示例

本文整理汇总了C#中NRefactoryResolver的典型用法代码示例。如果您正苦于以下问题:C# NRefactoryResolver类的具体用法?C# NRefactoryResolver怎么用?C# NRefactoryResolver使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: FindReferences

		public override IEnumerable<MemberReference> FindReferences (ProjectDom dom, FilePath fileName, IEnumerable<INode> searchedMembers)
		{
			HashSet<int > positions = new HashSet<int> ();
			var editor = TextFileProvider.Instance.GetTextEditorData (fileName);
			FindMemberAstVisitor visitor = new FindMemberAstVisitor (editor.Document);
			visitor.IncludeXmlDocumentation = IncludeDocumentation;
			visitor.Init (searchedMembers);
			if (!visitor.FileContainsMemberName ()) {
				yield break;
			}
			var doc = ProjectDomService.ParseFile (dom, fileName, () => editor.Text);
			if (doc == null || doc.CompilationUnit == null)
				yield break;
			var resolver = new NRefactoryResolver (dom, doc.CompilationUnit, ICSharpCode.NRefactory.SupportedLanguage.CSharp, editor, fileName);

			visitor.ParseFile (resolver);
			visitor.RunVisitor (resolver);
			foreach (var reference in visitor.FoundReferences) {
				if (positions.Contains (reference.Position))
					continue;
				positions.Add (reference.Position);
				yield return reference;
			}
			visitor.ClearParsers ();
		}
开发者ID:raufbutt,项目名称:monodevelop-old,代码行数:25,代码来源:CSharpReferenceFinder.cs

示例2: WatchListAutoCompleteCell

		public WatchListAutoCompleteCell()
		{
			InitializeComponent();
			
			console = new ConsoleControl();
			console.TextAreaTextEntered += new TextCompositionEventHandler(consoleControl_TextAreaTextEntered);
			console.TextAreaPreviewKeyDown += new KeyEventHandler(console_TextAreaPreviewKeyDown);
			console.LostFocus += new RoutedEventHandler(console_LostFocus);
			console.HideScrollBar();
			ConsolePanel.Content = console;
			
			// get language
			if (ProjectService.CurrentProject == null)
				language = "C#";
			else
				language = ProjectService.CurrentProject.Language;
			resolver = new NRefactoryResolver(LanguageProperties.GetLanguage(language));
			
			// FIXME set language
			if (language == "VB" || language == "VBNet") {
				console.SetHighlighting("VBNET");
			}
			else {
				console.SetHighlighting("C#");
			}
			
			// get process
			WindowsDebugger debugger = (WindowsDebugger)DebuggerService.CurrentDebugger;
			
			debugger.ProcessSelected += delegate(object sender, ProcessEventArgs e) {
				this.Process = e.Process;
			};
			this.Process = debugger.DebuggedProcess;
		}
开发者ID:rbrunhuber,项目名称:SharpDevelop,代码行数:34,代码来源:WatchListAutoCompleteCell.cs

示例3: WatchInputBox

		public WatchInputBox(string text, string caption) : base()
		{
			InitializeComponent();
			
			// UI
			text = StringParser.Parse(text);
			this.Title = StringParser.Parse(caption);
			this.ConsolePanel.Content = console;

			if (ProjectService.CurrentProject == null) return;
			
			// get language
			language = ProjectService.CurrentProject.Language;			
			resolver = new NRefactoryResolver(LanguageProperties.GetLanguage(language));
			
			// FIXME set language
			if (language == "VB" || language == "VBNet") {
				console.SetHighlighting("VBNET");
			}
			else {
				console.SetHighlighting("C#");
			}
			
			// get process
			WindowsDebugger debugger = (WindowsDebugger)DebuggerService.CurrentDebugger;
			
			debugger.ProcessSelected += delegate(object sender, ProcessEventArgs e) {
				this.Process = e.Process;
			};
			this.Process = debugger.DebuggedProcess;
		}
开发者ID:siegfriedpammer,项目名称:SharpDevelop,代码行数:31,代码来源:WatchInputBox.xaml.cs

示例4: WatchInputBox

		public WatchInputBox(string text, string caption) : base()
		{
			InitializeComponent();
			
			// UI
			text = StringParser.Parse(text);
			this.Title = StringParser.Parse(caption);
			this.ConsolePanel.Content = console;

			if (ProjectService.CurrentProject == null)
				language = GetLanguageFromActiveViewContent();
			else
				language = GetLanguage(ProjectService.CurrentProject.Language);
			
			resolver = new NRefactoryResolver(LanguageProperties.GetLanguage(language.ToString()));
			
			switch (language) {
				case SupportedLanguage.CSharp:
					console.SetHighlighting("C#");
					break;
				case SupportedLanguage.VBNet:
					console.SetHighlighting("VBNET");
					break;
			}
			
			// get process
			this.Process = ((WindowsDebugger)DebuggerService.CurrentDebugger).DebuggedProcess;
		}
开发者ID:rbrunhuber,项目名称:SharpDevelop,代码行数:28,代码来源:WatchInputBox.xaml.cs

示例5: ConditionCell

		public ConditionCell()
		{
			InitializeComponent();
			
			console = new ConsoleControl();			
			console.TextAreaTextEntered += new TextCompositionEventHandler(consoleControl_TextAreaTextEntered);
			console.TextAreaPreviewKeyDown += new KeyEventHandler(console_TextAreaPreviewKeyDown);
			console.LostFocus += new RoutedEventHandler(console_LostFocus);
			console.HideScrollBar();
			ConsolePanel.Content = console;
			
			// get language
			if (ProjectService.CurrentProject == null) 
				language = "C#";
			else
				language = ProjectService.CurrentProject.Language;
			resolver = new NRefactoryResolver(LanguageProperties.GetLanguage(language));
			
			// FIXME set language
			if (language == "VB" || language == "VBNet") {
				console.SetHighlighting("VBNET");
			}
			else {
				console.SetHighlighting("C#");
			}
		}
开发者ID:hpsa,项目名称:SharpDevelop,代码行数:26,代码来源:ConditionCell.xaml.cs

示例6: OnToolTipRequest

        private void OnToolTipRequest(object sender, ToolTipRequestEventArgs e)
        {
            if (e.InDocument && !e.ToolTipShown)
            {
                IExpressionFinder expressionFinder;
                if (MainForm.IsVisualBasic)
                {
                    expressionFinder = new VBExpressionFinder();
                }
                else
                {
                    expressionFinder = new CSharpExpressionFinder(mainForm.parseInformation);
                }
                ExpressionResult expression = expressionFinder.FindFullExpression(
                    editor.Text,
                    editor.Document.PositionToOffset(e.LogicalPosition));
                if (expression.Region.IsEmpty)
                {
                    expression.Region = new DomRegion(e.LogicalPosition.Line + 1, e.LogicalPosition.Column + 1);
                }

                TextArea textArea = editor.ActiveTextAreaControl.TextArea;
                NRefactoryResolver resolver = new NRefactoryResolver(mainForm.myProjectContent.Language);
                ResolveResult rr = resolver.Resolve(expression,
                                                    mainForm.parseInformation,
                                                    textArea.MotherTextEditorControl.Text);
                string toolTipText = GetText(rr);
                if (toolTipText != null)
                {
                    e.ShowToolTip(toolTipText);
                }
            }
        }
开发者ID:ExRam,项目名称:DotSpatial-PCL,代码行数:33,代码来源:ToolTipProvider.cs

示例7: OnToolTipRequest

		private void OnToolTipRequest(object sender, TextEditor.ToolTipRequestEventArgs e)
		{
			if (!e.InDocument || e.ToolTipShown)
				return;

			IExpressionFinder expressionFinder;
			if (IntellisenseForm.SupportedLanguage == SupportedLanguage.VisualBasic)
			{
				expressionFinder = new VBExpressionFinder();
			}
			else
			{
				expressionFinder = new CSharpExpressionFinder(_iForm.ParseInformation);
			}

			var expression = expressionFinder.FindFullExpression(
				_editor.Text,
				_editor.Document.PositionToOffset(e.LogicalPosition));
			if (expression.Region.IsEmpty)
			{
				expression.Region = new DomRegion(e.LogicalPosition.Line + 1, e.LogicalPosition.Column + 1);
			}

			var textArea = _editor.ActiveTextAreaControl.TextArea;
			var resolver = new NRefactoryResolver(_iForm.ProjectContent.Language);
			var rr = resolver.Resolve(expression,
				_iForm.ParseInformation,
				textArea.MotherTextEditorControl.Text);

			var toolTipText = GetText(rr);
			if (toolTipText != null)
			{
				e.ShowToolTip(toolTipText);
			}
		}
开发者ID:XQuantumForceX,项目名称:Reflexil,代码行数:35,代码来源:ToolTipProvider.cs

示例8: CreateReturnType

 public static IReturnType CreateReturnType(TypeReference reference, NRefactoryResolver resolver)
 {
     return CreateReturnType(reference,
                             resolver.CallingClass, resolver.CallingMember,
                             resolver.CaretLine, resolver.CaretColumn,
                             resolver.ProjectContent, ReturnTypeOptions.None);
 }
开发者ID:SergeTruth,项目名称:OxyChart,代码行数:7,代码来源:TypeVisitor.cs

示例9: GenerateCompletionData

        public ICompletionData[] GenerateCompletionData(string fileName, TextArea textArea, char charTyped)
        {
            // We can return code-completion items like this:

            //			return new ICompletionData[] {
            //				new DefaultCompletionData("Text", "Description", 1)
            //			};

            NRefactoryResolver resolver = new NRefactoryResolver(mainForm.myProjectContent);
            Dom.ResolveResult rr = resolver.Resolve(FindExpression(textArea),
                                                    textArea.Caret.Line,
                                                    textArea.Caret.Column,
                                                    fileName,
                                                    textArea.MotherTextEditorControl.Text);
            List<ICompletionData> resultList = new List<ICompletionData>();
            if (rr != null) {
                ArrayList completionData = rr.GetCompletionData(mainForm.myProjectContent);
                if (completionData != null) {
                    AddCompletionData(resultList, completionData);
                }
            }

            //textArea.MotherTextEditorControl.Text = backup;

            return resultList.ToArray();
        }
开发者ID:cleciusjm,项目名称:db4oanalyzer,代码行数:26,代码来源:CodeCompletionProvider.cs

示例10: InferredReturnType

		internal InferredReturnType(Expression expression, NRefactoryResolver resolver)
		{
			if (resolver == null)
				throw new ArgumentNullException("resolver");
			
			_expression = expression;
			_resolver = resolver;
		}
开发者ID:SAD1992,项目名称:justdecompile-plugins,代码行数:8,代码来源:InferredReturnType.cs

示例11: OnLanguageChanged

		void OnLanguageChanged()
		{
			switch (SelectedLanguage) {
				case SupportedLanguage.CSharp:
					resolver = new NRefactoryResolver(LanguageProperties.CSharp);
					SetHighlighting("C#");
					break;
				case SupportedLanguage.VBNet:
					resolver = new NRefactoryResolver(LanguageProperties.VBNet);
					SetHighlighting("VBNET");
					break;
			}
		}
开发者ID:hpsa,项目名称:SharpDevelop,代码行数:13,代码来源:ConsolePad.cs

示例12: LambdaReturnType

		internal LambdaReturnType(AnonymousMethodExpression expression, NRefactoryResolver resolver)
			: base(resolver.CompilationUnit)
		{
			this.resolver = resolver;
			
			if (expression.HasParameterList) {
				base.MethodParameters = new List<IParameter>();
				foreach (ParameterDeclarationExpression param in expression.Parameters) {
					base.MethodParameters.Add(NRefactoryASTConvertVisitor.CreateParameter(param, resolver.CallingMember as IMethod, resolver.CallingClass, resolver.CompilationUnit));
				}
			}
			expression.Body.AcceptVisitor(new ReturnStatementFinder(returnExpressions), null);
		}
开发者ID:Adam-Fogle,项目名称:agentralphplugin,代码行数:13,代码来源:LambdaReturnType.cs

示例13: FindReferences

		IEnumerable<MemberReference> FindReferences (ProjectDom dom, FilePath fileName, INode member)
		{
			var editor = TextFileProvider.Instance.GetTextEditorData (fileName);
			var doc    = ProjectDomService.GetParsedDocument (dom, fileName);
			
			if (doc == null || doc.CompilationUnit == null)
				return null;
			var resolver = new NRefactoryResolver (dom, doc.CompilationUnit, ICSharpCode.NRefactory.SupportedLanguage.CSharp, editor, fileName);
			
			FindMemberAstVisitor visitor = new FindMemberAstVisitor (editor.Document, resolver, member);
			visitor.IncludeXmlDocumentation = IncludeDocumentation;
			visitor.RunVisitor ();
			return visitor.FoundReferences;
		}
开发者ID:thild,项目名称:monodevelop,代码行数:14,代码来源:CSharpReferenceFinder.cs

示例14: LambdaParameterReturnType

		public LambdaParameterReturnType(LambdaExpression lambda, string name, NRefactoryResolver resolver)
		{
			if (lambda == null)
				throw new ArgumentNullException("lambda");
			if (name == null)
				throw new ArgumentNullException("name");
			if (resolver == null)
				throw new ArgumentNullException("resolver");
			this.lambda = lambda;
			this.parameterName = name;
			this.parameterIndex = lambda.Parameters.FindIndex(p => p.ParameterName == name);
			this.resolver = resolver;
			if (parameterIndex < 0)
				throw new ArgumentException("there is no lambda parameter with that name");
		}
开发者ID:SAD1992,项目名称:justdecompile-plugins,代码行数:15,代码来源:LambdaParameterReturnType.cs

示例15: NRefactoryParameterDataProvider

		public NRefactoryParameterDataProvider (TextEditorData editor, NRefactoryResolver resolver, MethodResolveResult resolveResult)
		{
			this.staticResolve = resolveResult.StaticResolve;
			bool includeProtected = true;
			HashSet<string> alreadyAdded = new HashSet<string> ();
			foreach (IMethod method in resolveResult.Methods) {
				if (method.IsConstructor)
					continue;
				string str = ambience.GetString (method, OutputFlags.IncludeParameters | OutputFlags.GeneralizeGenerics | OutputFlags.IncludeGenerics);
				if (alreadyAdded.Contains (str))
					continue;
				alreadyAdded.Add (str);
				if (method.IsAccessibleFrom (resolver.Dom, resolver.CallingType, resolver.CallingMember, includeProtected))
					methods.Add (method);
			}
			methods.Sort (MethodComparer);
		}
开发者ID:hduregger,项目名称:monodevelop,代码行数:17,代码来源:NRefactoryParameterDataProvider.cs


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