Example #1
0
		void SearchResourceTreeNodes(LoadedAssembly module, ResourceTreeNode resTreeNode) {
			var res = filter.GetFilterResult(resTreeNode);
			if (res.FilterResult == FilterResult.Hidden)
				return;

			if (res.IsMatch && (IsMatch(resTreeNode.Name, resTreeNode) || IsMatch(resTreeNode.GetStringContents(), null))) {
				onMatch(new SearchResult {
					Language = language,
					Object = resTreeNode,
					NameObject = resTreeNode,
					TypeImageInfo = GetImage(resTreeNode.IconName),
					LocationObject = module.ModuleDefinition,
					LocationImageInfo = GetImage("AssemblyModule"),
					LoadedAssembly = module,
				});
			}

			res = filter.GetFilterResult((ResourceElementTreeNode)null);
			if (res.FilterResult == FilterResult.Hidden)
				return;

			var resNodes = new List<ResourceElementTreeNode>();
			App.Current.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(() => {
				resTreeNode.EnsureChildrenFiltered();
				resNodes.AddRange(resTreeNode.Children.Cast<ResourceElementTreeNode>());
			}));

			foreach (var resElNode in resNodes)
				SearchResourceElementTreeNode(module, resTreeNode, resElNode);
		}
 public override string GetStringContents()
 {
     if (resElem.ResourceData.Code == ResourceTypeCode.ByteArray || resElem.ResourceData.Code == ResourceTypeCode.Stream)
     {
         var data = (byte[])((BuiltInResourceData)resElem.ResourceData).Data;
         return(ResourceTreeNode.GetStringContents(new MemoryStream(data)));
     }
     return(null);
 }