ICSharpCode.NRefactory.CSharp.Refactoring.BaseRefactoringContext.ParseFormatString C# (CSharp) Method

ParseFormatString() public method

Parses a composite format string.
public ParseFormatString ( string source ) : ICSharpCode.NRefactory.Utils.FormatStringParseResult
source string
return ICSharpCode.NRefactory.Utils.FormatStringParseResult
		public virtual FormatStringParseResult ParseFormatString(string source)
		{
			return new CompositeFormatStringParser().Parse(source);
		}

Usage Example

Example #1
0
            public override void VisitInvocationExpression(InvocationExpression invocationExpression)
            {
                base.VisitInvocationExpression(invocationExpression);
                var invocationResolveResult = context.Resolve(invocationExpression) as CSharpInvocationResolveResult;

                if (invocationResolveResult == null)
                {
                    return;
                }
                Expression         formatArgument;
                IList <Expression> formatArguments;
                TextLocation       formatStart;

                if (!FormatStringHelper.TryGetFormattingParameters(invocationResolveResult, invocationExpression,
                                                                   out formatArgument, out formatStart, out formatArguments, null))
                {
                    return;
                }
                var primitiveArgument = formatArgument as PrimitiveExpression;

                if (primitiveArgument == null || !(primitiveArgument.Value is String))
                {
                    return;
                }
                var format        = (string)primitiveArgument.Value;
                var parsingResult = context.ParseFormatString(format);

                CheckSegments(parsingResult.Segments, formatStart, formatArguments, invocationExpression);
            }
All Usage Examples Of ICSharpCode.NRefactory.CSharp.Refactoring.BaseRefactoringContext::ParseFormatString