mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-13 04:26:49 +00:00
Combining repos
This commit is contained in:
parent
e196ad0419
commit
b5444e3544
358 changed files with 17256 additions and 10215 deletions
|
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
public static class IAttachVideoStatusExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the VideoStatusOutputs for the device
|
||||
/// </summary>
|
||||
/// <param name="attachDev"></param>
|
||||
/// <returns>Attached VideoStatusOutputs or the default if none attached</returns>
|
||||
public static VideoStatusOutputs GetVideoStatuses(this IAttachVideoStatus attachedDev)
|
||||
{
|
||||
// See if this device is connected to a status-providing port
|
||||
var tl = TieLineCollection.Default.FirstOrDefault(t =>
|
||||
t.SourcePort.ParentDevice == attachedDev
|
||||
&& t.DestinationPort is RoutingInputPortWithVideoStatuses);
|
||||
if (tl != null)
|
||||
{
|
||||
// if so, and it's got status, return it -- or null
|
||||
var port = tl.DestinationPort as RoutingInputPortWithVideoStatuses;
|
||||
if (port != null)
|
||||
return port.VideoStatus;
|
||||
}
|
||||
return VideoStatusOutputs.NoStatus;
|
||||
}
|
||||
|
||||
public static bool HasVideoStatuses(this IAttachVideoStatus attachedDev)
|
||||
{
|
||||
return TieLineCollection.Default.FirstOrDefault(t =>
|
||||
t.SourcePort.ParentDevice == attachedDev
|
||||
&& t.DestinationPort is RoutingInputPortWithVideoStatuses) != null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue