本文整理汇总了C#中OpenSource.UPnP.UPnPArgument类的典型用法代码示例。如果您正苦于以下问题:C# UPnPArgument类的具体用法?C# UPnPArgument怎么用?C# UPnPArgument使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UPnPArgument类属于OpenSource.UPnP命名空间,在下文中一共展示了UPnPArgument类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetVerticalKeystone
public int GetVerticalKeystone(System.UInt32 InstanceID)
{
UPnPArgument[] args = new UPnPArgument[2];
args[0] = new UPnPArgument("InstanceID", InstanceID);
args[1] = new UPnPArgument("CurrentVerticalKeystone", "");
return(_S.InvokeAsync("GetVerticalKeystone", args, new UPnPService.UPnPServiceInvokeHandler(Sink_GetVerticalKeystone), new UPnPService.UPnPServiceInvokeErrorHandler(Error_Sink_GetVerticalKeystone)));
}
示例2: Sink_SetVerticalKeystone
private void Sink_SetVerticalKeystone(UPnPService sender, string MethodName, UPnPArgument[] Args, object RetVal, int Handle)
{
if(OnResult_SetVerticalKeystone != null)
{
OnResult_SetVerticalKeystone((System.UInt32 )Args[0].DataValue, (System.Int16 )Args[1].DataValue, null, Handle);
}
WeakReference[] w = (WeakReference[])WeakList_SetVerticalKeystone.ToArray(typeof(WeakReference));
foreach(WeakReference wr in w)
{
if(wr.IsAlive==true)
{
((Delegate_OnResult_SetVerticalKeystone)wr.Target)((System.UInt32 )Args[0].DataValue, (System.Int16 )Args[1].DataValue, null, Handle);
}
else
{
WeakList_SetVerticalKeystone.Remove(wr);
}
}
}
示例3: InterfaceControl
public object InterfaceControl(MIGInterfaceCommand request)
{
string returnValue = "";
bool raisePropertyChanged = false;
string parameterPath = "Status.Unhandled";
string raiseParameter = "";
//
var device = GetUpnpDevice(request.NodeId);
//////////////////// Commands: SwitchPower, Dimming
if (request.Command == Command.CONTROL_ON || request.Command == Command.CONTROL_OFF)
{
bool commandValue = (request.Command == Command.CONTROL_ON ? true : false);
var newValue = new UPnPArgument("newTargetValue", commandValue);
var args = new UPnPArgument[] {
newValue
};
InvokeUpnpDeviceService(device, "SwitchPower", "SetTarget", args);
//
raisePropertyChanged = true;
parameterPath = "Status.Level";
raiseParameter = (commandValue ? "1" : "0");
}
else if (request.Command == Command.CONTROL_LEVEL)
{
var newvalue = new UPnPArgument("NewLoadLevelTarget", (byte)uint.Parse(request.GetOption(0)));
var args = new UPnPArgument[] {
newvalue
};
InvokeUpnpDeviceService(device, "Dimming", "SetLoadLevelTarget", args);
//
raisePropertyChanged = true;
parameterPath = "Status.Level";
raiseParameter = (double.Parse(request.GetOption(0)) / 100d).ToString(System.Globalization.CultureInfo.InvariantCulture);
}
else if (request.Command == Command.CONTROL_TOGGLE)
{
}
//////////////////// Commands: Browse, AVTransport
else if (request.Command == Command.AVMEDIA_GETURI)
{
string deviceId = request.NodeId;
string id = request.GetOption(0);
//
var objectId = new UPnPArgument("ObjectID", id);
var flags = new UPnPArgument("BrowseFlag", "BrowseMetadata");
var filter = new UPnPArgument(
"Filter",
"upnp:album,upnp:artist,upnp:genre,upnp:title,[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]"
);
var startIndex = new UPnPArgument("StartingIndex", (uint)0);
var requestedCount = new UPnPArgument("RequestedCount", (uint)1);
var sortCriteria = new UPnPArgument("SortCriteria", "");
//
var result = new UPnPArgument("Result", "");
var returnedNumber = new UPnPArgument("NumberReturned", "");
var totalMatches = new UPnPArgument("TotalMatches", "");
var updateId = new UPnPArgument("UpdateID", "");
//
InvokeUpnpDeviceService(device, "ContentDirectory", "Browse", new UPnPArgument[] {
objectId,
flags,
filter,
startIndex,
requestedCount,
sortCriteria,
result,
returnedNumber,
totalMatches,
updateId
});
//
try
{
string ss = result.DataValue.ToString();
var item = XDocument.Parse(ss, LoadOptions.SetBaseUri).Descendants().Where(ii => ii.Name.LocalName == "item").First();
//
foreach (var i in item.Elements())
{
var protocolUri = i.Attribute("protocolInfo");
if (protocolUri != null)
{
returnValue = i.Value;
break;
}
}
}
catch
{
}
}
else if (request.Command == Command.AVMEDIA_BROWSE)
{
string deviceId = request.NodeId;
string id = request.GetOption(0);
//
var objectId = new UPnPArgument("ObjectID", id);
var flags = new UPnPArgument("BrowseFlag", "BrowseDirectChildren");
var filter = new UPnPArgument(
//.........这里部分代码省略.........
示例4: Error_Sink_SetColorTemperature
private void Error_Sink_SetColorTemperature(UPnPService sender, string MethodName, UPnPArgument[] Args, UPnPInvokeException e, int Handle)
{
if(OnResult_SetColorTemperature != null)
{
OnResult_SetColorTemperature((System.UInt32 )Args[0].DataValue, (System.UInt16)UPnPService.CreateObjectInstance(typeof(System.UInt16),null), e, Handle);
}
WeakReference[] w = (WeakReference[])WeakList_SetColorTemperature.ToArray(typeof(WeakReference));
foreach(WeakReference wr in w)
{
if(wr.IsAlive==true)
{
((Delegate_OnResult_SetColorTemperature)wr.Target)((System.UInt32 )Args[0].DataValue, (System.UInt16)UPnPService.CreateObjectInstance(typeof(System.UInt16),null), e, Handle);
}
else
{
WeakList_SetColorTemperature.Remove(wr);
}
}
}
示例5: Error_Sink_SetSharpness
private void Error_Sink_SetSharpness(UPnPService sender, string MethodName, UPnPArgument[] Args, UPnPInvokeException e, int Handle)
{
if(OnResult_SetSharpness != null)
{
OnResult_SetSharpness((System.UInt32 )Args[0].DataValue, (System.UInt16 )Args[1].DataValue, e, Handle);
}
WeakReference[] w = (WeakReference[])WeakList_SetSharpness.ToArray(typeof(WeakReference));
foreach(WeakReference wr in w)
{
if(wr.IsAlive==true)
{
((Delegate_OnResult_SetSharpness)wr.Target)((System.UInt32 )Args[0].DataValue, (System.UInt16 )Args[1].DataValue, e, Handle);
}
else
{
WeakList_SetSharpness.Remove(wr);
}
}
}
示例6: Sync_SetRedVideoGain
public void Sync_SetRedVideoGain(System.UInt32 InstanceID, System.UInt16 DesiredRedVideoGain)
{
UPnPArgument[] args = new UPnPArgument[2];
args[0] = new UPnPArgument("InstanceID", InstanceID);
args[1] = new UPnPArgument("DesiredRedVideoGain", DesiredRedVideoGain);
_S.InvokeSync("SetRedVideoGain", args);
InstanceID = (System.UInt32) args[0].DataValue;
DesiredRedVideoGain = (System.UInt16) args[1].DataValue;
return;
}
示例7: Sync_SetVerticalKeystone
public void Sync_SetVerticalKeystone(System.UInt32 InstanceID, System.Int16 DesiredVerticalKeystone)
{
UPnPArgument[] args = new UPnPArgument[2];
args[0] = new UPnPArgument("InstanceID", InstanceID);
args[1] = new UPnPArgument("DesiredVerticalKeystone", DesiredVerticalKeystone);
_S.InvokeSync("SetVerticalKeystone", args);
InstanceID = (System.UInt32) args[0].DataValue;
DesiredVerticalKeystone = (System.Int16) args[1].DataValue;
return;
}
示例8: SetSharpness
public int SetSharpness(System.UInt32 InstanceID, System.UInt16 DesiredSharpness)
{
UPnPArgument[] args = new UPnPArgument[2];
args[0] = new UPnPArgument("InstanceID", InstanceID);
args[1] = new UPnPArgument("DesiredSharpness", DesiredSharpness);
return(_S.InvokeAsync("SetSharpness", args, new UPnPService.UPnPServiceInvokeHandler(Sink_SetSharpness), new UPnPService.UPnPServiceInvokeErrorHandler(Error_Sink_SetSharpness)));
}
示例9: SetVerticalKeystone
public int SetVerticalKeystone(System.UInt32 InstanceID, System.Int16 DesiredVerticalKeystone)
{
UPnPArgument[] args = new UPnPArgument[2];
args[0] = new UPnPArgument("InstanceID", InstanceID);
args[1] = new UPnPArgument("DesiredVerticalKeystone", DesiredVerticalKeystone);
return(_S.InvokeAsync("SetVerticalKeystone", args, new UPnPService.UPnPServiceInvokeHandler(Sink_SetVerticalKeystone), new UPnPService.UPnPServiceInvokeErrorHandler(Error_Sink_SetVerticalKeystone)));
}
示例10: SetGreenVideoBlackLevel
public int SetGreenVideoBlackLevel(System.UInt32 InstanceID, System.UInt16 DesiredGreenVideoBlackLevel)
{
UPnPArgument[] args = new UPnPArgument[2];
args[0] = new UPnPArgument("InstanceID", InstanceID);
args[1] = new UPnPArgument("DesiredGreenVideoBlackLevel", DesiredGreenVideoBlackLevel);
return(_S.InvokeAsync("SetGreenVideoBlackLevel", args, new UPnPService.UPnPServiceInvokeHandler(Sink_SetGreenVideoBlackLevel), new UPnPService.UPnPServiceInvokeErrorHandler(Error_Sink_SetGreenVideoBlackLevel)));
}
示例11: SetRedVideoGain
public int SetRedVideoGain(System.UInt32 InstanceID, System.UInt16 DesiredRedVideoGain)
{
UPnPArgument[] args = new UPnPArgument[2];
args[0] = new UPnPArgument("InstanceID", InstanceID);
args[1] = new UPnPArgument("DesiredRedVideoGain", DesiredRedVideoGain);
return(_S.InvokeAsync("SetRedVideoGain", args, new UPnPService.UPnPServiceInvokeHandler(Sink_SetRedVideoGain), new UPnPService.UPnPServiceInvokeErrorHandler(Error_Sink_SetRedVideoGain)));
}
示例12: SetColorTemperature
public int SetColorTemperature(System.UInt32 InstanceID)
{
UPnPArgument[] args = new UPnPArgument[2];
args[0] = new UPnPArgument("InstanceID", InstanceID);
args[1] = new UPnPArgument("DesiredColorTemperature", "");
return(_S.InvokeAsync("SetColorTemperature", args, new UPnPService.UPnPServiceInvokeHandler(Sink_SetColorTemperature), new UPnPService.UPnPServiceInvokeErrorHandler(Error_Sink_SetColorTemperature)));
}
示例13: SelectPreset
public int SelectPreset(System.UInt32 InstanceID, Enum_A_ARG_TYPE_PresetName PresetName)
{
UPnPArgument[] args = new UPnPArgument[2];
args[0] = new UPnPArgument("InstanceID", InstanceID);
switch(PresetName)
{
case Enum_A_ARG_TYPE_PresetName.FACTORYDEFAULTS:
args[1] = new UPnPArgument("PresetName", "FactoryDefaults");
break;
case Enum_A_ARG_TYPE_PresetName.INSTALLATIONDEFAULTS:
args[1] = new UPnPArgument("PresetName", "InstallationDefaults");
break;
case Enum_A_ARG_TYPE_PresetName.VENDOR_DEFINED:
args[1] = new UPnPArgument("PresetName", "Vendor defined");
break;
default:
args[1] = new UPnPArgument("PresetName", GetUnspecifiedValue("Enum_A_ARG_TYPE_PresetName"));
break;
}
return(_S.InvokeAsync("SelectPreset", args, new UPnPService.UPnPServiceInvokeHandler(Sink_SelectPreset), new UPnPService.UPnPServiceInvokeErrorHandler(Error_Sink_SelectPreset)));
}
示例14: ListPresets
public int ListPresets(System.UInt32 InstanceID)
{
UPnPArgument[] args = new UPnPArgument[2];
args[0] = new UPnPArgument("InstanceID", InstanceID);
args[1] = new UPnPArgument("CurrentPresetNameList", "");
return(_S.InvokeAsync("ListPresets", args, new UPnPService.UPnPServiceInvokeHandler(Sink_ListPresets), new UPnPService.UPnPServiceInvokeErrorHandler(Error_Sink_ListPresets)));
}
示例15: Sync_SetColorTemperature
public void Sync_SetColorTemperature(System.UInt32 InstanceID, out System.UInt16 DesiredColorTemperature)
{
UPnPArgument[] args = new UPnPArgument[2];
args[0] = new UPnPArgument("InstanceID", InstanceID);
args[1] = new UPnPArgument("DesiredColorTemperature", "");
_S.InvokeSync("SetColorTemperature", args);
InstanceID = (System.UInt32) args[0].DataValue;
DesiredColorTemperature = (System.UInt16) args[1].DataValue;
return;
}