Microsoft.CodeAnalysis.Sarif.Converters.FxCopConverter.CreateLogicalLocation C# (CSharp) Method

CreateLogicalLocation() private method

private CreateLogicalLocation ( FxCopLogReader context ) : string
context FxCopLogReader
return string
        private string CreateLogicalLocation(FxCopLogReader.Context context)
        {
            string parentLogicalLocationKey = null;
            string delimiter = null;

            if (!string.IsNullOrEmpty(context.Module))
            {
                parentLogicalLocationKey = TryAddLogicalLocation(parentLogicalLocationKey, context.Module, LogicalLocationKind.Module);
                delimiter = "!";
            }

            if (!string.IsNullOrEmpty(context.Resource))
            {
                parentLogicalLocationKey = TryAddLogicalLocation(parentLogicalLocationKey, context.Resource, LogicalLocationKind.Resource, delimiter);
                delimiter = ".";
            }

            if (!string.IsNullOrEmpty(context.Namespace))
            {
                parentLogicalLocationKey = TryAddLogicalLocation(parentLogicalLocationKey, context.Namespace, LogicalLocationKind.Namespace, delimiter);
                delimiter = ".";
            }

            if (!string.IsNullOrEmpty(context.Type))
            {
                parentLogicalLocationKey = TryAddLogicalLocation(parentLogicalLocationKey, context.Type, LogicalLocationKind.Type, delimiter);
                delimiter = ".";
            }

            if (!string.IsNullOrEmpty(context.Member))
            {
                string member = context.Member != null ? context.Member.Trim('#') : null;
                parentLogicalLocationKey = TryAddLogicalLocation(parentLogicalLocationKey, member, LogicalLocationKind.Member, delimiter);
            }

            return parentLogicalLocationKey;
        }