private void EnumerateStringResources(ResourceMapScope scope, string pathPrefix, bool dotAsPathSeparator, List <StringResource> stringResources) { foreach (ResourceMapItem childItem in scope.Children.OfType <ResourceMapItem>()) { string path; if (dotAsPathSeparator) { path = pathPrefix == string.Empty ? childItem.Name : pathPrefix + "." + childItem.Name; } else { path = childItem.FullName; } AddStringResources(childItem, path, stringResources); } foreach (ResourceMapScope childScope in scope.Children.OfType <ResourceMapScope>()) { string path = pathPrefix == string.Empty ? childScope.Name : pathPrefix + "." + childScope.Name; EnumerateStringResources(childScope, path, dotAsPathSeparator, stringResources); } }
public ScopeDetailPage(PriFile priFile, Stream priStream, ResourceMapScope scope) { InitializeComponent(); this.priFile = priFile; this.priStream = priStream; bool dotAsPathSeparator = scope.FullName.Contains(@"\Resources"); List <StringResource> stringResources = new List <StringResource>(); EnumerateStringResources(scope, string.Empty, dotAsPathSeparator, stringResources); keyValueListView.ItemsSource = stringResources; }