mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 12:44:58 +00:00
Merge pull request #534 from PepperDash/feature/get-prop-by-name-fixes
Feature/get prop by name fixes
This commit is contained in:
@@ -83,13 +83,13 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static object GetPropertyByName(string deviceObjectPath, string propertyName)
|
public static object GetPropertyByName(string deviceObjectPath, string propertyName)
|
||||||
{
|
{
|
||||||
var obj = FindObjectOnPath(deviceObjectPath);
|
var dev = FindObjectOnPath(deviceObjectPath);
|
||||||
if(obj == null)
|
if(dev == null)
|
||||||
return "{ \"error\":\"No Device\"}";
|
return "{ \"error\":\"No Device\"}";
|
||||||
|
|
||||||
|
object prop = dev.GetType().GetCType().GetProperty(propertyName).GetValue(dev, null);
|
||||||
|
|
||||||
CType t = obj.GetType();
|
// var prop = t.GetProperty(propertyName);
|
||||||
|
|
||||||
var prop = t.GetProperty(propertyName);
|
|
||||||
if (prop != null)
|
if (prop != null)
|
||||||
{
|
{
|
||||||
return prop;
|
return prop;
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.Interfaces
|
||||||
|
{
|
||||||
|
public interface ILogStrings : IKeyed
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Defines a class that is capable of logging a string
|
||||||
|
/// </summary>
|
||||||
|
void SendToLog(IKeyed device, string logMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.Interfaces
|
||||||
|
{
|
||||||
|
public interface ILogStringsWithLevel : IKeyed
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Defines a class that is capable of logging a string with an int level
|
||||||
|
/// </summary>
|
||||||
|
void SendToLog(IKeyed device, Debug.ErrorLogLevel level,string logMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -224,6 +224,8 @@
|
|||||||
<Compile Include="Gateways\CenRfgwController.cs" />
|
<Compile Include="Gateways\CenRfgwController.cs" />
|
||||||
<Compile Include="Gateways\EssentialsRfGatewayConfig.cs" />
|
<Compile Include="Gateways\EssentialsRfGatewayConfig.cs" />
|
||||||
<Compile Include="Global\EthernetAdapterInfo.cs" />
|
<Compile Include="Global\EthernetAdapterInfo.cs" />
|
||||||
|
<Compile Include="Interfaces\ILogStrings.cs" />
|
||||||
|
<Compile Include="Interfaces\ILogStringsWithLevel.cs" />
|
||||||
<Compile Include="Queues\ComsMessage.cs" />
|
<Compile Include="Queues\ComsMessage.cs" />
|
||||||
<Compile Include="Queues\ProcessStringMessage.cs" />
|
<Compile Include="Queues\ProcessStringMessage.cs" />
|
||||||
<Compile Include="Queues\GenericQueue.cs" />
|
<Compile Include="Queues\GenericQueue.cs" />
|
||||||
|
|||||||
@@ -65,12 +65,12 @@
|
|||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
<Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
|
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
<Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
|
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SimplSharpNewtonsoft, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
<Reference Include="SimplSharpNewtonsoft, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
@@ -79,7 +79,7 @@
|
|||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SimplSharpPro, Version=1.5.3.17, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
<Reference Include="SimplSharpPro, Version=1.5.3.17, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath>
|
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SimplSharpReflectionInterface, Version=1.0.5583.25238, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
<Reference Include="SimplSharpReflectionInterface, Version=1.0.5583.25238, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
|
|||||||
@@ -69,12 +69,12 @@
|
|||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
<Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
|
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
<Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
|
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SimplSharpNewtonsoft, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
<Reference Include="SimplSharpNewtonsoft, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
@@ -83,7 +83,7 @@
|
|||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SimplSharpPro, Version=1.5.3.17, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
<Reference Include="SimplSharpPro, Version=1.5.3.17, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath>
|
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SimplSharpReflectionInterface, Version=1.0.5583.25238, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
<Reference Include="SimplSharpReflectionInterface, Version=1.0.5583.25238, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
|
|||||||
Reference in New Issue
Block a user