本文整理汇总了C#中IProjectContent.GetAssemblyAttributes方法的典型用法代码示例。如果您正苦于以下问题:C# IProjectContent.GetAssemblyAttributes方法的具体用法?C# IProjectContent.GetAssemblyAttributes怎么用?C# IProjectContent.GetAssemblyAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IProjectContent
的用法示例。
在下文中一共展示了IProjectContent.GetAssemblyAttributes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetAssemblyAttributeInsertionPosition
FilePosition GetAssemblyAttributeInsertionPosition(IProjectContent pc)
{
FilePosition best = FilePosition.Empty;
foreach (IAttribute attrib in pc.GetAssemblyAttributes()) {
ICompilationUnit cu = attrib.CompilationUnit;
if (cu != null && !attrib.Region.IsEmpty) {
var newPos = new FilePosition(cu, attrib.Region.BeginLine, attrib.Region.BeginColumn);
if (IsBetterAssemblyAttributeInsertionPosition(newPos, best)) {
best = newPos;
}
}
}
return best;
}
示例2: FindTypeInAssembly
static IReturnType FindTypeInAssembly(IProjectContent projectContent, string xmlNamespace, string className)
{
foreach (IAttribute att in projectContent.GetAssemblyAttributes()) {
if (att.PositionalArguments.Count == 2
&& att.AttributeType.FullyQualifiedName == "System.Windows.Markup.XmlnsDefinitionAttribute") {
string namespaceName = att.PositionalArguments[1] as string;
if (xmlNamespace.Equals(att.PositionalArguments[0]) && namespaceName != null) {
IClass c = projectContent.GetClass(namespaceName + "." + className, 0);
if (c != null)
return c.DefaultReturnType;
}
}
}
return null;
}
示例3: AddNamespaceMembersInAssembly
static void AddNamespaceMembersInAssembly(IProjectContent projectContent, string xmlNamespace, List<ICompletionEntry> list)
{
foreach (IAttribute att in projectContent.GetAssemblyAttributes()) {
if (att.PositionalArguments.Count == 2
&& att.AttributeType.FullyQualifiedName == "System.Windows.Markup.XmlnsDefinitionAttribute") {
string namespaceName = att.PositionalArguments[1] as string;
if (xmlNamespace.Equals(att.PositionalArguments[0]) && namespaceName != null) {
projectContent.AddNamespaceContents(list, namespaceName, projectContent.Language, false);
}
}
}
}