コード例 #1
0
 private bool ObjectIsSuitable(IAmObject obj) => exactObj != null ? exactObj == obj : obj is TObj;
コード例 #2
0
 private static void AddAllUsedResourceSources(ISet <IResourceSource> hashSet, IAmObject amObject)
 {
     foreach (var binding in amObject.Bindings)
     {
         var absVal = binding.GetAbstractValue();
         if (absVal is IResource resVal)
         {
             hashSet.Add(resVal.Source);
         }
         if (absVal is IAmObject amVal)
         {
             AddAllUsedResourceSources(hashSet, amVal);
         }
         if (absVal is IEnumerable <object> items)
         {
             foreach (var item in items)
             {
                 if (item is IResource resItem)
                 {
                     hashSet.Add(resItem.Source);
                 }
                 if (item is IAmObject amItem)
                 {
                     AddAllUsedResourceSources(hashSet, amItem);
                 }
             }
         }
     }
 }