Browse Source
Applied assembly loading patch by Alex Prudkiy. git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@971 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
8 changed files with 194 additions and 48 deletions
@ -0,0 +1,31 @@
@@ -0,0 +1,31 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Text; |
||||
using System.Collections; |
||||
using System.Diagnostics; |
||||
|
||||
using ICSharpCode.NRefactory.Parser; |
||||
using ICSharpCode.NRefactory.Parser.CSharp; |
||||
using ICSharpCode.NRefactory.Parser.AST; |
||||
|
||||
namespace ICSharpCode.NRefactory.PrettyPrinter |
||||
{ |
||||
public interface IEnvironmentInformationProvider |
||||
{ |
||||
bool HasField(string fullTypeName, string fieldName); |
||||
} |
||||
|
||||
class DummyEnvironmentInformationProvider : IEnvironmentInformationProvider |
||||
{ |
||||
public bool HasField(string fullTypeName, string fieldName) |
||||
{ |
||||
return false; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,43 @@
@@ -0,0 +1,43 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Collections; |
||||
using System.Collections.Generic; |
||||
|
||||
using ICSharpCode.NRefactory.Parser; |
||||
using ICSharpCode.NRefactory.PrettyPrinter; |
||||
|
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
using ICSharpCode.Core; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Dom.NRefactoryResolver |
||||
{ |
||||
public class NRefactoryInformationProvider : IEnvironmentInformationProvider |
||||
{ |
||||
IProjectContent pc; |
||||
IClass callingClass; |
||||
|
||||
public NRefactoryInformationProvider(IProjectContent pc, IClass callingClass) |
||||
{ |
||||
this.pc = pc; |
||||
this.callingClass = callingClass; |
||||
} |
||||
|
||||
public bool HasField(string fullTypeName, string fieldName) |
||||
{ |
||||
IClass c = pc.GetClass(fullTypeName); |
||||
if (c == null) |
||||
return false; |
||||
foreach (IField field in c.DefaultReturnType.GetFields()) { |
||||
if (field.Name == fieldName) |
||||
return true; |
||||
} |
||||
return false; |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue