Beispiel #1
0
            public string Visit <TCtor, TIntermediateCtor, TType, TIntermediateType>(IIntermediateConstructorSignatureMember <TCtor, TIntermediateCtor, TType, TIntermediateType> ctor, IntermediateNameRequestDetails context)
                where TCtor : Abstract.Members.IConstructorMember <TCtor, TType>
                where TIntermediateCtor : TCtor, IIntermediateConstructorSignatureMember <TCtor, TIntermediateCtor, TType, TIntermediateType>
                where TType : Abstract.ICreatableParent <TCtor, TType>
                where TIntermediateType : TType, IIntermediateCreatableSignatureParent <TCtor, TIntermediateCtor, TType, TIntermediateType>
            {
                string name = null;

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

                case IntermediateNameRequestDetails.SourceFileName:
                    name = ctor.Parent.Assembly.FileName;
                    break;

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

                case IntermediateNameRequestDetails.ReferenceName:
                    if (this.HtmlContext)
                    {
                        name = string.Format("ctor{0:X8}", ctor.GetHashCode());
                    }
                    break;
                }
                return(name);
            }