本文整理汇总了C#中IUnresolvedTypeDefinition.Resolve方法的典型用法代码示例。如果您正苦于以下问题:C# IUnresolvedTypeDefinition.Resolve方法的具体用法?C# IUnresolvedTypeDefinition.Resolve怎么用?C# IUnresolvedTypeDefinition.Resolve使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IUnresolvedTypeDefinition
的用法示例。
在下文中一共展示了IUnresolvedTypeDefinition.Resolve方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetOverridableMembers
public OverrideContext
(Request request, BufferParser parser) {
this.BufferParser = parser;
this.CompletionContext = new BufferContext
(request, this.BufferParser);
currentTypeDefinition = this.CompletionContext.ParsedContent
.UnresolvedFile.GetInnermostTypeDefinition
(this.CompletionContext.TextLocation);
this.CurrentType = currentTypeDefinition.Resolve(this.CompletionContext.ResolveContext);
this.OverrideTargets =
GetOverridableMembers()
.Select(m => new GetOverrideTargetsResponse
(m, this.CompletionContext.ResolveContext))
.ToArray();
}
示例2: ExtendContextForType
protected static ITypeResolveContext ExtendContextForType(ITypeResolveContext assemblyContext, IUnresolvedTypeDefinition typeDef)
{
if (typeDef == null)
return assemblyContext;
ITypeResolveContext parentContext;
if (typeDef.DeclaringTypeDefinition != null)
parentContext = ExtendContextForType(assemblyContext, typeDef.DeclaringTypeDefinition);
else
parentContext = assemblyContext;
ITypeDefinition resolvedTypeDef = typeDef.Resolve(assemblyContext).GetDefinition();
return typeDef.CreateResolveContext(parentContext).WithCurrentTypeDefinition(resolvedTypeDef);
}
示例3: GetOverrideCompletionData
IEnumerable<ICompletionData> GetOverrideCompletionData(IUnresolvedTypeDefinition type, string modifiers)
{
var wrapper = new CompletionDataWrapper(this);
var alreadyInserted = new List<IMember>();
//bool addedVirtuals = false;
int declarationBegin = offset;
int j = declarationBegin;
for (int i = 0; i < 3; i++) {
switch (GetPreviousToken(ref j, true)) {
case "public":
case "protected":
case "private":
case "internal":
case "sealed":
case "override":
case "partial":
case "async":
declarationBegin = j;
break;
case "static":
return null; // don't add override completion for static members
}
}
AddVirtuals(
alreadyInserted,
wrapper,
modifiers,
type.Resolve(ctx),
declarationBegin
);
return wrapper.Result;
}
示例4: Resolve
ITypeDefinition Resolve(IUnresolvedTypeDefinition typeDef)
{
return typeDef.Resolve(new SimpleTypeResolveContext(compilation.MainAssembly)).GetDefinition();
}
示例5: UpdateBindings
void UpdateBindings (Stetic.Component obj, IUnresolvedTypeDefinition cls)
{
if (targetObject == null)
return;
// Remove signals for which there isn't a handler in the class
Stetic.SignalCollection objectSignals = obj.GetSignals ();
if (objectSignals != null) {
Stetic.Signal[] signals = new Stetic.Signal [objectSignals.Count];
objectSignals.CopyTo (signals, 0);
var resolved = cls.Resolve (project);
foreach (Stetic.Signal signal in signals) {
if (FindSignalHandler (resolved, signal) == null) {
obj.RemoveSignal (signal);
}
}
}
// Update children
foreach (Stetic.Component ob in obj.GetChildren ())
UpdateBindings (ob, cls);
}
示例6: Resolve
protected IType Resolve (ITreeNavigator treeBuilder, IUnresolvedTypeDefinition type)
{
var mainAssembly = GetMainAssembly (treeBuilder);
if (mainAssembly != null) {
var simpleCompilation = new SimpleCompilation (mainAssembly);
return type.Resolve (new SimpleTypeResolveContext (simpleCompilation.MainAssembly));
}
// TODO: roslyn port ?
// var project = (Project)treeBuilder.GetParentDataItem (typeof(Project), true);
// var ctx = TypeSystemService.GetCompilation (project);
// return ctx.MainAssembly.GetTypeDefinition (type.Namespace, type.Name, type.TypeParameters.Count);
return null;
}