Esempio n. 1
0
        static XElement BuildMembers(MemberTypeSection section, TypeDom type)
        {
            switch (section)
            {
            case MemberTypeSection.NestedTypes:
                return(BuildNestedTypes(type.NestedTypes));

            case MemberTypeSection.Constructors:
                return(BuildMembers(Strings.Constructors, type.Constructors));

            case MemberTypeSection.Properties:
                return(BuildMembers(Strings.Properties, type.Properties));

            case MemberTypeSection.Methods:
                return(BuildMembers(Strings.Methods, type.Methods));

            case MemberTypeSection.ExtentionMethods:
                return(BuildMembers(Strings.ExtentionMethods, type.ExtentionMethods, true));

            case MemberTypeSection.Operators:
                return(BuildMembers(Strings.Operators, type.Operators));

            case MemberTypeSection.Fields:
                return(BuildMembers(Strings.Fields, type.Fields));

            case MemberTypeSection.Events:
                return(BuildMembers(Strings.Events, type.Events));

            default: throw new Exception();
            }
        }
Esempio n. 2
0
 public static string GetSectionName(MemberTypeSection section)
 {
     return(Names[section.ToString()]);
 }
Esempio n. 3
0
 public TypePartialData(TypeDom type, MemberTypeSection sectionType)
 {
     Type        = type;
     SectionType = sectionType;
 }
Esempio n. 4
0
		public TypePartialData(TypeDom type, MemberTypeSection sectionType)
		{
			Type = type;
			SectionType = sectionType;
		}
Esempio n. 5
0
		static XElement BuildMembers(MemberTypeSection section, TypeDom type)
		{
			switch (section)
			{
				case MemberTypeSection.NestedTypes:
					return BuildNestedTypes(type.NestedTypes);
				case MemberTypeSection.Constructors:
					return BuildMembers(Strings.Constructors, type.Constructors);
				case MemberTypeSection.Properties:
					return BuildMembers(Strings.Properties, type.Properties);
				case MemberTypeSection.Methods:
					return BuildMembers(Strings.Methods, type.Methods);
				case MemberTypeSection.ExtentionMethods:
					return BuildMembers(Strings.ExtentionMethods, type.ExtentionMethods, true);
				case MemberTypeSection.Operators:
					return BuildMembers(Strings.Operators, type.Operators);
				case MemberTypeSection.Fields:
					return BuildMembers(Strings.Fields, type.Fields);
				case MemberTypeSection.Events:
					return BuildMembers(Strings.Events, type.Events);
				default: throw new Exception();
			}
		}
Esempio n. 6
0
		private static void AddMembers(OfflineDynamicPage parentNode, TypeDom type, MemberDom[] members, MemberTypeSection section)
		{
			if (members == null || members.Length == 0)
				return;

			var sectionItem = new OfflineDynamicPage
			{
				Parent = parentNode,
				UrlPart = parentNode.UrlPart + "/" + section.ToString(),
				RussianTitle = GenerateHtml.GetSectionName(section),
				RussianContent = GenerateHtml.Generate(new TypePartialData { SectionType = section, Type = type }),
			};

			if (section == MemberTypeSection.Methods || section == MemberTypeSection.ExtentionMethods)
				GenerateMethods((MethodDom[])members, sectionItem, parentNode.UrlPart);
			else
			{
				foreach (var member in members)
				{
					//ToDo: Группировка переопределенных методов.
					var memberItem = new OfflineDynamicPage
					{
						Parent = sectionItem,
						UrlPart = parentNode.UrlPart + "/" + member.SimpleName,
						RussianTitle = member.ShortSignature,
						RussianContent = GenerateHtml.Generate(member),
					};
					sectionItem.Childs.Add(memberItem);
				}
			}

			parentNode.Childs.Add(sectionItem);
		}
Esempio n. 7
0
        private static void AddMembers(OfflineDynamicPage parentNode, TypeDom type, MemberDom[] members, MemberTypeSection section)
        {
            if (members == null || members.Length == 0)
            {
                return;
            }

            var sectionItem = new OfflineDynamicPage
            {
                Parent         = parentNode,
                UrlPart        = parentNode.UrlPart + "/" + section.ToString(),
                RussianTitle   = GenerateHtml.GetSectionName(section),
                RussianContent = GenerateHtml.Generate(new TypePartialData {
                    SectionType = section, Type = type
                }),
            };

            if (section == MemberTypeSection.Methods || section == MemberTypeSection.ExtentionMethods)
            {
                GenerateMethods((MethodDom[])members, sectionItem, parentNode.UrlPart);
            }
            else
            {
                foreach (var member in members)
                {
                    //ToDo: Группировка переопределенных методов.
                    var memberItem = new OfflineDynamicPage
                    {
                        Parent         = sectionItem,
                        UrlPart        = parentNode.UrlPart + "/" + member.SimpleName,
                        RussianTitle   = member.ShortSignature,
                        RussianContent = GenerateHtml.Generate(member),
                    };
                    sectionItem.Childs.Add(memberItem);
                }
            }

            parentNode.Childs.Add(sectionItem);
        }
Esempio n. 8
0
		public static string GetSectionName(MemberTypeSection section)
		{
			return Names[section.ToString()];
		}