Пример #1
0
        public IGeneralGenericSignatureMemberUniqueIdentifier GetIdentifier(IIntermediateMethodSignatureMember member)
        {
            var internalHelper = member as _IIntermediateMethodSignatureMember;

            if (internalHelper == null)
            {
                return(TypeSystemIdentifiers.GetGenericSignatureIdentifier(member.Name, member.TypeParameters.Count, member.UserSpecificQualifier, member.Parameters.ParameterTypes.ToArray()));
            }
            else if (internalHelper.IsDisposed)
            {
                throw new InvalidOperationException(Utilities.Properties.Resources.ObjectStateThrowMessage);
            }
            else if (internalHelper.AreTypeParametersInitialized)
            {
                if (internalHelper.AreParametersInitialized)
                {
                    return(TypeSystemIdentifiers.GetGenericSignatureIdentifier(member.Name, member.TypeParameters.Count, member.UserSpecificQualifier, member.Parameters.ParameterTypes.ToArray()));
                }
                else
                {
                    return(TypeSystemIdentifiers.GetGenericSignatureIdentifier(member.Name, member.TypeParameters.Count, member.UserSpecificQualifier));
                }
            }
            else if (internalHelper.AreParametersInitialized)
            {
                return(TypeSystemIdentifiers.GetGenericSignatureIdentifier(member.Name, member.UserSpecificQualifier, member.Parameters.ParameterTypes.ToArray()));
            }
            else
            {
                return(TypeSystemIdentifiers.GetGenericSignatureIdentifier(member.Name, member.UserSpecificQualifier));
            }
        }
Пример #2
0
 public void DefineDeclaration(IIntermediateMethodSignatureMember declaration)
 {
 }
Пример #3
0
 public void ReferenceDeclaration(IIntermediateMethodSignatureMember declaration)
 {
 }
Пример #4
0
            public string Visit <TSignature, TIntermediateSignature, TParent, TIntermediateParent>(IIntermediateMethodSignatureMember <TSignature, TIntermediateSignature, TParent, TIntermediateParent> methodSignature, IntermediateNameRequestDetails context)
                where TSignature : Abstract.Members.IMethodSignatureMember <TSignature, TParent>
                where TIntermediateSignature : TSignature, IIntermediateMethodSignatureMember <TSignature, TIntermediateSignature, TParent, TIntermediateParent>
                where TParent : Abstract.IMethodSignatureParent <TSignature, TParent>
                where TIntermediateParent : TParent, IIntermediateMethodSignatureParent <TSignature, TIntermediateSignature, TParent, TIntermediateParent>
            {
                string name = null;

                switch (context)
                {
                case IntermediateNameRequestDetails.TargetFileName:
                    if (!(methodSignature.Parent is IIntermediateType))
                    {
                        return(null);
                    }
                    this.fileNameLookup.TryGetValue(((IIntermediateType)methodSignature.Parent).Assembly, out name);
                    if (this.HtmlContext)
                    {
                        name = string.Format("{0}#fnc{1:X8}", name, methodSignature.GetHashCode());
                    }
                    break;

                case IntermediateNameRequestDetails.SourceFileName:
                    if (!(methodSignature.Parent is IIntermediateType))
                    {
                        return(null);
                    }
                    name = ((IIntermediateType)methodSignature.Parent).Assembly.FileName;
                    break;

                case IntermediateNameRequestDetails.DisplayName:
                    name = methodSignature.Name;
                    break;

                case IntermediateNameRequestDetails.ReferenceName:
                    if (this.HtmlContext)
                    {
                        name = string.Format("fnc{0:X8}", methodSignature.GetHashCode());
                    }
                    break;
                }
                return(name);
            }
Пример #5
0
 void IIntermediateMemberVisitor.Visit <TSignature, TIntermediateSignature, TParent, TIntermediateParent>(IIntermediateMethodSignatureMember <TSignature, TIntermediateSignature, TParent, TIntermediateParent> intermediateMember)
 {
     this.Translate(intermediateMember);
 }
Пример #6
0
 /// <summary><para>Creates a C&#9839; compiler warning, relative
 /// to the abstract model, (level 3) &#35;402:</para>
 /// <para><paramref name="offendingMethod"/>: an entry point cannot be generic or in a generic type.
 /// </para></summary>
 /// <param name="offendingMethod">The <see cref="IIntermediateMethodMember"/>
 /// which cannot be an entrypoint because it is either generic, or contained within a
 /// generic.</param>
 public static ICompilerModelWarning <IIntermediateMethodSignatureMember> WarningCS0402(IIntermediateMethodSignatureMember offendingMethod)
 {
     //ToDo: Add location information to methods.
     return(new CompilerModelWarning <IIntermediateMethodSignatureMember>(CS0402, offendingMethod, offendingMethod.UniqueIdentifier.ToString()));
 }
Пример #7
0
 public TestLinkerResult Visit <TSignature, TIntermediateSignature, TParent, TIntermediateParent>(IIntermediateMethodSignatureMember <TSignature, TIntermediateSignature, TParent, TIntermediateParent> methodSignature, ICompilationContext context)
     where TSignature : IMethodSignatureMember <TSignature, TParent>
     where TIntermediateSignature : TSignature, IIntermediateMethodSignatureMember <TSignature, TIntermediateSignature, TParent, TIntermediateParent>
     where TParent : IMethodSignatureParent <TSignature, TParent>
     where TIntermediateParent : TParent, IIntermediateMethodSignatureParent <TSignature, TIntermediateSignature, TParent, TIntermediateParent>
 {
     throw new NotImplementedException();
 }
Пример #8
0
 public abstract void Translate <TSignature, TIntermediateSignature, TParent, TIntermediateParent>(IIntermediateMethodSignatureMember <TSignature, TIntermediateSignature, TParent, TIntermediateParent> intermediateMember)
     where TSignature :
 IMethodSignatureMember <TSignature, TParent>
     where TIntermediateSignature :
 TSignature,
 IIntermediateMethodSignatureMember <TSignature, TIntermediateSignature, TParent, TIntermediateParent>
     where TParent :
 IMethodSignatureParent <TSignature, TParent>
     where TIntermediateParent :
 TParent,
 IIntermediateMethodSignatureParent <TSignature, TIntermediateSignature, TParent, TIntermediateParent>;
Пример #9
0
 public void ReferenceDeclaration(IIntermediateMethodSignatureMember declaration)
 {
     this.Formatter.ReferenceDeclaration(declaration);
 }
Пример #10
0
 public void DefineDeclaration(IIntermediateMethodSignatureMember declaration)
 {
     this.Formatter.DefineDeclaration(declaration);
 }
Пример #11
0
 public IGeneralGenericSignatureMemberUniqueIdentifier GetIdentifier(IIntermediateMethodSignatureMember member)
 {
     throw new NotSupportedException();
 }
Пример #12
0
 public TransformationKind Visit <TSignature, TIntermediateSignature, TParent, TIntermediateParent>(IIntermediateMethodSignatureMember <TSignature, TIntermediateSignature, TParent, TIntermediateParent> methodSignature, ITransformationContext context)
     where TSignature : IMethodSignatureMember <TSignature, TParent>
     where TIntermediateSignature : TSignature, IIntermediateMethodSignatureMember <TSignature, TIntermediateSignature, TParent, TIntermediateParent>
     where TParent : IMethodSignatureParent <TSignature, TParent>
     where TIntermediateParent : TParent, IIntermediateMethodSignatureParent <TSignature, TIntermediateSignature, TParent, TIntermediateParent>
 {
     throw new NotImplementedException();
 }