本文整理汇总了C#中Mono.CSharp.MemberSpec类的典型用法代码示例。如果您正苦于以下问题:C# MemberSpec类的具体用法?C# MemberSpec怎么用?C# MemberSpec使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MemberSpec类属于Mono.CSharp命名空间,在下文中一共展示了MemberSpec类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetMissingDependencies
public List<MissingTypeSpecReference> GetMissingDependencies (MemberSpec caller)
{
if ((state & (StateFlags.MissingDependency | StateFlags.MissingDependency_Undetected)) == 0)
return null;
state &= ~StateFlags.MissingDependency_Undetected;
var imported = definition as ImportedDefinition;
List<MissingTypeSpecReference> missing;
if (imported != null) {
missing = ResolveMissingDependencies (caller);
} else if (this is ElementTypeSpec) {
missing = ((ElementTypeSpec) this).Element.GetMissingDependencies (caller);
} else {
missing = null;
}
if (missing != null) {
state |= StateFlags.MissingDependency;
}
return missing;
}
示例2: CheckOverrideAgainstBase
//
// Performs various checks on the MethodInfo `mb' regarding the modifier flags
// that have been defined.
//
protected virtual bool CheckOverrideAgainstBase (MemberSpec base_member)
{
bool ok = true;
if ((base_member.Modifiers & (Modifiers.ABSTRACT | Modifiers.VIRTUAL | Modifiers.OVERRIDE)) == 0) {
Report.SymbolRelatedToPreviousError (base_member);
Report.Error (506, Location,
"`{0}': cannot override inherited member `{1}' because it is not marked virtual, abstract or override",
GetSignatureForError (), TypeManager.CSharpSignature (base_member));
ok = false;
}
// Now we check that the overriden method is not final
if ((base_member.Modifiers & Modifiers.SEALED) != 0) {
Report.SymbolRelatedToPreviousError (base_member);
Report.Error (239, Location, "`{0}': cannot override inherited member `{1}' because it is sealed",
GetSignatureForError (), TypeManager.CSharpSignature (base_member));
ok = false;
}
var base_member_type = ((IInterfaceMemberSpec) base_member).MemberType;
if (!TypeSpecComparer.Override.IsEqual (MemberType, base_member_type)) {
Report.SymbolRelatedToPreviousError (base_member);
if (this is PropertyBasedMember) {
Report.Error (1715, Location, "`{0}': type must be `{1}' to match overridden member `{2}'",
GetSignatureForError (), base_member_type.GetSignatureForError (), base_member.GetSignatureForError ());
} else {
Report.Error (508, Location, "`{0}': return type must be `{1}' to match overridden member `{2}'",
GetSignatureForError (), base_member_type.GetSignatureForError (), base_member.GetSignatureForError ());
}
ok = false;
}
return ok;
}
示例3: Error_CannotChangeAccessModifiers
protected void Error_CannotChangeAccessModifiers (MemberCore member, MemberSpec base_member)
{
var base_modifiers = base_member.Modifiers;
// Remove internal modifier from types which are not internally accessible
if ((base_modifiers & Modifiers.AccessibilityMask) == (Modifiers.PROTECTED | Modifiers.INTERNAL) &&
!base_member.DeclaringType.MemberDefinition.IsInternalAsPublic (member.Module.DeclaringAssembly))
base_modifiers = Modifiers.PROTECTED;
Report.SymbolRelatedToPreviousError (base_member);
Report.Error (507, member.Location,
"`{0}': cannot change access modifiers when overriding `{1}' inherited member `{2}'",
member.GetSignatureForError (),
ModifiersExtensions.AccessibilityName (base_modifiers),
base_member.GetSignatureForError ());
}
示例4: ResolveMissingDependencies
public override List<MissingTypeSpecReference> ResolveMissingDependencies (MemberSpec caller)
{
var missing = returnType.ResolveMissingDependencies (this);
foreach (var pt in parameters.Types) {
var m = pt.GetMissingDependencies (this);
if (m == null)
continue;
if (missing == null)
missing = new List<MissingTypeSpecReference> ();
missing.AddRange (m);
}
if (Arity > 0) {
foreach (var tp in GenericDefinition.TypeParameters) {
var m = tp.GetMissingDependencies (this);
if (m == null)
continue;
if (missing == null)
missing = new List<MissingTypeSpecReference> ();
missing.AddRange (m);
}
}
return missing;
}
示例5: FindBaseMember
protected override MemberSpec FindBaseMember (out MemberSpec bestCandidate, ref bool overrides)
{
// Is never override
bestCandidate = null;
return null;
}
示例6:
bool OverloadResolver.IErrorHandler.TypeInferenceFailed (ResolveContext rc, MemberSpec best)
{
return false;
}
示例7: CheckOverrideAgainstBase
protected override bool CheckOverrideAgainstBase (MemberSpec base_member)
{
var ok = base.CheckOverrideAgainstBase (base_member);
if (!CheckAccessModifiers (this, base_member)) {
Error_CannotChangeAccessModifiers (this, base_member);
ok = false;
}
return ok;
}
示例8: GetParametersFormatted
static string GetParametersFormatted(MemberSpec mi)
{
var pm = mi as IParametersMember;
if (pm == null || pm.Parameters.IsEmpty)
return string.Empty;
AParametersCollection parameters = pm.Parameters;
/*
if (parameters == null || parameters.Count == 0)
return String.Empty;
*/
StringBuilder sb = new StringBuilder ();
sb.Append ('(');
for (int i = 0; i < parameters.Count; i++) {
// if (is_setter && i + 1 == parameters.Count)
// break; // skip "value".
if (i > 0)
sb.Append (',');
TypeSpec t = parameters.Types [i];
sb.Append (GetSignatureForDoc (t));
}
sb.Append (')');
return sb.ToString ();
}
示例9: Report419
static void Report419(MemberCore mc, string member_name, MemberSpec [] mis, Report Report)
{
Report.Warning (419, 3, mc.Location,
"Ambiguous reference in cref attribute `{0}'. Assuming `{1}' but other overloads including `{2}' have also matched",
member_name,
TypeManager.GetFullNameSignature (mis [0]),
TypeManager.GetFullNameSignature (mis [1]));
}
示例10:
bool OverloadResolver.IErrorHandler.NoArgumentMatch (ResolveContext rc, MemberSpec best)
{
return false;
}
示例11: GetMemberDocHead
//
// Get a prefix from member type for XML documentation (used
// to formalize cref target name).
//
static string GetMemberDocHead(MemberSpec type)
{
if (type is FieldSpec)
return "F:";
if (type is MethodSpec)
return "M:";
if (type is EventSpec)
return "E:";
if (type is PropertySpec)
return "P:";
if (type is TypeSpec)
return "T:";
return "!:";
}
示例12: ResolveMissingDependencies
public abstract List<MissingTypeSpecReference> ResolveMissingDependencies (MemberSpec caller);
示例13: GetMemberDocHead
//
// Get a prefix from member type for XML documentation (used
// to formalize cref target name).
//
static string GetMemberDocHead (MemberSpec type)
{
if (type is FieldSpec)
return "F:";
if (type is MethodSpec)
return "M:";
if (type is EventSpec)
return "E:";
if (type is PropertySpec)
return "P:";
if (type is TypeSpec)
return "T:";
throw new NotImplementedException (type.GetType ().ToString ());
}
示例14: ResolveMissingDependencies
public override List<MissingTypeSpecReference> ResolveMissingDependencies (MemberSpec caller)
{
var missing = base.ResolveMissingDependencies (caller);
foreach (var pt in parameters.Types) {
var m = pt.GetMissingDependencies (caller);
if (m == null)
continue;
if (missing == null)
missing = new List<MissingTypeSpecReference> ();
missing.AddRange (m);
}
return missing;
}
示例15: FindBaseMember
/// <summary>
/// Gets base method and its return type
/// </summary>
protected virtual MemberSpec FindBaseMember (out MemberSpec bestCandidate)
{
return MemberCache.FindBaseMember (this, out bestCandidate);
}