Esempio n. 1
0
 public IModelTime CreateModelTime(ISource aSource)
 {
     if (aSource != null && aSource is Source)
     {
         Source source = aSource as Source;
         if (aSource.Type == kSourceUpnpAv)
         {
             ModelSourceMediaRendererUpnpAv result = CheckModelCache(iModelSourceCache, source) as ModelSourceMediaRendererUpnpAv;
             if (result == null)
             {
                 result = new ModelSourceMediaRendererUpnpAv(source);
                 AddToCache(iModelSourceCache, (result as ModelSource), source);
             }
             return(result);
         }
         else
         {
             IModelTime result = CheckModelCache(iModelTimeCache, source);
             if (result == null)
             {
                 result = new ModelTime(source);
                 AddToCache(iModelTimeCache, result, source);
             }
             return(result);
         }
     }
     return(null);
 }
Esempio n. 2
0
 public IModelSourceMediaRenderer CreateModelSourceMediaRenderer(ISource aSource)
 {
     if (aSource != null && aSource is Source)
     {
         Source source = aSource as Source;
         ModelSourceMediaRenderer result = CheckModelCache(iModelSourceCache, source) as ModelSourceMediaRenderer;
         if (result == null)
         {
             if (aSource.Type == kSourceUpnpAv)
             {
                 result = new ModelSourceMediaRendererUpnpAv(source);
             }
             else
             {
                 result = new ModelSourceMediaRendererDs(source);
             }
             AddToCache(iModelSourceCache, result, source);
         }
         return(result);
     }
     return(null);
 }