本文整理汇总了C#中Mono.CSharp.MemberSpec类的典型用法代码示例。如果您正苦于以下问题:C# MemberSpec类的具体用法?C# MemberSpec怎么用?C# MemberSpec使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MemberSpec类属于Mono.CSharp命名空间,在下文中一共展示了MemberSpec类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:iainlane,项目名称:mono,代码行数:23,代码来源:decl.cs
示例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;
}
开发者ID:fvalette,项目名称:mono,代码行数:39,代码来源:class.cs
示例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 ());
}
开发者ID:fvalette,项目名称:mono,代码行数:16,代码来源:class.cs
示例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;
}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:30,代码来源:method.cs
示例5: FindBaseMember
protected override MemberSpec FindBaseMember (out MemberSpec bestCandidate, ref bool overrides)
{
// Is never override
bestCandidate = null;
return null;
}
开发者ID:OpenFlex,项目名称:playscript-mono,代码行数:6,代码来源:method.cs
示例6:
bool OverloadResolver.IErrorHandler.TypeInferenceFailed (ResolveContext rc, MemberSpec best)
{
return false;
}
开发者ID:psni,项目名称:mono,代码行数:4,代码来源:delegate.cs
示例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;
}
开发者ID:bbqchickenrobot,项目名称:playscript-mono,代码行数:11,代码来源:property.cs
示例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 ();
}
开发者ID:speier,项目名称:shake,代码行数:24,代码来源:doc.cs
示例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]));
}
开发者ID:speier,项目名称:shake,代码行数:8,代码来源:doc.cs
示例10:
bool OverloadResolver.IErrorHandler.NoArgumentMatch (ResolveContext rc, MemberSpec best)
{
return false;
}
开发者ID:alisci01,项目名称:mono,代码行数:4,代码来源:statement.cs
示例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 "!:";
}
开发者ID:speier,项目名称:shake,代码行数:19,代码来源:doc.cs
示例12: ResolveMissingDependencies
public abstract List<MissingTypeSpecReference> ResolveMissingDependencies (MemberSpec caller);
开发者ID:iainlane,项目名称:mono,代码行数:1,代码来源:decl.cs
示例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 ());
}
开发者ID:royleban,项目名称:mono,代码行数:19,代码来源:doc.cs
示例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;
}
开发者ID:nberardi,项目名称:mono,代码行数:17,代码来源:property.cs
示例15: FindBaseMember
/// <summary>
/// Gets base method and its return type
/// </summary>
protected virtual MemberSpec FindBaseMember (out MemberSpec bestCandidate)
{
return MemberCache.FindBaseMember (this, out bestCandidate);
}
开发者ID:famousthom,项目名称:monodevelop,代码行数:7,代码来源:class.cs
示例16: SymbolRelatedToPreviousError
public void SymbolRelatedToPreviousError (MemberSpec ms)
{
if (reporting_disabled > 0 || !printer.HasRelatedSymbolSupport)
return;
var mc = ms.MemberDefinition as MemberCore;
while (ms is ElementTypeSpec) {
ms = ((ElementTypeSpec) ms).Element;
mc = ms.MemberDefinition as MemberCore;
}
if (mc != null) {
SymbolRelatedToPreviousError (mc);
} else {
if (ms.DeclaringType != null)
ms = ms.DeclaringType;
var imported_type = ms.MemberDefinition as ImportedTypeDefinition;
if (imported_type != null) {
var iad = imported_type.DeclaringAssembly as ImportedAssemblyDefinition;
SymbolRelatedToPreviousError (iad.Location, "");
}
}
}
开发者ID:litoMalone,项目名称:mono,代码行数:24,代码来源:report.cs
示例17: CheckOverrideAgainstBase
protected override bool CheckOverrideAgainstBase (MemberSpec base_member)
{
bool res = base.CheckOverrideAgainstBase (base_member);
//
// Check that the permissions are not being changed
//
if (!CheckAccessModifiers (this, base_member)) {
Error_CannotChangeAccessModifiers (this, base_member);
res = false;
}
return res;
}
开发者ID:OpenFlex,项目名称:playscript-mono,代码行数:14,代码来源:method.cs
示例18: GetFullNameSignature
static public string GetFullNameSignature (MemberSpec mi)
{
return mi.GetSignatureForError ();
}
开发者ID:telurmasin,项目名称:mono,代码行数:4,代码来源:typemanager.cs
示例19: CSharpSignature
static public string CSharpSignature (MemberSpec mb)
{
return mb.GetSignatureForError ();
}
开发者ID:telurmasin,项目名称:mono,代码行数:4,代码来源:typemanager.cs
示例20: CheckAccessModifiers
protected static bool CheckAccessModifiers (MemberCore this_member, MemberSpec base_member)
{
var thisp = this_member.ModFlags & Modifiers.AccessibilityMask;
var base_classp = base_member.Modifiers & Modifiers.AccessibilityMask;
if ((base_classp & (Modifiers.PROTECTED | Modifiers.INTERNAL)) == (Modifiers.PROTECTED | Modifiers.INTERNAL)) {
//
// It must be at least "protected"
//
if ((thisp & Modifiers.PROTECTED) == 0) {
return false;
}
//
// when overriding protected internal, the method can be declared
// protected internal only within the same assembly or assembly
// which has InternalsVisibleTo
//
if ((thisp & Modifiers.INTERNAL) != 0) {
return base_member.DeclaringType.MemberDefinition.IsInternalAsPublic (this_member.Module.DeclaringAssembly);
}
//
// protected overriding protected internal inside same assembly
// requires internal modifier as well
//
if (base_member.DeclaringType.MemberDefinition.IsInternalAsPublic (this_member.Module.DeclaringAssembly)) {
return false;
}
return true;
}
return thisp == base_classp;
}
开发者ID:fvalette,项目名称:mono,代码行数:35,代码来源:class.cs
注:本文中的Mono.CSharp.MemberSpec类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论