Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManish Sinha <manish.sinha@xamarin.com>2019-08-20 18:42:01 +0300
committermonojenkins <jo.shields+jenkins@xamarin.com>2019-08-29 15:10:55 +0300
commit5bb695cad1f7d58f2757936513fba1a6d2e08b7f (patch)
treefedefbd0a7247fd1a686a9ae85d493edab2e6045
parente777e3c560c8dcb1217afc817ec5f4646d4d58c3 (diff)
[AutoTest] Flatten all the IRuntimeModel child heirarchy into single enumerable
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/NSObjectResult.cs13
1 files changed, 12 insertions, 1 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/NSObjectResult.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/NSObjectResult.cs
index a44718e75b..6c5c13ee79 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/NSObjectResult.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/NSObjectResult.cs
@@ -367,7 +367,8 @@ namespace MonoDevelop.Components.AutoTest.Results
var pObject = pinfo.GetValue (ResultObject, null);
LoggingService.LogDebug ($"'RuntimeModel' property on '{type}' is '{pObject}' and is of type '{pinfo.PropertyType}'");
- var model = (IEnumerable<IRuntimeModel>)pObject;
+ var topRunTimeModels = (IEnumerable<IRuntimeModel>)pObject;
+ var model = AllRuntimes (topRunTimeModels);
var runtime = model.FirstOrDefault (r => {
var mutableModel = r.GetMutableModel ();
@@ -410,6 +411,16 @@ namespace MonoDevelop.Components.AutoTest.Results
}
return false;
}
+
+ IEnumerable<IRuntimeModel> AllRuntimes (IEnumerable<IRuntimeModel> runtimes)
+ {
+ foreach (var runtime in runtimes) {
+ yield return runtime;
+ foreach (var childRuntime in AllRuntimes (runtime.Children))
+ yield return childRuntime;
+ }
+ }
+
#endregion
protected override void Dispose (bool disposing)