private string GetDisplayText(
                State state,
                bool isAbstract,
                bool generateProperty)
            {
                switch (state.MethodGenerationKind)
                {
                case MethodGenerationKind.Member:
                    var text = generateProperty ?
                               isAbstract ? FeaturesResources.Generate_abstract_property_0 : FeaturesResources.Generate_property_0 :
                               isAbstract ? FeaturesResources.Generate_abstract_method_0 : FeaturesResources.Generate_method_0;

                    var name = state.IdentifierToken.ValueText;
                    return(string.Format(text, name));

                case MethodGenerationKind.ImplicitConversion:
                    return(_service.GetImplicitConversionDisplayText(_state));

                case MethodGenerationKind.ExplicitConversion:
                    return(_service.GetExplicitConversionDisplayText(_state));

                default:
                    throw ExceptionUtilities.UnexpectedValue(state.MethodGenerationKind);
                }
            }
Пример #2
0
            private string GetDisplayText(
                State state,
                bool isAbstract,
                bool generateProperty)
            {
                switch (state.MethodGenerationKind)
                {
                case MethodGenerationKind.Member:
                    var text = generateProperty ?
                               isAbstract ? FeaturesResources.GenerateAbstractProperty : FeaturesResources.GeneratePropertyIn :
                               isAbstract ? FeaturesResources.GenerateAbstractMethod : FeaturesResources.GenerateMethodIn;

                    var name        = state.IdentifierToken.ValueText;
                    var destination = state.TypeToGenerateIn.Name;
                    return(string.Format(text, name, destination));

                case MethodGenerationKind.ImplicitConversion:
                    return(_service.GetImplicitConversionDisplayText(_state));

                case MethodGenerationKind.ExplicitConversion:
                    return(_service.GetExplicitConversionDisplayText(_state));

                default:
                    throw ExceptionUtilities.Unreachable;
                }
            }