コード例 #1
0
ファイル: HTMLDocumenter.cs プロジェクト: Q42/ImmDoc.NET
    private string[] ObtainListOfMembersSectionsNames(MyClassInfo myClassInfo)
    {
      if (myClassInfo is MyEnumerationInfo || myClassInfo is MyDelegateInfo)
      {
        Debug.Assert(false, String.Format("Impossible! We don't want to create member's index of type '{0}'.", myClassInfo.GetType()));
        return null;
      }

      List<string> result = new List<string>();

      int classMembersGroupTypeIndex = 0;
      int sectionIndex = 0;
      while (Enum.IsDefined(typeof(ClassMembersGroups), classMembersGroupTypeIndex))
      {
        ClassMembersGroups classMembersGroupType = (ClassMembersGroups)classMembersGroupTypeIndex;

        if (myClassInfo.GetMembersCount(classMembersGroupType) > 0)
        {
          string sectionName = MyClassInfo.ClassMembersGroupsToString(classMembersGroupType);
          int tmpSectionIndex = sectionIndex;

          tmpSectionIndex++;
          if (myClassInfo.HasProtectedInternalGroupOfTheSameType(classMembersGroupType))
          {
            sectionName += String.Format(" ${{SectionReference:{0}:{1}}}", tmpSectionIndex, "Protected Internal");
          }

          tmpSectionIndex++;
          if (myClassInfo.HasProtectedGroupOfTheSameType(classMembersGroupType))
          {
            sectionName += String.Format(" ${{SectionReference:{0}:{1}}}", tmpSectionIndex, "Protected");
          }

          tmpSectionIndex++;
          if (myClassInfo.HasInternalGroupOfTheSameType(classMembersGroupType))
          {
            sectionName += String.Format(" ${{SectionReference:{0}:{1}}}", tmpSectionIndex, "Internal");
          }

          tmpSectionIndex++;
          if (myClassInfo.HasPrivateGroupOfTheSameType(classMembersGroupType))
          {
            sectionName += String.Format(" ${{SectionReference:{0}:{1}}}", tmpSectionIndex, "Private");
          }

          result.Add(sectionName);
        }

        classMembersGroupTypeIndex++;
        sectionIndex++;
      }

      return result.ToArray();
    }
コード例 #2
0
ファイル: HTMLDocumenter.cs プロジェクト: Q42/ImmDoc.NET
    private string[] ObtainListOfMembersSectionsShortcutsNamesAndIndices(MyClassInfo myClassInfo)
    {
      if (myClassInfo is MyEnumerationInfo || myClassInfo is MyDelegateInfo)
      {
        Debug.Assert(false, String.Format("Impossible! We don't want to create member's index of type '{0}'.", myClassInfo.GetType()));
        return null;
      }

      List<string> result = new List<string>();

      int classMembersGroupTypeIndex = 0;
      int sectionIndex = 0;
      while (Enum.IsDefined(typeof(ClassMembersGroups), classMembersGroupTypeIndex))
      {
        ClassMembersGroups classMembersGroupType = (ClassMembersGroups)classMembersGroupTypeIndex;

        if (myClassInfo.GetMembersCount(classMembersGroupType) > 0)
        {
          if (MyClassInfo.IsMembersGroupPublic(classMembersGroupType))
          {
            result.Add(MyClassInfo.GetBaseGroupName(classMembersGroupType) + ":" + sectionIndex);
          }
        }

        classMembersGroupTypeIndex++;
        sectionIndex++;
      }

      return result.ToArray();
    }