Beispiel #1
0
        /// <summary>
        /// Looks up the <see cref="MemberTypeSetting"/> associated with the specified kind, otherwise null.
        /// </summary>
        /// <param name="kindCodeItem">The kind of code item.</param>
        /// <returns>The associated <see cref="MemberTypeSetting"/>, otherwise null.</returns>
        public static MemberTypeSetting LookupByKind(KindCodeItem kindCodeItem)
        {
            switch (kindCodeItem)
            {
            case KindCodeItem.Class: return(ClassSettings);

            case KindCodeItem.Constructor: return(ConstructorSettings);

            case KindCodeItem.Delegate: return(DelegateSettings);

            case KindCodeItem.Destructor: return(DestructorSettings);

            case KindCodeItem.Enum: return(EnumSettings);

            case KindCodeItem.Event: return(EventSettings);

            case KindCodeItem.Field: return(FieldSettings);

            case KindCodeItem.Indexer: return(IndexerSettings);

            case KindCodeItem.Interface: return(InterfaceSettings);

            case KindCodeItem.Method: return(MethodSettings);

            case KindCodeItem.Property: return(PropertySettings);

            case KindCodeItem.Struct: return(StructSettings);

            default: return(null);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Determines if the specified kind of code item should generally be followed by a blank
        /// line. Exceptions may apply at the instance level. Defaults to false for unknown kinds.
        /// </summary>
        /// <param name="kindCodeItem">The kind of code item.</param>
        /// <returns>
        /// True if kind of code item should be followed by a blank line, otherwise false.
        /// </returns>
        internal bool ShouldKindBeFollowedByBlankLine(KindCodeItem kindCodeItem)
        {
            switch (kindCodeItem)
            {
            case KindCodeItem.Class:
                return(Settings.Default.Cleaning_InsertBlankLinePaddingAfterClasses);

            case KindCodeItem.Delegate:
                return(Settings.Default.Cleaning_InsertBlankLinePaddingAfterDelegates);

            case KindCodeItem.Enum:
                return(Settings.Default.Cleaning_InsertBlankLinePaddingAfterEnumerations);

            case KindCodeItem.Event:
                return(Settings.Default.Cleaning_InsertBlankLinePaddingAfterEvents);

            case KindCodeItem.Field:
                return(Settings.Default.Cleaning_InsertBlankLinePaddingAfterFieldsMultiLine);

            case KindCodeItem.Interface:
                return(Settings.Default.Cleaning_InsertBlankLinePaddingAfterInterfaces);

            case KindCodeItem.Namespace:
                return(Settings.Default.Cleaning_InsertBlankLinePaddingAfterNamespaces);

            case KindCodeItem.Constructor:
            case KindCodeItem.Destructor:
            case KindCodeItem.Method:
                return(Settings.Default.Cleaning_InsertBlankLinePaddingAfterMethods);

            case KindCodeItem.Indexer:
            case KindCodeItem.Property:
                return(Settings.Default.Cleaning_InsertBlankLinePaddingAfterProperties);

            case KindCodeItem.Region:
                return(Settings.Default.Cleaning_InsertBlankLinePaddingAfterEndRegionTags);

            case KindCodeItem.Struct:
                return(Settings.Default.Cleaning_InsertBlankLinePaddingAfterStructs);

            case KindCodeItem.Using:
                return(Settings.Default.Cleaning_InsertBlankLinePaddingAfterUsingStatementBlocks);

            default:
                return(false);
            }
        }
Beispiel #3
0
        /// <summary>
        /// Determines if the specified kind of code item should generally be preceded by a blank
        /// line. Exceptions may apply at the instance level. Defaults to false for unknown kinds.
        /// </summary>
        /// <param name="kindCodeItem">The kind of code item.</param>
        /// <returns>
        /// True if kind of code item should be preceded by a blank line, otherwise false.
        /// </returns>
        internal bool ShouldKindBePrecededByBlankLine(KindCodeItem kindCodeItem)
        {
            switch (kindCodeItem)
            {
            case KindCodeItem.Class:
                return(Settings.Default.Cleaning_InsertBlankLinePaddingBeforeClasses);

            case KindCodeItem.Delegate:
                return(Settings.Default.Cleaning_InsertBlankLinePaddingBeforeDelegates);

            case KindCodeItem.Enum:
                return(Settings.Default.Cleaning_InsertBlankLinePaddingBeforeEnumerations);

            case KindCodeItem.Event:
                return(Settings.Default.Cleaning_InsertBlankLinePaddingBeforeEvents);

            case KindCodeItem.Field:
                return(Settings.Default.Cleaning_InsertBlankLinePaddingBeforeFieldsMultiLine);

            case KindCodeItem.Interface:
                return(Settings.Default.Cleaning_InsertBlankLinePaddingBeforeInterfaces);

            case KindCodeItem.Namespace:
                return(Settings.Default.Cleaning_InsertBlankLinePaddingBeforeNamespaces);

            case KindCodeItem.Constructor:
            case KindCodeItem.Destructor:
            case KindCodeItem.Method:
                return(Settings.Default.Cleaning_InsertBlankLinePaddingBeforeMethods);

            case KindCodeItem.Indexer:
            case KindCodeItem.Property:
                return(Settings.Default.Cleaning_InsertBlankLinePaddingBeforeProperties);

            case KindCodeItem.Region:
                return(Settings.Default.Cleaning_InsertBlankLinePaddingBeforeRegionTags);

            case KindCodeItem.Struct:
                return(Settings.Default.Cleaning_InsertBlankLinePaddingBeforeStructs);

            case KindCodeItem.Using:
                return(Settings.Default.Cleaning_InsertBlankLinePaddingBeforeUsingStatementBlocks);

            default:
                return(false);
            }
        }
 /// <summary>
 /// Looks up the <see cref="MemberTypeSetting"/> associated with the specified kind, otherwise null.
 /// </summary>
 /// <param name="kindCodeItem">The kind of code item.</param>
 /// <returns>The associated <see cref="MemberTypeSetting"/>, otherwise null.</returns>
 public static MemberTypeSetting LookupByKind(KindCodeItem kindCodeItem)
 {
     switch (kindCodeItem)
     {
         case KindCodeItem.Class: return ClassSettings;
         case KindCodeItem.Constructor: return ConstructorSettings;
         case KindCodeItem.Delegate: return DelegateSettings;
         case KindCodeItem.Destructor: return DestructorSettings;
         case KindCodeItem.Enum: return EnumSettings;
         case KindCodeItem.Event: return EventSettings;
         case KindCodeItem.Field: return FieldSettings;
         case KindCodeItem.Indexer: return IndexerSettings;
         case KindCodeItem.Interface: return InterfaceSettings;
         case KindCodeItem.Method: return MethodSettings;
         case KindCodeItem.Property: return PropertySettings;
         case KindCodeItem.Struct: return StructSettings;
         default: return null;
     }
 }