예제 #1
0
        internal static void AddSealedClassIndexerInheritanceModifierSteps(
            this List <ISourceCodeBuilderStep> steps,
            SealedClassIndexerInheritanceModifier inheritanceModifer)
        {
            switch (inheritanceModifer)
            {
            case SealedClassIndexerInheritanceModifier.None:
                return;

            case SealedClassIndexerInheritanceModifier.New:
            case SealedClassIndexerInheritanceModifier.Override:
                steps.Add(new WriteSealedClassIndexerInheritanceModifier(inheritanceModifer));
                break;

            case SealedClassIndexerInheritanceModifier.SealedOverride:
                steps.Add(new WriteSealed());
                steps.Add(new WriteWhitespace());
                steps.Add(new WriteSealedClassIndexerInheritanceModifier(SealedClassIndexerInheritanceModifier.Override));
                break;
            }

            steps.Add(new WriteWhitespace());
        }
예제 #2
0
 public static SyntaxTokenList WithSealedClassIndexerInheritanceModifier(
     this SyntaxTokenList tokens,
     SealedClassIndexerInheritanceModifier modifier)
 {
     return(tokens.WithClassMemberInheritanceModifier(sealedClassIndexerModifierMap.First(entry => entry.Value == modifier).Key));
 }
 public WriteSealedClassIndexerInheritanceModifier(SealedClassIndexerInheritanceModifier inheritanceModifier)
 {
     InheritanceModifier = inheritanceModifier;
 }