本文整理汇总了C#中ITypeElement.GetClrName方法的典型用法代码示例。如果您正苦于以下问题:C# ITypeElement.GetClrName方法的具体用法?C# ITypeElement.GetClrName怎么用?C# ITypeElement.GetClrName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITypeElement
的用法示例。
在下文中一共展示了ITypeElement.GetClrName方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateContext
public ContextElement CreateContext(ITypeElement type)
{
if (_cache.Classes.ContainsKey(type))
{
return _cache.Classes[type];
}
var context = GetOrCreateContextElement(_provider,
#if RESHARPER_61
_manager,
_psiModuleManager,
_cacheManager,
#endif
_project,
_projectEnvoy,
type.GetClrName().FullName,
_assemblyPath,
type.GetSubjectString(),
type.GetTags(),
type.IsIgnored());
foreach (var child in context.Children)
{
child.State = UnitTestElementState.Pending;
}
_cache.Classes.Add(type, context);
return context;
}
示例2: BasedOnRegistration
public BasedOnRegistration(ITreeNode registrationRootElement, ITypeElement basedOnElement, IEnumerable<WithServiceRegistration> withServices)
: base(registrationRootElement, withServices)
{
this.basedOnElement = basedOnElement;
name = basedOnElement.GetClrName().FullName;
}
示例3: BasedOnRegistration
public BasedOnRegistration(ITreeNode registrationRootElement, ITypeElement basedOnElement)
: base(registrationRootElement)
{
this.basedOnElement = basedOnElement;
name = basedOnElement.GetClrName().FullName;
}
示例4: GetDisplayName
private static string GetDisplayName(ITypeElement element)
{
IClrTypeName clrName = element.GetClrName();
string fullName = string.Format("{0}.{1}", clrName.GetNamespaceName(), clrName.ShortName);
if (element.HasTypeParameters())
{
fullName = string.Format("{0}<>", fullName);
}
return fullName;
}
示例5: CreateContext
public ContextElement CreateContext(ITypeElement type)
{
if (_cache.Classes.ContainsKey(type))
{
return _cache.Classes[type];
}
ContextElement context = new ContextElement(_provider,
_projectEnvoy,
#if RESHARPER_6
type.GetClrName().FullName,
#else
type.CLRName,
#endif
_assemblyPath,
type.GetSubjectString(),
type.GetTags(),
type.IsIgnored());
_cache.Classes.Add(type, context);
return context;
}
示例6: CreateContext
public ContextElement CreateContext(ITypeElement type)
{
var context = GetOrCreateContext(_provider,
_manager,
_psiModuleManager,
_cacheManager,
_project,
_projectEnvoy,
type.GetClrName().GetPersistent(),
_assemblyPath,
type.GetSubjectString(),
type.GetTags(),
type.IsIgnored());
foreach (var child in context.Children)
{
child.State = UnitTestElementState.Pending;
}
_cache.Contexts.Add(type, context);
return context;
}
示例7: IsAssignableFrom
// I always have to think about what this means...
// Based on Type.IsAssignableFrom(c)
// "Determines whether an instance of the current Type can be assigned from an instance of the specified Type"
// True if c and the current type are the same type, or if the current type is in the inheritance hierarchy of
// the type c
// In other words, type.IsAssignableFrom(c) is true if I can assign an instance of c to a variable of type "type"
internal static bool IsAssignableFrom(this Type type, ITypeElement c)
{
return type.FullName == c.GetClrName().FullName || c.GetAllSuperTypes().Any(superType => type.FullName == c.GetClrName().FullName);
}
示例8: GetCommonType
public CommonType GetCommonType(ITypeElement type)
{
var clrTypeName = type.GetClrName();
return new CommonType(clrTypeName.ShortName, clrTypeName.FullName, type.GetImplementedTypes().Select(x => x.GetClrName().FullName));
}
示例9: GetParent
private XunitTestClassElement GetParent(ITypeElement containingType)
{
var typeName = containingType.GetClrName().GetPersistent();
var id = typeName.FullName;
return factory.GetElementById(project, id) as XunitTestClassElement;
}
示例10: GetOrCreateClassElement
private XunitTestClassElement GetOrCreateClassElement(ITypeElement testClass, IProject projectElement, ProjectModelElementEnvoy projectEnvoy)
{
ITypeElement containingType = testClass.GetContainingType();
XunitTestClassElement parent = null;
if (containingType != null)
parent = GetParent(containingType);
return factory.GetOrCreateClassElement(testClass.GetClrName(), projectElement, projectEnvoy, parent);
}