本文整理匯總了C#中Mono.Cecil.PropertyDefinition.IsStatic方法的典型用法代碼示例。如果您正苦於以下問題:C# PropertyDefinition.IsStatic方法的具體用法?C# PropertyDefinition.IsStatic怎麽用?C# PropertyDefinition.IsStatic使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Mono.Cecil.PropertyDefinition
的用法示例。
在下文中一共展示了PropertyDefinition.IsStatic方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: SignatureForProperty
private static string SignatureForProperty(PropertyDefinition property, bool hyperLinked)
{
var hb = new HtmlBuilder();
if (property.IsStatic())
{
hb.AddKeyword("static");
hb.Add(" ");
}
hb.AddKeyword("public");
hb.Add(" ");
hb.AddTypeReference(property.PropertyType, hyperLinked);
hb.Add(" ");
hb.AddMemberReferenceName(property, false);
hb.Add(" {");
if (property.GetMethod != null)
{
hb.Add(" ");
hb.AddKeyword("get");
hb.Add(";");
}
if (property.SetMethod != null)
{
hb.Add(" ");
hb.AddKeyword("set");
hb.Add(";");
}
hb.Add(" }");
return hb.ToString();
}
示例2: WritePropertyDeclaration
protected override void WritePropertyDeclaration(PropertyDefinition property)
{
MethodDefinition moreVisibleMethod = property.GetMethod.GetMoreVisibleMethod(property.SetMethod);
if (property.IsIndexer())
{
WriteIndexerKeywords();
}
if (this.ModuleContext.RenamedMembers.Contains(property.MetadataToken.ToUInt32()))
{
WriteComment(property.Name);
WriteLine();
}
if (!property.IsExplicitImplementation())
{
WriteMethodVisibilityAndSpace(moreVisibleMethod);
}
if (!(property.IsVirtual() && !property.IsNewSlot()))
{
bool isIndexerProperty = property.IsIndexer();
if ((isIndexerProperty && IsIndexerPropertyHiding(property)) || (!isIndexerProperty && IsPropertyHiding(property)))
{
WriteKeyword(KeyWordWriter.Hiding);
WriteSpace();
}
}
if (property.IsVirtual() && !property.DeclaringType.IsInterface)
{
if (WritePropertyKeywords(property))
{
WriteSpace();
}
}
//covers the case of properties with only one of the get/set methods in VB
WriteReadOnlyWriteOnlyProperty(property);
if (property.IsStatic())
{
WriteKeyword(KeyWordWriter.Static);
WriteSpace();
}
if (KeyWordWriter.Property != null)
{
WriteKeyword(KeyWordWriter.Property);
WriteSpace();
}
if (property.IsIndexer())
{
if (WritePropertyAsIndexer(property))
{
return;
}
}
WritePropertyTypeAndNameWithArguments(property);
WritePropertyInterfaceImplementations(property);
}